eslint-plugin-angular-template-no-deprecated
v20.1.0
Published
An ESLint plugin that highlights usages of deprecated Components or Component properties inside Angular Templates. Similar to [`@typescript-eslint/no-deprecated`](https://typescript-eslint.io/rules/no-deprecated) but for Angular templates!
Maintainers
Readme
eslint-plugin-angular-template-no-deprecated
An ESLint plugin that highlights usages of deprecated Components or Component properties inside Angular Templates. Similar to @typescript-eslint/no-deprecated but for Angular templates!
Requires angular-eslint.
[!NOTE] This plugin does no dependency injection resolution. It simply scans the whole TypeScript project in search of component definitions that have the
@deprecatedJSDoc.Because of this, you may see false-positives or false-negatives for cases when a component is not actually importer, or is imported with a different prefix selector.
Configuration
Flat Config (ESLint 9+) – Manual
File: eslint.config.js
import angularTemplateParser from '@angular-eslint/template-parser';
import angularTemplateNoDeprecated from 'eslint-plugin-angular-template-no-deprecated';
import { defineConfig } from 'eslint/config';
export default [
// ...
{
files: ['**/*.html'],
languageOptions: {
parser: angularTemplateParser
},
plugins: {
'angular-template-no-deprecated': angularTemplateNoDeprecated
},
rules: {
'angular-template-no-deprecated/no-deprecated': 'warn',
}
}
];Flat Config (ESLint 9+) – Using recommended
File: eslint.config.js
import angularTemplateParser from '@angular-eslint/template-parser';
import angularTemplateNoDeprecated from 'eslint-plugin-angular-template-no-deprecated';
import { defineConfig } from 'eslint/config';
export default [
// ...
angularTemplateNoDeprecated.configs.recommended
]Legacy Config (ESLint 8 and below)
File: .eslintrc
{
"plugins": ["angular-template-no-deprecated"],
"rules": {
"angular-template-no-deprecated/no-deprecated": "warn"
}
}Versioning
| Plugin version | Angular version | Angular ESLint version | | :------------: | :-------------: | :--------------------: | | ^20.0.0 | ^20.3.15 | ^20.7.0 |
Roadmap
- [x] Detect deprecated Components
- [x] Detect deprecated Component properties
- [x] Detect deprecated Directives
- [x] Detect deprecated Directive properties
- [x] Detect deprecates Pipes
- [ ] Detect deprecated Pipe properties
- [ ] Some sort of dependency injection resolution to avoid false-positives/false-negatives
