我在角14中使用"eslint": "^8.23.0"
当我使用"eslint": "^8.22.0"时,一切都很好,在更新到8.23.0之后,我得到了以下错误:


我的eslint配置:
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts",
"*.js",
"*.tsx"
],
"parserOptions": {
"project": [
"tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
],
"indent": [
"error",
2,
{
"SwitchCase": 1,
"ArrayExpression": "first"
}
],
"@angular-eslint/template/eqeqeq": "off",
"@typescript-eslint/naming-convention": "error",
"quotes": "error",
"semi": "error",
"no-multiple-empty-lines": "error",
"comma-dangle": "error"
}
},
{
"files": [
"*.html",
"*.css"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {
"@angular-eslint/template/eqeqeq": "off",
"@angular-eslint/template/accessibility-elements-content": "error",
"no-multiple-empty-lines": "error"
}
}
]
}如您所见,这是indent配置:
"indent": [
"error",
2,
{
"SwitchCase": 1
}
]我测试了以下配置
"indent": [
"error",
2,
{
"SwitchCase": 1,
"ArrayExpression": "first"
}
]我还将eslint配置更改为:
"indent": "off",
"@typescript-eslint/indent": [
"error",
2,
{
"SwitchCase": 1
}
],但什么都没变!
发布于 2022-08-31 16:38:16
在更新了下面的软件包后,问题就消失了!
@typescript-eslint/eslint-plugin 5.36.0 → 5.36.1
@typescript-eslint/parser 5.36.0 → 5.36.1https://stackoverflow.com/questions/73543511
复制相似问题