This project uses TS Lint to do Linting in combination with Codelyzer
- tslint.json has all the linting rules that are being followed for the project
- Make sure that you have installed the application level dependencies
cd TODOAngular2
npm i
Note that you need to have tslint plugin install on your editor.
Codelyzer should work out of the box with Atom but for VSCode you will have to open Code > Preferences > User Settings, and enter the following config:
{
"tslint.rulesDirectory": "./node_modules/codelyzer",
"typescript.tsdk": "node_modules/typescript/lib"
}
- Run the following command
npm run lint
These are the linting rules that are in place in this Angular project. For detailed tests and examples of most of these rules refer to this Github Repo
- class-name
- comment-format
- curly
- eofline
- forin
- indent
- label-position
- max-line-length
- member-access
- member-ordering
- no-arg
- no-bitwise
- no-console
- no-construct
- no-debugger
- no-duplicate-variable
- no-empty
- no-eval
- no-inferrable-types
- no-shadowed-variable
- no-string-literal
- no-switch-case-fall-through
- no-trailing-whitespace
- no-unused-expression
- no-unreachable
- no-use-before-declare
- no-var-keyword
- object-literal-sort-keys
- one-line
- quotemark
- radix
- semicolon
- triple-equals
- typedef-whitespace
- variable-name
- whitespace
For details about these rules see this Github Repo. These are based on the Angular Style Guide
- directive-selector
- component-selector
- use-input-property-decorator
- use-output-property-decorator
- use-host-property-decorator
- no-attribute-parameter-decorator
- no-input-rename
- no-output-rename
- no-forward-ref
- use-life-cycle-interface
- use-pipe-transform-interface
- pipe-naming
- component-class-suffix
- directive-class-suffix
- templates-use-public
- no-access-missing-member
- invoke-injectable