Vil*_*nas 6 typescript eslint angular typescript-eslint
我正在使用 Angular 项目,并且我的 ESLint 设置无法检测何时未使用私有类变量,例如
@Component{...}
export class ExampleComponent {
private exampleProperty: string
}
Run Code Online (Sandbox Code Playgroud)
上面的私有属性 -exampleProperty在我当前的 ESLint 设置中不会突出显示。
我的.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": {}
}
]
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能让 linter 找到这个?
| 归档时间: |
|
| 查看次数: |
2492 次 |
| 最近记录: |