从 angular 15 升级至 angular 17 之后,运行 npm run lint
出现下面的错误:
[error] Error: Invalid Options:
- Unknown options: reportUnusedDisableDirectives, rulePaths, resolvePluginsRelativeTo, ignorePath, useEslintrc
- 'resolvePluginsRelativeTo' has been removed.
- 'ignorePath' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.
- 'reportUnusedDisableDirectives' has been removed. Please use the 'overrideConfig.linterOptions.reportUnusedDisableDirectives' option instead.
at processOptions (
node_modules\eslint\lib\eslint\eslint-helpers.js:805:15)
at new ESLint (node_modules\eslint\lib\eslint\eslint.js:592:34)
at resolveAndInstantiateESLint (node_modules\@angular-eslint\builder\dist\utils\eslint-utils.js:65:20)
at async node_modules\@angular-eslint\builder\dist\lint.impl.js:35:32
请问如何解决?
是因为 angular 17.3.0 与 eslint 9.0 不兼容,将 eslint 的版本降级到 8.57 解决了
github 上的相关 issue https://github.com/angular-eslint/angular-eslint/issues/1755