Reputation: 31
I want to understand the practical implication of tslint and codelyser in Angular 4. How would these are used in the real scenario and how would i customise the rules defined in tslint.
Upvotes: 2
Views: 569
Reputation: 8276
TSLint is an extensible static analysis tool that checks TypeScript code for readability, maintainability, and functionality errors.
Basically it will help you write clean and cool code. See setup and CLI usage here.
As a simple example, when you are using Angular CLI to generate an application, you will have tsconfig.json
for setting up how are you using Typescript, and you are getting a tslint.json
file where you can set rules usage and definitions. You can read about that file here.
And about the core rules here.
You can run the analysis bu typing lint
or ng lint
in your project's folder in command line.
(This is configured in the generated package.json
file by Angular CLI, or you can copy that setting over in your project if not created with Angular CLI)
Upvotes: 1