ESLint: 错误: 无法加载配置 “plugin:@angular-eslint/ng-cli-compat” 以扩展自

huangapple go评论1,676阅读模式
英文:

ESLint: Error: Failed to load config "plugin:@angular-eslint/ng-cli-compat" to extend from

问题

我尝试将Angular项目从版本15更新到16,现在出现了许多我无法理解的错误。 IntelliJ在顶部显示以下错误:

ESLint: 错误: 无法加载配置 “plugin:@angular-eslint/ng-cli-compat” 以扩展自

我不知道它是否相关,但运行ng serve也失败了,出现了许多模块错误,我无法真正看出问题在哪。主要是这样说的:

NG6002:此导入包含错误,可能会影响依赖于此NgModule的组件。

ESLint: 错误: 无法加载配置 “plugin:@angular-eslint/ng-cli-compat” 以扩展自

是否有人有建议如何修复这个问题?

英文:

I have tried updating an Angular project from version 15 to 16, now I get several errors that I can't make sense of. IntelliJ shows the following error at the top:

ESLint: 错误: 无法加载配置 “plugin:@angular-eslint/ng-cli-compat” 以扩展自

I don't know if it's related, but running ng serve also fails with many module errors where I can't really see what's wrong. Mostly it says

NG6002: This import contains errors, which may affect components that depend on this NgModule.

ESLint: 错误: 无法加载配置 “plugin:@angular-eslint/ng-cli-compat” 以扩展自

does anyone have a suggestion how to fix that?

答案1

得分: 7

I just removed the references to the below plugins in .eslint.json under extends section:

"plugin:@angular-eslint/ng-cli-compat",
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",

and added the below:

"plugin:@angular-eslint/recommended"

The extends now looks as below:

"extends": [
   "plugin:@angular-eslint/recommended",
   "plugin:@angular-eslint/template/process-inline-templates"
],
英文:

I just removed the references to the below plugins in .eslint.json under extends section

"plugin:@angular-eslint/ng-cli-compat",
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",

and added the below

"plugin:@angular-eslint/recommended"

The extends now looks as below

"extends": [
   "plugin:@angular-eslint/recommended",
   "plugin:@angular-eslint/template/process-inline-templates"
],

答案2

得分: 4

ng-cli-compat 已移除,您需要按照这里的说明进行操作:https://github.com/angular-eslint/angular-eslint/issues/1353#issuecomment-1529924573

英文:

ng-cli-compat was removed you have to follow instructions here: https://github.com/angular-eslint/angular-eslint/issues/1353#issuecomment-1529924573

huangapple
  • 本文由 发表于 2023年6月27日 21:13:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/76565260.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定