eslint-plugin-ng-extra
ESLint plugin for Angular applications.
Propose or contribute a new rule
Install
Make sure you have TypeScript and @typescript-eslint/parser
installed:
$ npm install --save-dev typescript @typescript-eslint/parser
Then install the plugin
$ npm install --save-dev eslint eslint-plugin-ng-extra
Usage
Add @typescript-eslint/parser
to the parser field and ng-extra
to the plugins section of your .eslintrc configuration file, then configure the rules you want to use under the rules section.
{
"parser": "@typescript-eslint/parser",
"plugins": ["ng-extra"],
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:ng-extra"
]
}
Rules
|
|
Best practices
Rule | Description | Status |
---|---|---|
check-http-errors |
Checks that when using the HTTP client, error are caught | |
no-dangling-subscription |
Checks that there are no dangling subscriptions in a component | |
no-nested-subscriptions |
Checks that there are no nested subscriptions in a component | |
no-subject-exposition |
Checks that no subjects are publicly exposed |