I'm tasked with cleaning our AngularJS project to remove unused imports and variables. I use VS Code and through TypeScript Hero extension I can do what I want to do one file at a time. However, is there a way to fix all typescript files in project?
For visual studio code, you can simply open your preference settings and add the following to your settings.json
:
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
You can also enable/disable on save per language using following setting.json
:
"editor.formatOnSave": true,
"[typescript]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
This new feature has been released since April last year in 2018. Hopefully this can be helpful!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With