@activescott/eslint-config

中文文档
3.1.0发布于 2026/09/20MITTypeScriptES Module零依赖近 30 天下载 9603

An ESLint sharable config for TypeScript.

原始使用文档
文档目录7 节
  1. Usage
  2. Notes
  3. React
  4. Local Testing
  5. Release Process (Deploying to NPM) 🚀
  6. Notes to self
  7. Todo

@activescott/eslint-config

npm version Build Status

This is @activescott's sharable config for ESLint. The default is optimized for TypeScript. It does prettify other files too including JavaScript, Markdown, etc.

Multiple config may be added to this package in the future as described at https://eslint.org/docs/developer-guide/shareable-configs#sharing-multiple-configs

Usage

Step 1: Add the following dependencies to your project:

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

Step 2: Enter the following to create a eslint.config.js, .prettierrc, and .prettierignore in the root with the right content:

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/
'

Step 3 (optional): Add the following scripts to package.json:

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

See https://eslint.org/docs/user-guide/configuring for more information.

Notes

React

When using React add plugin:react/recommended from package eslint-plugin-react:

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

Local Testing

You can also test your shareable config on your computer before publishing by linking your module globally. Type:

npm link

Then, in your project that wants to use your shareable config, type:

npm link @activescott/eslint-config

Release Process (Deploying to NPM) 🚀

We use semantic-release to consistently release semver-compatible versions. This project deploys to multiple npm distribution tags. Each of the below branches correspond to the following npm distribution tags:

branchnpm distribution tag
masterlatest
betabeta

To trigger a release use a Conventional Commit following Angular Commit Message Conventions on one of the above branches.

Notes to self

References:

Todo

版本与发布记录

@activescott/eslint-config 共发布 29 个版本,首次发布于 2019/09/28;过去 12 个月发布了 1 个版本。

版本发布日期距今
3.1.0latest2026/09/201 个月前
3.0.12025/10/231 年前
3.0.02025/05/281.4 年前
3.0.0-beta.5beta2025/05/281.4 年前
3.0.0-beta.42025/05/281.4 年前
3.0.0-beta.32025/01/101.8 年前

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

@activescott/eslint-config 是什么?

An ESLint sharable config for TypeScript.

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