How to get tslint.config based formatting in VSCode. I tried some extensions and it warns me about code quality, but not format/beautify my code on save
The code formatting is available in Visual Studio Code through the following shortcuts: On Windows Shift + Alt + F. On Mac Shift + Option + F. On Linux Ctrl + Shift + I.
For those on Windows, click “Control + Shift + P.” Search “Format” in the search bar, then pick “Format Document.” Select your preferred format from the available options and click on “Configure.” Click on “Prettier – Code Formatter” to format the code.
There is a config option for vscode-tslint tslint.autoFixOnSave
, which will run the fixes for any rules that have fixes.
As suggested above prettier would be a better solution for formatting your code. You'll want to use tslint-config-prettier, to avoid conflicts between them. Allowing prettier to do formatting, and tslint to do any other fixes.
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