I am working with an Angular project and my ESLint setup does not detect when a private class variable is unused, e.g.
@Component{...}
export class ExampleComponent {
private exampleProperty: string
}
The private property above - exampleProperty will not be highlighted with the current ESLint setup that I have.
My .eslintrc.json:
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json", "e2e/tsconfig.json"],
"createDefaultProgram": true
},
"env": { "browser": true, "jest": true },
"extends": [
"eslint:recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@angular-eslint/component-selector": [
"error",
{ "prefix": "app", "style": "kebab-case", "type": "element" }
],
"@angular-eslint/no-host-metadata-property": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_" }
],
"no-case-declarations": "off",
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-prototype-builtins": "off",
"no-unused-vars": "off"
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {}
}
]
}
How can I get the linter to pick this up?