@frabbit/eslint-config

中文文档
9.0.0发布于 2026/10/23MITTypeScriptES Module近 30 天下载 2443

@ frabbit 的 ESLint 配置 .

中文使用文档
文档目录6 节
  1. 特征
  2. 安装
  3. 使用量
  4. 预设
  5. 与 @antfu/eslint-config
  6. 类型脚本兼容性

@ frabbit/ slint- config npm

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尚未在上游支持.

版本与发布记录

@frabbit/eslint-config 共发布 26 个版本,首次发布于 2023/09/25;过去 12 个月发布了 9 个版本。

版本发布日期距今
9.0.0latest2026/10/2323 天前
8.0.12026/04/117 个月前
7.9.02026/04/117 个月前
7.8.22026/02/129 个月前
7.8.02026/02/129 个月前
7.6.02026/01/319 个月前

关于 @frabbit/eslint-config 的常见问题

@frabbit/eslint-config 是什么?

@ frabbit 的 ESLint 配置 .

如何安装 @frabbit/eslint-config?

在项目目录运行 npm install @frabbit/eslint-config,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:eslint(^10.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@frabbit/eslint-config 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@frabbit/eslint-config 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@frabbit/eslint-config 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js ^22.18.0 || ^24.11.0 || >=26.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@frabbit/eslint-config 可以商用吗?

@frabbit/eslint-config 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@frabbit/eslint-config 的下载量有多少?

根据 npm 官方下载统计,@frabbit/eslint-config 在 2026/10/16 – 2026/11/14 这 30 天内被下载 2,443 次,日均约 81 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@frabbit/eslint-config 还在维护吗?

最新版本 9.0.0 发布于 2026/10/23(23 天前);至今共发布 26 个版本,其中过去 12 个月发布了 9 个;首次发布于 2023/09/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。