Document quick fix (or whatever it's officially called)
See original GitHub issueTypeScript Version: 3.3.0-dev.201xxxxx
Search Terms: code fix quick fix suggestion
Code not entirely applicable, but this is what I had which caused me to get confused
const fs = require("fs");
Expected behavior:
Commandline tsc
should behave the same as editor integrations
Actual behavior: The “quick fix” feature, which appears to be called “code fixes” in the codebase and googling the messages led me to the json file which refers to them as “suggestions”, only appears to exist in the typescript server.
As a newcomer this had me extremely confused. I was running tsc
on the commandline and getting no errors, but seeing squiggly lines and messages in my editor (atom, in this case).
I was unable to find any documentation about where the message 'require' call may be converted to an import
was coming from, or that this was a hint that typescript was able to fix my code for me.
It would also be helpful if the tsc
client was able to list the code fix suggestions, even if giving it a way to apply them would be too complex.
Playground Link: n/a
Related Issues: none that I could find
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:10 (6 by maintainers)
After reporting typescript-eslint/typescript-eslint#1786 I was lead here. As I do not use vscode, I was completely unaware that
TypeScript
has built-in autofix capabilities outside of the language server. Would be very useful to have atsc --fix
command-line option similar to eslint, as these can be run in git hooks and other places.For anyone who interested