TypeScript tip: quickly fixing mechanical linting errors with "tslint --fix"
Posted: (EET/GMT+2)
If you are developing TypeScript code along with your web or mobile applications, chances are you've incorporated TSLint into your build process.
If you haven't used linting tools for your JavaScript and/or TypeScript files before, chances are you will get plenty of warnings from your source files. Many of the fixes needed are purely mechanical, and thus you might start to think whether there's a tool to fix these for you, just like Visual Studio can fix problems in your C# files project or solution wide.
Luckily, it turns out TSLint has a parameter "--fix", which can fix hundreds of warnings quickly and automatically.so you can focus on the remaining issues manually. Note that if you are using Team Foundation Server's (TFS) native TFVC version control, you will need to check out your TypeScript files before running the "tslint --fix" command, as the tool expects to be able to write to the original files.
Hope this helps!