# @frabbit/eslint-config 中文文档

规范地址：https://npmcn.com/package/%40frabbit/eslint-config/

版本：9\.0\.0
npm 元数据更新时间：2026-10-23T05:43:56.471Z
中文译文更新时间：2026-11-15T11:23:42.145Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40frabbit/eslint-config
原文对照：https://npmcn.com/package/%40frabbit/eslint-config/?lang=original
项目主页：https://github.com/frabbit/eslint-config#readme
源码仓库：https://github.com/frenchrabbit/eslint-config

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：838 kB，5 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：^22\.18\.0 \|\| ^24\.11\.0 \|\| \>=26\.0\.0
- 运行依赖：30 个
- peer 依赖：eslint ^10\.0\.0，@unocss/eslint-plugin \>=65\.0\.0
- 首次发布：2023-09-25T13:16:54.071Z
- 最新版本发布：2026-10-23T05:43:56.217Z
- 近 30 天下载量：2443（2026-10-16 至 2026-11-14，npm 官方下载统计）
- 已发布版本数：26（近 12 个月 9 个）

## 中文简介

@ frabbit 的 ESLint 配置 .

## 安装

```sh
npm install @frabbit/eslint-config
```

也可以使用：`pnpm add @frabbit/eslint-config`、`yarn add @frabbit/eslint-config`、`bun add @frabbit/eslint-config`

## README

# @ frabbit/ slint- config [![npm](https://img.shields.io/npm/v/@frabbit/eslint-config.svg)](https://npmjs.com/package/@frabbit/eslint-config)

JavaScript, TypeScript, Vue 2, Vue 3, Prettier 的平面ESLint配置. 基于 [https://github.com/sxzz/eslint-config 页面存档备份,存于互联网档案馆](https://github.com/sxzz/eslint-config)

用于 JavaScript, TypeScript, Vue 的有观点的 ESLint 配置预设, 还有Pretier.

## 特征

-   格式为 Pretier .
-   设计与TypeScript,Vue出道.
-   支持JSON(5),YAML,Markdown...
-   分类进口, `package.json`, (中文(简体) ), `tsconfig.json`.
-   [ESLint 平面配置](https://eslint.org/docs/latest/use/configure/configuration-files-new)轻而易举地写作!
-   忽略常见文件, 如 `dist`, (中文(简体) ), `node_modules`, (中文(简体) ), `coverage`,则文件在 `.gitignore`。 。 。 .
-   合理缺省,最佳做法,只有一行配置
-   合理的严格,但有更好的代码质量.

## 安装

```bash
npm i -D @frabbit/eslint-config
```

要求节点.js >= 20.0.0,和ESLint 9.5.0.

## 使用量

```js
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
```

### 预设

```js
// 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](https://npmcn.com/package/%40frabbit/eslint-config/src/presets.ts) 更多细节.

## 与 [`@antfu/eslint-config`](https://github.com/antfu/eslint-config)

多数规则相同,但有一些不同之处:

-   使用 [高级](https://prettier.io/) 改为 [ESLint 结构化](https://github.com/eslint-stylistic/eslint-stylistic)。 。 。 .
-   反应和斯维尔特不支持.
-   也许更严格和简单.

## 类型脚本兼容性

要求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 是什么？

@ 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 和提交记录判断。

