@emerson-eps/eslint-config

中文文档
7.0.16发布于 2026/09/29MITCommonJS构建来源已验证近 30 天下载 7419

Shared ESLint config for Emerson E&P Software

原始使用文档
文档目录8 节
  1. Usage
  2. (1) Install the shared Prettier and ESLint configs
  3. (2) Configure Prettier
  4. (3) Configure ESLint
  5. List of current rules
  6. Running ESLint on your code
  7. Integration with Visual Studio Code
  8. Overriding the shared configs

Shared ESLint Config

GitHub Workflow Status GitHub license npm (scoped) semantic-release Conventional Commits

This is the home of the shared E&P Software ESLint configs. The default config should be used for all React Typescript projects in E&P Software.

Usage

The ESLint config and Prettier config must both be added to get the full shared configuration.

(1) Install the shared Prettier and ESLint configs

npm install --save-dev @emerson-eps/prettier-config @emerson-eps/eslint-config

If you have not already installed prettier and eslint install those as well:

npm install --save-dev prettier eslint

(2) Configure Prettier

Add @emerson-eps/prettier-config to your .prettierrc.js:

module.exports = {
  ...require("@emerson-eps/prettier-config"),
};

For more advanced setups, including how to override settings, see the instructions in the @emerson-eps/prettier-config repository.

(3) Configure ESLint

Specify the package in the extends section of your ESLint configuration:

{
  "extends": "@emerson-eps/eslint-config",
  "rules": {
    // Additional rules...
  }
}

List of current rules

The list of applied rules can be found here

Running ESLint on your code

Add a lint script to your package.json, for example:

{
  "scripts": {
    "lint": "eslint . --max-warnings=0"
  }
}

Code can then be linted with:

npm run lint

CI pipelines should be configured to fail on linting warnings.

Integration with Visual Studio Code

If not already installed, install the Prettier and ESLint extensions.

Overriding the shared configs

Try not to override the shared configs unless you really need to. If you must override them please consider proposing the override as a change to the relevant repository first to avoid divergence of code styles in different projects.

版本与发布记录

@emerson-eps/eslint-config 共发布 73 个版本,首次发布于 2021/04/19;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
7.0.16latest2026/09/291 个月前
7.0.152026/09/291 个月前
7.0.142026/03/267 个月前
7.0.132026/03/257 个月前
7.0.122025/12/0911 个月前
7.0.112025/12/0811 个月前

其他发布通道:beta → 7.1.0-beta.1。

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

@emerson-eps/eslint-config 是什么?

Shared ESLint config for Emerson E&P Software

如何安装 @emerson-eps/eslint-config?

在项目目录运行 npm install @emerson-eps/eslint-config,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:eslint(^8.57.1)、prettier(^3.6.2)、typescript(>= 5.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@emerson-eps/eslint-config 支持 TypeScript 吗?

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

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

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@emerson-eps/eslint-config 可以商用吗?

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

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

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

@emerson-eps/eslint-config 还在维护吗?

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