You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not seeing the tool to infer types form usage.. And IMO this should be the basic feature for a tool like this. I see you have focused more on code tranpilation like class declaration synyax, I think the most important part is being able to add acceptable types to variables , parameters, return types, etc (and not just add "any" to everything. So I wanted to give you a tip:
Fortunately the compiler language service is capable of inferring times for most of variables, parameters, etc. I found out it has LOTS of code-fixes that you can apply programatically. These are some examples (using ts-morph) library which provides an higher API, but it's also accomplished with compiler API directly:
I'm not seeing the tool to infer types form usage.. And IMO this should be the basic feature for a tool like this. I see you have focused more on code tranpilation like class declaration synyax, I think the most important part is being able to add acceptable types to variables , parameters, return types, etc (and not just add "any" to everything. So I wanted to give you a tip:
Fortunately the compiler language service is capable of inferring times for most of variables, parameters, etc. I found out it has LOTS of code-fixes that you can apply programatically. These are some examples (using ts-morph) library which provides an higher API, but it's also accomplished with compiler API directly:
This is a typescript-plugin that applies / suggests all codefixes available in the file tying suggestions in all ranges:
https://github.com/cancerberoSgx/typescript-plugins-of-mine/blob/master/typescript-plugin-all-ts-fixes-and-refactors/src/supportedCodeFixes.ts
You might find interesting this snippet that prints all code-fixes and refactors codes, names and descriptions:
https://github.com/cancerberoSgx/typescript-plugins-of-mine/blob/master/typescript-plugin-all-ts-fixes-and-refactors/src/supportedCodeFixes.ts
This one has a inferTypesFromUsage() function that is what I just suggested to add in your lib:
convert require to import:
these is a test that runs the for remove all unused variables ode fix:
Hope it helps! feel free to use the library or code. thanks! keep ip up!
The text was updated successfully, but these errors were encountered: