Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] 支持 eslint 9.0.0 #12261

Open
leshalv opened this issue Apr 6, 2024 · 1 comment
Open

[Feature Request] 支持 eslint 9.0.0 #12261

leshalv opened this issue Apr 6, 2024 · 1 comment

Comments

@leshalv
Copy link

leshalv commented Apr 6, 2024

支持 eslint 9.0.0

使用 eslint 9.0.0 版本报错

Error: Invalid Options:
- Unknown options: resolvePluginsRelativeTo, rulePaths, useEslintrc, extensions, ignorePath
- 'extensions' has been removed.
- 'resolvePluginsRelativeTo' has been removed.
- 'ignorePath' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.

Error: Invalid Options:
- Unknown options: resolvePluginsRelativeTo, rulePaths, useEslintrc, extensions, ignorePath
- 'extensions' has been removed.
- 'resolvePluginsRelativeTo' has been removed.
- 'ignorePath' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.
@fz6m
Copy link
Member

fz6m commented Apr 7, 2024

v9 和 v8 变化比较大。

目测要等底层的插件如 @typescript-eslint/eslint-plugin 等都发了新 major 版本支持 v9 之后(或者人工看下源码做一个直接导入的拼凑,如果 rule function 涉及用到了 v9 breaking 的 api ,可能需要 fork 了改一下)

→ 再在 umi 里做一个 v9 专用的出口,因为 flat config 和 legacy config 结构不一样

→ 再改下 umi 初始化模板升级为 v9 (指用 eslint.config.js

→ 再补充下文档

→ 再把 umi lint 这个命令行功能也兼容下,根据 v8 或 v9 分流

主要要花费时间的是把目前的 legacy config 改造成 flat config 的形式,如果有兴趣,欢迎先自行研究 v9 的升级方法之后 PR 。

注:关于上文提到的依赖的其他 eslint 插件不兼容 v9 的格式,可以人工去读一下它们的源码,根据 flat config 的结构,人为的导入这些包的内容片段,去拼凑出来一个 flat config 的样子,关于此处更多信息,请自行研究。

@fz6m fz6m added the PR Welcome label Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants