首页 新闻 会员 周边 捐助

npm run lint 报错 "Invalid Options"

0
悬赏园豆:30 [已解决问题] 解决于 2024-04-13 22:27

从 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

请问如何解决?

dudu的主页 dudu | 高人七级 | 园豆:30778
提问于:2024-04-13 22:13
< >
分享
最佳答案
0

是因为 angular 17.3.0 与 eslint 9.0 不兼容,将 eslint 的版本降级到 8.57 解决了

github 上的相关 issue https://github.com/angular-eslint/angular-eslint/issues/1755

dudu | 高人七级 |园豆:30778 | 2024-04-13 22:27
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册