🚀
ESLint v9 Flat Config
使用现代化的 flat config 格式,完整支持 TypeScript
# 使用 pnpm
pnpm dlx @eslint-sets/eslint-config
# 使用 npm
npx @eslint-sets/eslint-config
# 使用 bun
bunx @eslint-sets/eslint-config# 安装
pnpm install -D @eslint-sets/eslint-config eslint
# 创建配置文件// eslint.config.ts
import eslintConfig from '@eslint-sets/eslint-config'
export default eslintConfig()| 框架 | 自动检测 | 说明 |
|---|---|---|
| TypeScript | ✅ | 默认启用 |
| Vue | ✅ | 支持 Vue 2 和 3,可选 a11y |
| React | ✅ | 支持 hooks、refresh 和 Compiler |
| Svelte | ✅ | 支持 Svelte 5 runes |
| Solid | ✅ | SolidJS 支持 |
| Next.js | ✅ | 需要 @next/eslint-plugin-next |
| Nuxt | ✅ | Nuxt 3 支持 |
| Astro | ✅ | 需要 eslint-plugin-astro |
| Angular | ✅ | 需要 @angular-eslint/eslint-plugin |
| UnoCSS | ✅ | 需要 @unocss/eslint-plugin |
^18.18.0 或 ^20.9.0 或 >=21.1.0^9.10.0 或 ^9.22.0eslint.config.ts 或 eslint.config.mjs)