Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto fix TSLint warning in IntelliJ and WebStorm

Is there any way to fix the TSLint warning automatically in IntelliJ and WebStorm?

like image 327
Ashish Avatar asked Sep 08 '17 00:09

Ashish


People also ask

How do I get rid of TSLint errors?

If you want to disable, just open tslint. json file and replace all true parameter with false. It would not check for any errors after that! That would disable ts lint fully.

How do I enable TSLint in IntelliJ?

This behavior is default in all new IntelliJ IDEA projects. To enable it in a previously created project, go to Languages & Frameworks | TypeScript | TSLint in the Settings/Preferences dialog ( Ctrl+Alt+S ) and select the Automatic TSLint configuration option.

What is TSLint?

TSLint is an extensible static analysis tool that checks TypeScript code for readability, maintainability, and functionality errors. It is widely supported across modern editors & build systems and can be customized with your own lint rules, configurations, and formatters.


1 Answers

Yes: hit Alt-Enter on the highlighted problem and select either TSLint: fix current problem to fix only this particular issue or TSLint: fix current file to apply the fixes when possible to the whole file.

See https://blog.jetbrains.com/webstorm/2017/01/webstorm-2017-1-eap-171-2455/ for more info

like image 93
lena Avatar answered Oct 25 '22 01:10

lena