@digabi/eslint-config

中文文档
4.0.1发布于 2026/04/02EUPL-1.2ES Module构建来源已验证近 30 天下载 8087

Shared ESLint config for the digabi project. Requires ESLint 9+ and uses the flat config format.

原始使用文档

eslint-config

Shared ESLint config for the digabi project. Requires ESLint 9+ and uses the flat config format.

How to add to a new project?

Add the required dependencies:

$ npm install --save-dev @digabi/eslint-config eslint eslint-plugin-import-x eslint-plugin-prettier eslint-plugin-promise globals typescript-eslint

If you're using React, add

$ npm install --save-dev eslint-plugin-react eslint-plugin-react-hooks

If you're using Mocha, add

$ npm install --save-dev eslint-plugin-mocha mocha

If you're using Jest, add

$ npm install --save-dev eslint-plugin-jest jest

Create an eslint.config.mjs in the project root:

import digabiConfig from '@digabi/eslint-config'

export default [
  ...digabiConfig(),
]

The config auto-detects installed optional plugins (React, Mocha, Jest) and enables their rules automatically.

版本与发布记录

@digabi/eslint-config 共发布 43 个版本,首次发布于 2020/02/26;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
4.0.1latest2026/04/027 个月前
4.0.02026/04/027 个月前
3.4.02025/08/131.2 年前
3.3.02024/10/222 年前
3.2.02024/09/092 年前
3.1.02024/09/092 年前

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

@digabi/eslint-config 是什么?

Shared ESLint config for the digabi project. Requires ESLint 9+ and uses the flat config format.

如何安装 @digabi/eslint-config?

在项目目录运行 npm install @digabi/eslint-config,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:eslint(>= 9)、@eslint/js(>= 9)、typescript-eslint(>= 8)、eslint-plugin-promise(>= 7)、eslint-plugin-import-x(>= 4)、eslint-plugin-prettier(>= 5)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@digabi/eslint-config 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/digabi__eslint-config 是否存在。

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

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

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

@digabi/eslint-config 使用 EUPL-1.2 许可。声明的许可为 EUPL-1.2,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

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

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

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

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