gpt4 book ai didi

Angular 9 + eslint : error Definition for rule '@angular-eslint/...' was not found

转载 作者:行者123 更新时间:2023-12-04 12:11:34 27 4
gpt4 key购买 nike

最近,为了我的 Angular 9 项目,我从 tslint 迁移到 eslint。目前,这些是我的 package.json 中的版本:

"@typescript-eslint/eslint-plugin": "^3.1.0",
"@typescript-eslint/eslint-plugin-tslint": "^3.1.0",
"@typescript-eslint/parser": "^3.1.0",
"eslint": "^7.2.0"

运行 eslint 后,我​​收到了大量错误(准确地说是 1000+),其中大部分是:
   1:1  error  Definition for rule '@angular-eslint/component-class-suffix' was not found        @angular-eslint/component-class-suffix
1:1 error Definition for rule '@angular-eslint/component-selector' was not found @angular-eslint/component-selector
1:1 error Definition for rule '@angular-eslint/directive-class-suffix' was not found @angular-eslint/directive-class-suffix
1:1 error Definition for rule '@angular-eslint/directive-selector' was not found @angular-eslint/directive-selector

或者:
   1:1  error  Definition for rule '@typescript-eslint/class-name-casing' was not found          @typescript-eslint/class-name-casing
1:1 error Definition for rule '@typescript-eslint/tslint/config' was not found @typescript-eslint/tslint/config

我尝试研究解决此问题的方法,但到目前为止没有运气,而且我似乎无法找到应该在哪里定义这些缺失的规则?

最佳答案

将“@angular-eslint”添加到 eslintrc.js/.eslintrc 文件中的“插件”

{
"plugins": [
.....
"@angular-eslint"
]
}

关于 Angular 9 + eslint : error Definition for rule '@angular-eslint/...' was not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62249777/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com