Angular tslint rules04:33

  • 0
Published on November 4, 2017

Text version of the video

Slides

Angular CLI Tutorial

Angular CLI Text articles & Slides

All Dot Net and SQL Server Tutorials in English

All Dot Net and SQL Server Tutorials in Arabic

In this video we will discuss some of the common angular linting rules in tslint.json file. You may modify these rules depending on your project requirements.

Here are some of the common linting rules
1. quotemark rule specifies whether you want single or double quotes
2. no-trailing-whitespace rule disallows trailing whitespace at the end of a line
3. semicolon rule specifies that a line should be terminated with a semicolon
4. comment-format rule specifies that all single-line comments must begin with a space
5. component-class-suffix rule enforces that a component class should end with the suffix Component
6. use-life-cycle-interface rule enforces that you add the implements keyword for every lifecycle hook you use

Some of the linting errors support automatic fix. To have these linting errors fixed automatically, run ng lint command with the –fix option.
ng lint –fix

To see the options that can be used with ng lint command, use
ng lint –help

At the moment, Visual Studio Code is not able to show any linting rule violations. In our next video, we will discuss how to display linting errors in Visual Studio Code so we can fix them as we are writing code.

Enjoyed this video?
"No Thanks. Please Close This Box!"