@ frabbit/ slint- config 
JavaScript, TypeScript, Vue 2, Vue 3, Prettier 的平面ESLint配置. 基于 https://github.com/sxzz/eslint-config 页面存档备份,存于互联网档案馆
用于 JavaScript, TypeScript, Vue 的有观点的 ESLint 配置预设, 还有Pretier.
特征
- 格式为 Pretier .
- 设计与TypeScript,Vue出道.
- 支持JSON(5),YAML,Markdown...
- 分类进口,
package.json, (中文(简体) ),tsconfig.json. - ESLint 平面配置轻而易举地写作!
- 忽略常见文件, 如
dist, (中文(简体) ),node_modules, (中文(简体) ),coverage,则文件在.gitignore。 。 。 . - 合理缺省,最佳做法,只有一行配置
- 合理的严格,但有更好的代码质量.
安装
npm i -D @frabbit/eslint-config
要求节点.js >= 20.0.0,和ESLint 9.5.0.
使用量
import { frabbit } from '@frabbit/eslint-config'
export default frabbit(
// Features: it'll detect installed dependency and enable necessary features automatically
{
prettier: true,
markdown: true,
vue: true, // auto detection
unocss: false, // auto detection
},
[
/* your custom config */
]
).removeRules('foo/bar') // see more in https://github.com/antfu/eslint-flat-config-utils
预设
// eslint.config.js
import {
presetJavaScript, // Ignore common files and include javascript support
presetJsonc, // Includes basic json(c) file support and sorting json keys
presetLangsExtensions, // Includes markdown, yaml + `presetJsonc` support
presetBasic, // Includes `presetJavaScript` and typescript support
// Includes
// - `presetBasic` (JS+TS) support
// - `presetLangsExtensions` (markdown, yaml, jsonc) support
// - Vue support
// - UnoCSS support (`uno.config.ts` is required)
// - Prettier support
presetAll,
} from '@frabbit/eslint-config'
export default presetAll
见 预设.ts 更多细节.
与 @antfu/eslint-config
多数规则相同,但有一些不同之处:
- 使用 高级 改为 ESLint 结构化。 。 。 .
- 反应和斯维尔特不支持.
- 也许更严格和简单.
类型脚本兼容性
要求ESLint 10和Node.js ^22.18.0,^24.11.0,或 ±26.0.0. 目前的打字-slint 8.72支持TypeScript QQ4.8.4 < 6.1.0. 使用TypeScript 6.0.x来进行林入;TypeScript 7尚未在上游支持.