Rules for new angular versions.
You'll first need to install ESLint:
yarn add -D eslint
Next, install @gargoylesoft/eslint-plugin-angular
:
yarn add -D @gargoylesoft/eslint-plugin-angular
Add @gargoylesoft/angular
to the plugins section of your .eslintrc
configuration file. You can omit the
eslint-plugin-
prefix:
{
"plugins": [
"@gargoylesoft/angular"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"@gargoylesoft/angular/rule-name": 2
}
}
- no-common-module - Components should only include what they require.
- no-component-constructor - Components should use
inject
instead of a constructor. - provide-in-component - Ensure appropriate
providers
andviewProviders
are specified.