A couple of quality-of-life eslint rules for Angular components.
THIS PROJECT IS UNDER ACTIVE DEVELOPMENT. IT MAY NOT WORK AS INTENDED
Install:
yarn add --dev @monade/eslint-plugin-angular
Add to your .eslint.js:
plugins: [
...,
"@monade/angular"
]
...
rules: {
...,
"@monade/angular/remove-empty-styles": 2,
"@monade/angular/strategy-onpush": 2,
}
... TODO ...
- Document rules
- [Rule] When strategy is OnPush, show an error if there's a non-scalar property that is not ReadOnly<>
- [Rule] Component too long
- [Rule] Suggest strategy OnPush when the component is in the "components" folder
- [Rule] ADVANCED: Check if there's a reactivity bug with changeDetection: OnPush
You can use an AST view tool to debug the structure of some code parts:
- For Javascript: https://astexplorer.net/
- For Typescript: https://ts-ast-viewer.com/
@monade/eslint-plugin-angular is maintained by mònade srl.
We <3 open source software. Contact us for your next project!