# @bluzzi/eslint-config 中文文档

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

版本：2\.4\.2
npm 元数据更新时间：2026-11-03T13:34:33.577Z
中文译文更新时间：2026-11-08T09:10:45.911Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：2.1 MB，48 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：15 个
- peer 依赖：eslint \>=9\.0\.0
- 首次发布：2022-11-18T06:26:01.263Z
- 最新版本发布：2026-11-03T13:34:33.313Z
- 近 30 天下载量：3449（2026-10-09 至 2026-11-07，npm 官方下载统计）
- 已发布版本数：57（近 12 个月 9 个）

## 中文简介

ESLint 配置预设用于您所有文件的内嵌和格式化

## 安装

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

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

## README

# @bluzzi/eslint-配置

即时使用 ESLint 配置预设,高度有见地,严格的最佳做法,使您既能插入,又能 [格式](https://eslint.style/guide/why) 您的 JavaScript 和 TypeScript 文件.

-   QQ 格式化( Pretier 选项), 仅包含基本配置( 半、 引号、 缩进)
-   JS和TS非常严格的规则,鼓励最佳做法
-   与TS、JSX和React合作
-   qq 自动启用基于您的依赖关系的特定规则
-   QQ使用推荐的共享配置( ESLint, TSLint, Stylistic...)

如果你是想找一个 更贴切的配置 我建议你 [Antfu 预设](https://github.com/antfu/eslint-config)。 。 。 .

## 安装

在您的工程中安装配置预设 .

### 软件包

```
npm install -D eslint @bluzzi/eslint-config
```

```
yarn add --dev eslint @bluzzi/eslint-config
```

```
pnpm install -D eslint @bluzzi/eslint-config
```

### 配置文件

创建 `eslint.config.mjs` 并添加最小配置 :

```js
import { eslintConfig } from "@bluzzi/eslint-config";

export default eslintConfig();
```

### 脚本

在您的 package.json 文件中,您可以选择添加以下脚本来方便地运行项目中的 ESLint :

```json
{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}
```

## VS 代码支持

VS代码插件的安装和配置,在保存文件时利用自动更正,以及显示出问题.

安装 [VS 代码 ESLint 扩展](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) 中添加以下设置: `.vscode/settings.json`数字 :

```jsonc
{
  // Disable the default formatter, use eslint instead:
  "prettier.enable": false,
  "editor.formatOnSave": false,

  // Auto fix:
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
    "source.organizeImports": "never"
  },

  // Silent the stylistic rules in you IDE, but still auto fix them:
  "eslint.rules.customizations": [
    { "rule": "style/*", "severity": "off", "fixable": true },
    { "rule": "format/*", "severity": "off", "fixable": true },
    { "rule": "*-indent", "severity": "off", "fixable": true },
    { "rule": "*-spacing", "severity": "off", "fixable": true },
    { "rule": "*-spaces", "severity": "off", "fixable": true },
    { "rule": "*-order", "severity": "off", "fixable": true },
    { "rule": "*-dangle", "severity": "off", "fixable": true },
    { "rule": "*-newline", "severity": "off", "fixable": true },
    { "rule": "*quotes", "severity": "off", "fixable": true },
    { "rule": "*semi", "severity": "off", "fixable": true }
  ],

  // Enable eslint for all supported languages:
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact"
  ]
}
```

## 自定义

你可以调整一些代码的格式选项,但我们建议坚持 [结构化](https://eslint.style/guide/config-presets)JS社区内部一致性的默认规则:

```js
export default eslintConfig({
  stylistic: {
    indent: 2,
    quotes: "single",
    semi: false,
  },
});
```

你可以充分利用 [ESLint 的平面配置](https://eslint.org/docs/latest/use/configure/configuration-files) 任意扩展配置 :

```js
export default eslintConfig(
  {
    // The configuration options offered by our package
  },

  // From the second arguments they are ESLint Flat Configs
  // you can have multiple configs:
  {
    files: ["**/*.ts"],
    rules: {},
  },
  {
    rules: {},
  },
);
```

## 谢谢

-   [傅安东尼](https://github.com/antfu)为了他的 [配置预设](https://github.com/antfu/eslint-config) 委员会的工作 [结构化](https://eslint.style/)
-   [ESLint团队](https://eslint.org/team/),为此 [惊人的项目](https://eslint.org/) 推动整个JS生态系统向前发展

## 许可证

这个包裹是麻省理工学院许可的.

## 常见问题

### @bluzzi/eslint-config 是什么？

ESLint 配置预设用于您所有文件的内嵌和格式化

### 如何安装 @bluzzi/eslint-config？

在项目目录运行 npm install @bluzzi/eslint-config，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：eslint（\>=9\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @bluzzi/eslint-config 支持 TypeScript 吗？

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

### @bluzzi/eslint-config 支持 ESM 还是 CommonJS？

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

### @bluzzi/eslint-config 可以商用吗？

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

### @bluzzi/eslint-config 的下载量有多少？

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

### @bluzzi/eslint-config 还在维护吗？

最新版本 2\.4\.2 发布于 2026/11/03（4 天前）；至今共发布 57 个版本，其中过去 12 个月发布了 9 个；首次发布于 2022/11/18。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

