# @alifd/eslint-config-next 中文文档

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

版本：2\.0\.0
npm 元数据更新时间：2025-12-25T06:43:43.930Z
中文译文更新时间：2026-11-06T23:38:48.900Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：13.9 kB，7 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- 运行依赖：0 个
- peer 依赖：eslint ^4\.19\.1，babel-eslint ^8\.2\.3，eslint-plugin-react ^7\.9\.1，eslint-plugin-import ^2\.12\.0，eslint-plugin-markdown ^1\.0\.0-beta\.6
- 首次发布：2018-08-21T13:05:55.930Z
- 最新版本发布：2018-08-21T13:05:56.203Z
- 近 30 天下载量：2160（2026-10-06 至 2026-11-04，npm 官方下载统计）
- 已发布版本数：1（近 12 个月 0 个）

## 中文简介

下一个组件 ESLint 配置, 遵循我们的样式指南 .

## 安装

```sh
npm install @alifd/eslint-config-next
```

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

## README

# @alifd/eslint-config-next

`@alifd/eslint-config-next` 是 Next 组件库默认的 [eslint](http://eslint.org/) 配置。

## 代码风格指南

-   [javascript](https://npmcn.com/package/%40alifd/eslint-config-next/docs/code-guide/javascript.md)
-   [jsx](https://npmcn.com/package/%40alifd/eslint-config-next/docs/code-guide/jsx.md)

## 规则配置原则

-   **browser**，目前配置的规则主要针对浏览器端代码的检查
-   **es6+**，支持对es6+语法规则的检查
-   **react**，扩展对jsx语法规则的检查
-   **ie9+**，不包括对兼容ie低版本特殊代码书写方式规则的检查

## 常见代码风格配置

-   缩进使用4个空格 `"indent": [2, 4, { "SwitchCase": 1 }]`,
-   使用单引号 `"quotes": [2, "single"]`
-   语句结尾保有分号 `"semi": 2`

## IDE 配置

-   [Atom](https://npmcn.com/package/%40alifd/eslint-config-next/docs/ide-usage/atom.md)
-   [Sublime](https://npmcn.com/package/%40alifd/eslint-config-next/docs/ide-usage/sublime.md)
-   [VSCode](https://npmcn.com/package/%40alifd/eslint-config-next/docs/ide-usage/vscode.md)
-   [WebStorm](https://npmcn.com/package/%40alifd/eslint-config-next/docs/ide-usage/webstorm.md)

## 参考

-   [eslint rules](http://eslint.org/docs/rules/)
-   [eslint rules (中文)](http://eslint.cn/docs/rules/)
-   [eslint-plugin-import rules](https://github.com/benmosher/eslint-plugin-import)
-   [eslint-plugin-react rules](https://github.com/yannickcr/eslint-plugin-react)

## 常见问题

### @alifd/eslint-config-next 是什么？

下一个组件 ESLint 配置, 遵循我们的样式指南 \.

### 如何安装 @alifd/eslint-config-next？

在项目目录运行 npm install @alifd/eslint-config-next，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：eslint（^4\.19\.1）、babel-eslint（^8\.2\.3）、eslint-plugin-react（^7\.9\.1）、eslint-plugin-import（^2\.12\.0）、eslint-plugin-markdown（^1\.0\.0-beta\.6）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @alifd/eslint-config-next 支持 TypeScript 吗？

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

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

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

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

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

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

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

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

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

