Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tslint.config formatting/beautification in VS code

Tags:

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

like image 252
MAHESH VALIYA VEETIL Avatar asked Apr 18 '18 08:04

MAHESH VALIYA VEETIL


People also ask

How do I beautify my code in VS Code?

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.

How do I change the format to prettier in VS Code?

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.


1 Answers

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.

like image 149
WayneC Avatar answered Sep 28 '22 18:09

WayneC