-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat: support flat config and eslint v9 #1073
Conversation
docs/.vitepress/config.mts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid vitepress (vite) trouble
https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only
@@ -1,6 +1,6 @@ | |||
import { defineLoader } from "vitepress"; | |||
import recommended from "../../src/configs/recommended"; | |||
import { rules } from "../.vitepress/rulesForSidebar"; | |||
import { rules as baseRules } from "../../src/configs/base.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vitepress support only esm, so require
is not available. I’ve changed rules are imported.
src/configs/flat/recommended.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've referenced eslint-plugin-vue for implementation.
vuejs/eslint-plugin-vue#2407
vuejs/eslint-plugin-vue#2436
@@ -6,6 +6,7 @@ | |||
"strict": true, | |||
"esModuleInterop": true, | |||
"resolveJsonModule": true, | |||
"declaration": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To support DX in flat config, types are now also generated.
I've just supported eslint v9 and eslint v8.x compatibility |
release on |
Thanks! |
background
The flat config will be supported officially in eslint v9 release, and the current config style will be removed in eslint v10.
We can already use flat config in recent versions of eslint v8.
https://eslint.org/docs/latest/use/configure/configuration-files-new
And some deprecated APIs was dropped :
https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/
about implementation
This PR supports the existing config style while also supporting flat config, and eslint v9 support
PS
I've just supported eslint v9 and eslint v8.x compatibility: 2024-04-11