# @activescott/eslint-config 中文文档

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

版本：3\.1\.0
npm 元数据更新时间：2026-09-20T07:38:28.754Z
中文译文更新时间：2026-11-05T23:29:16.928Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：10.1 kB，5 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=20
- 运行依赖：0 个
- peer 依赖：eslint \>= 9，typescript-eslint ^8\.19\.1，eslint-plugin-jest ^28\.10\.0，eslint-plugin-unicorn ^56\.0\.1，eslint-plugin-prettier ^5\.2\.1，@stylistic/eslint-plugin ^2\.12\.1 \|\| ^5\.10\.0
- 首次发布：2019-09-28T06:40:20.667Z
- 最新版本发布：2026-09-20T07:38:28.614Z
- 近 30 天下载量：9603（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：29（近 12 个月 1 个）

## 中文简介

用于 TypeScript 的 ESLint 可变配置 .

## 安装

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

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

## README

# @ actionscott/eslint- config

[![npm version](https://badge.fury.io/js/%40activescott%2Feslint-config.svg)](https://www.npmjs.com/package/@activescott/eslint-config) [![Build Status](https://github.com/activescott/eslint-config/workflows/main/badge.svg)](https://github.com/activescott/eslint-config/actions)

这是 [@活泼斯科特的](https://github.com/activescott/) [粗略的配置](https://eslint.org/docs/developer-guide/shareable-configs) 为了ESLint. 为TypeScript优化了默认. 它确实也预设了其他文件,包括JavaScript,Markdown等.

如本文所述,今后可在此软件包中添加多个配置 [https://eslint.org/docs/developer-guide/shareable-configs# 共享-多功能-configs](https://eslint.org/docs/developer-guide/shareable-configs#sharing-multiple-configs)

## 使用量

**步骤1**: 在您的项目中添加以下依赖性:

```sh
npm add -D @activescott/eslint-config@3 typescript-eslint@8 eslint-plugin-prettier@5 eslint-plugin-jest@28 @stylistic/eslint-plugin@2 eslint-config-prettier@9 eslint-plugin-unicorn@56
```

**步骤2**: 输入以下来创建 `eslint.config.js`, (中文(简体) ), `.prettierrc`,以及 `.prettierignore` 在有正确内容的根中:

```sh
printf 'import config from "@activescott/eslint-config"

// Global ignores - must be in a separate config object with ONLY the ignores property
const globalIgnores = {
  ignores: [
    "**/node_modules/**",
    "**/dist/**",
    "**/.react-router/**",
    "**/test-data/**",
  ],
}

const overrides = {
  rules: {
  },
}
export default [globalIgnores, ...config, overrides]

' > eslint.config.js
printf "semi: false\n" > .prettierrc

printf '.prettierignore
node_modules/
/dist/
/.next/
.nyc_output/
coverage/
.react-router/
'
```

**步骤3** (可选) : 添加以下脚本到 `package.json`数字 :

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

见 [https://eslint.org/docs/用户指南/配置](https://eslint.org/docs/user-guide/configuring) 更多信息.

## 页:1

### 反应

使用 React 添加时 `plugin:react/recommended` 从软件包中 `eslint-plugin-react`数字 :

```
extends:
  - ...
  - "plugin:react/recommended"
```

## 本地测试

您也可以通过将您的模块连接到全球的方式在您的计算机上测试您的共享配置 。 类型 :

```
npm link
```

然后,在您想要使用您共享配置的项目中, 类型 :

```
npm link @activescott/eslint-config
```

## 释放程序(部署到国家预防机制)

我们用 [语义释放](https://github.com/semantic-release/semantic-release) 持续释放 [铸造](https://semver.org/)\- 兼容的版本。 这个项目部署在多个 [npm 分布标签](https://docs.npmjs.com/cli/dist-tag)。以下每个分支对应以下 npm 分布标记:

| 分支 | npm 分发标记 |
| --- | --- |
| 师傅 | 最新消息 |
| β 语录 | β 语录 |

启动释放时使用常规承诺 [Angular 提交信件常规](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) 上面的一个树枝.

## 说明自我

参考文献:

-   [https://eslint.org/docs/latest/use/confuct/confguratation-files 互联网档案馆的存檔,存档日期2014-12-02](https://eslint.org/docs/latest/use/configure/configuration-files)
-   [https://eslint.org/docs/latest/use/confect/parser#confect-a-custom-parser 互联网档案馆的存檔,存档日期2013-12-02](https://eslint.org/docs/latest/use/configure/parser#configure-a-custom-parser)
-   [https://typescript-eslint.io/被启动](https://typescript-eslint.io/getting-started)
-   [https://prettier.io/docs/en/ integration- with-linters.html 互联网档案馆的存檔,存档日期2014-12-22](https://prettier.io/docs/en/integrating-with-linters.html)
-   [https://github.com/prettier/eslint-plugin-prettier 页面存档备份,存于互联网档案馆](https://github.com/prettier/eslint-plugin-prettier)
-   [页:1](https://eslint.org/docs/latest/extend/shareable-configs)

### 待办

-   [https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unused-modules.md 互联网档案馆的存檔,存档日期2013-12-22](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unused-modules.md)

## 常见问题

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

用于 TypeScript 的 ESLint 可变配置 \.

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

在项目目录运行 npm install @activescott/eslint-config，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：eslint（\>= 9）、typescript-eslint（^8\.19\.1）、eslint-plugin-jest（^28\.10\.0）、eslint-plugin-unicorn（^56\.0\.1）、eslint-plugin-prettier（^5\.2\.1）、@stylistic/eslint-plugin（^2\.12\.1 \|\| ^5\.10\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

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

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

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

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

### @activescott/eslint-config 需要什么版本的 Node\.js？

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

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

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

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

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

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

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

