Fix lint errors in Angular cli

tslint error in angular

The mind, once stretched by a new idea, never regains its original dimensions.

Problem:- In Angular cli after executing the command ng lint shows a lot of lint errors based on the configuration `tslint.json`, how to fix lint errors ?

tslint error in angular

Solution:-

Run the below command

tslint --fix src/**/*.ts -t verbose

Note:

  • It will fix most of the issues and display the errors that need to be manually fixed.
  • Incase you are getting error that tslint command is not recognized, try installing tslint binary as below:-
sudo yarn global add tslint typescript
ufthelp

Leave a Reply

Your email address will not be published. Required fields are marked *