# @abhijithvijayan/eslint-config 中文文档

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

版本：3\.0\.1
npm 元数据更新时间：2026-01-04T12:37:01.944Z
中文译文更新时间：2026-11-06T18:45:15.652Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：34.6 kB，19 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- Node.js 要求：\>=20
- 运行依赖：0 个
- peer 依赖：@typescript-eslint/eslint-plugin \>=8\.0\.0，@typescript-eslint/parser \>=8\.0\.0，eslint \>=9\.0\.0，eslint-config-prettier \>=9\.1\.0，eslint-plugin-import-x \>=4\.0\.0，eslint-plugin-jsx-a11y \>=6\.10\.0，eslint-plugin-n \>=17\.0\.0，eslint-plugin-prettier \>=5\.1\.0，eslint-plugin-react \>=7\.35\.0，eslint-plugin-react-hooks \>=5\.0\.0，globals \>=15\.0\.0，prettier \>=3\.0\.0
- 首次发布：2020-04-14T02:00:36.532Z
- 最新版本发布：2026-01-04T12:37:01.569Z
- 近 30 天下载量：2455（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：55（近 12 个月 2 个）

## 中文简介

我共享的 ESLint 和 Pretier 项目配置

## 安装

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

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

## README

# 埃斯林特配置

我共享的 ESLint 和 Pretier 项目配置

 [![NPM](https://img.shields.io/npm/v/@abhijithvijayan/eslint-config)](https://www.npmjs.com/package/@abhijithvijayan/eslint-config)[![LICENSE](https://img.shields.io/github/license/abhijithvijayan/eslint-config.svg) ](https://github.com/abhijithvijayan/eslint-config/blob/main/license)[![TWEET](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Check%20out%20eslint-config%21%20by%20%40_abhijithv%0A%0AA%20shared%20ESLint%20%26%20Prettier%20configuration%20with%20TypeScript%20%26%20React%20support.%20https%3A%2F%2Fgithub.com%2Fabhijithvijayan%2Feslint-config%20%0A%0A%23javascript%20%23react%20%23typescript%20%23eslint)

### \* \* \* \* 由我制作 [@abhijithvijayan (英语)](https://twitter.com/_abhijithv)

捐赠 : [_**付费页**_](https://www.paypal.me/iamabhijithvijayan), (中文(简体) ), [_**帕特伦**_](https://www.patreon.com/abhijithvijayan)

[![Buy Me a Coffee](https://bmc-cdn.nyc3.digitaloceanspaces.com/BMC-button-images/custom_images/orange_img.png)](https://www.buymeacoffee.com/abhijithvijayan)

* * *

它吗? 打开它 [GitHub 图像](https://github.com/abhijithvijayan/eslint-config/stargazers) 或者说 [图文](https://twitter.com/intent/tweet?text=Check%20out%20eslint-config%21%20by%20%40_abhijithv%0A%0AA%20shared%20ESLint%20%26%20Prettier%20configuration%20with%20TypeScript%20%26%20React%20support.%20https%3A%2F%2Fgithub.com%2Fabhijithvijayan%2Feslint-config%20%0A%0A%23javascript%20%23react%20%23typescript%20%23eslint) 关于它.

## 目录

-   [特征](https://npmcn.com/package/%40abhijithvijayan/eslint-config/#readme-features)
-   [安装](https://npmcn.com/package/%40abhijithvijayan/eslint-config/#readme-installation)
-   [使用量](https://npmcn.com/package/%40abhijithvijayan/eslint-config/#readme-usage)
-   [其他配置](https://npmcn.com/package/%40abhijithvijayan/eslint-config/#readme-other-configs)
-   [覆盖](https://npmcn.com/package/%40abhijithvijayan/eslint-config/#readme-override)
-   [带有 VS 代码](https://npmcn.com/package/%40abhijithvijayan/eslint-config/#readme-with-vs-code)
-   [问题](https://npmcn.com/package/%40abhijithvijayan/eslint-config/#readme-issues)
    -   [QQ 错误](https://npmcn.com/package/%40abhijithvijayan/eslint-config/#readme--bugs)
-   [许可证](https://npmcn.com/package/%40abhijithvijayan/eslint-config/#readme-license)

## 特征

配置默认包含这些插件 :

-   [埃斯林特-插口-进口-x](https://github.com/un-ts/eslint-plugin-import-x)
-   [埃斯林特-插头-jsx-a11y](https://www.npmjs.com/package/eslint-plugin-jsx-a11y)
-   [埃斯林特- 插孔- prettier](https://github.com/prettier/eslint-plugin-prettier)
-   [eslint- 插件反应](https://github.com/jsx-eslint/eslint-plugin-react)
-   [eslint-plugin- react-hooks (英语)](https://www.npmjs.com/package/eslint-plugin-react-hooks)
-   [类型标记- slint](https://github.com/typescript-eslint/typescript-eslint)
-   [埃斯林特-插头-n](https://github.com/eslint-community/eslint-plugin-n)

## 安装

```sh
npm install --save-dev @abhijithvijayan/eslint-config
```

安装所需的对等依赖 :

```sh
npm install --save-dev eslint eslint-config-prettier eslint-plugin-import-x eslint-plugin-prettier globals prettier
```

对于TypeScript支持,也安装:

```sh
npm install --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript
```

对于反应支持,也安装:

```sh
npm install --save-dev eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
```

对于Node.js支持,也安装:

```sh
npm install --save-dev eslint-plugin-n
```

## 使用量

此软件包使用 ESLint 软件包 [平面配置](https://eslint.org/docs/latest/use/configure/configuration-files-new) 格式。 创建一个 `eslint.config.js` (或 `eslint.config.mjs`在工程根中的文件 :

```js
import baseConfig from '@abhijithvijayan/eslint-config';

export default [
  ...baseConfig,
  // your overrides
];
```

## 其他配置

这个配置也暴露了 `react`, (中文(简体) ), `node`,以及 `typescript` 我经常使用的配置.

### 类型脚本

```js
import typescriptConfig from '@abhijithvijayan/eslint-config/typescript';

export default [
  ...typescriptConfig,
  // your overrides
];
```

### 节点.js

与碱性配置(建议)结合使用:

```js
import baseConfig from '@abhijithvijayan/eslint-config';
import nodeConfig from '@abhijithvijayan/eslint-config/node';

export default [
  ...baseConfig, // or typescriptConfig
  ...nodeConfig,
  // your overrides
];
```

### 反应

与碱性配置(建议)结合使用:

```js
import baseConfig from '@abhijithvijayan/eslint-config';
import reactConfig from '@abhijithvijayan/eslint-config/react';

export default [
  ...baseConfig, // or typescriptConfig
  ...reactConfig,
  // your overrides
];
```

### 可选

-   要插入您的文件, 您可以在您的文件中添加以下脚本 `package.json`数字 :
    
    ```json
    "scripts": {
        "lint": "eslint .",
        "lint:fix": "eslint . --fix"
    },
    ```
    
-   添加要忽略的文件/目录 `eslint.config.js`数字 :
    
    ```js
    export default [
      {
        ignores: ['node_modules', 'dist', '.yarn', '.pnp.js'],
      },
      ...baseConfig,
    ];
    ```
    

* * *

## 覆盖

如果你想要推翻 `eslint` 或者说 `prettier` 设置中,您可以在您的 `eslint.config.js` 文件 :

```js
import baseConfig from '@abhijithvijayan/eslint-config';

export default [
  ...baseConfig,
  {
    rules: {
      'no-console': 'off',
      'prettier/prettier': [
        'error',
        {
          bracketSpacing: true,
          printWidth: 120,
          semi: true,
          singleQuote: true,
          tabWidth: 4,
          trailingComma: 'all',
          useTabs: false,
        },
      ],
    },
  },
];
```

## 带有 VS 代码

要显示编辑器的错误, 您需要配置您的编辑器 .

1.  安装 [ESLint 软件包](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
    
2.  安装 [高级软件包](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
    
3.  现在我们需要通过 `Code/File` → `Preferences` → `Settings`。编辑时更容易输入这些设置 `settings.json` 文件,单击 `{}` 右上角图标:
    
    ```json
    "editor.formatOnSave": true,
    "[javascript]": {
      "editor.formatOnSave": false
    },
    "[javascriptreact]": {
      "editor.formatOnSave": false
    },
    "[typescript]": {
      "editor.formatOnSave": false
    },
    "[typescriptreact]": {
      "editor.formatOnSave": false
    },
    "editor.codeActionsOnSave": {
        "source.fixAll": "explicit",
        "source.fixAll.eslint": "explicit"
    },
    "prettier.disableLanguages": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
    ```
    

## 问题

_想做贡献吗? 寻找 [好,第一个问题](https://github.com/abhijithvijayan/eslint-config/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22) 标签._

### QQ 错误

请提交一个问题 [这里](https://github.com/abhijithvijayan/eslint-config/issues/new) 对于错误,缺少文档,或意外行为.

[**见臭虫**](https://github.com/abhijithvijayan/eslint-config/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22type%3A+bug%22)

### 类型脚本配置

-   共享类型脚本配置 - [`@abhijithvijayan/tsconfig`](https://www.npmjs.com/package/@abhijithvijayan/tsconfig)

## 许可证

麻省理工学院 [阿比吉斯·维贾扬](https://abhijithvijayan.in/)

## 常见问题

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

我共享的 ESLint 和 Pretier 项目配置

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

在项目目录运行 npm install @abhijithvijayan/eslint-config，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：eslint（\>=9\.0\.0）、eslint-config-prettier（\>=9\.1\.0）、eslint-plugin-import-x（\>=4\.0\.0）、eslint-plugin-prettier（\>=5\.1\.0）、globals（\>=15\.0\.0）、prettier（\>=3\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

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

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

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

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

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

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

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

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

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

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

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

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

