# @emerson-eps/eslint-config 中文文档

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

版本：7\.0\.16
npm 元数据更新时间：2026-09-29T08:39:40.272Z
中文译文更新时间：2026-11-13T15:13:56.551Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：13.6 kB，5 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- 运行依赖：11 个
- peer 依赖：eslint ^8\.57\.1，prettier ^3\.6\.2，typescript \>= 5\.0
- 首次发布：2021-04-19T15:27:04.732Z
- 最新版本发布：2026-09-29T08:39:39.703Z
- 近 30 天下载量：7419（2026-10-14 至 2026-11-12，npm 官方下载统计）
- 已发布版本数：73（近 12 个月 7 个）

## 中文简介

Emerson E&P 软件共享的 ESLint 配置

## 安装

```sh
npm install @emerson-eps/eslint-config
```

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

## README

# 共享的 ESLint 配置

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/emerson-eps/eslint-config/Node.js%20CI)](https://github.com/emerson-eps/eslint-config/actions) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/emerson-eps/eslint-config/blob/main/LICENSE) [![npm (scoped)](https://img.shields.io/npm/v/@emerson-eps/eslint-config)](https://www.npmjs.com/package/@emerson-eps/eslint-config) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org/)

这是共享E&P软件ESLint配置的家. E&P Software中的所有React Typescript项目都应使用默认配置.

## 使用量

ESLint配置和Pretier配置必须同时被添加,以获得完整的共享配置.

### (1) 安装共享的Pretier和ESLint配置

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

如果您尚未安装 `prettier` 财务报告和审定财务报表 `eslint` 安装这些设备:

```bash
npm install --save-dev prettier eslint
```

### (2) 配置 Pretier( Pretier)

添加 `@emerson-eps/prettier-config` 给您的 `.prettierrc.js`数字 :

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

更高级的设置,包括如何覆盖设置,请参见 [@emerson-eps/ prettier-config](https://github.com/emerson-eps/prettier-config) 仓库.

### (3) 配置 ESLint

在 [`extends`](http://eslint.org/docs/user-guide/configuring#extending-configuration-files) 区域 [ESLint 配置](http://eslint.org/docs/user-guide/configuring)数字 :

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

### 现行规则一览表

应用规则列表可见 [这里](https://npmcn.com/package/%40emerson-eps/eslint-config/config.json)

## 在代码上运行 ESLint

向您添加一个插图脚本 `package.json`,例如:

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

然后,代码可以被嵌入:

```sh
npm run lint
```

CI 管道应配置为在闪烁警告后失败.

## 与视觉工作室代码整合

如果尚未安装,请安装 [高级](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) 财务报告和审定财务报表 [ESLint 语录](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) 扩展.

## 覆盖共享配置

尝试不要覆盖共享配置, 除非您真的需要 。 如果您必须覆盖它们, 请先考虑作为相关寄存器的修改来提议该覆盖, 以避免不同项目中代码样式的差异 .

## 常见问题

### @emerson-eps/eslint-config 是什么？

Emerson E&P 软件共享的 ESLint 配置

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

