@ariestools/eslint-config-react-flat

中文文档
10.3.0发布于 2026/11/07LGPL-3.0-onlyTypeScriptES Module近 30 天下载 4220

React ESLint flat config extending @ariestools/eslint-config-flat

原始使用文档
文档目录6 节
  1. Install
  2. Usage
  3. Extending with custom rules
  4. What's included
  5. License
  6. Credits

logo

@ariestools/eslint-config-react-flat

npm license

React ESLint flat config extending @ariestools/eslint-config-flat

Install

Requires Node.js ≥ 22. pnpm is fully supported; npm / yarn / bun are experimental.

pnpm add -D @ariestools/eslint-config-react-flat

Also install the same ESLint peers as the base package (eslint ^10.3, eslint-import-resolver-typescript ^4.4).

Usage

import {
  configReactStorybook,
  recommendedConfig,
} from '@ariestools/eslint-config-react-flat'

export default [
  ...recommendedConfig({ tier: 3, isTypeChecked: true }),
  ...configReactStorybook,
]

recommendedConfig accepts tier (0–4, default 3) and isTypeChecked (default true). Named configReactTier* exports remain available but are deprecated. Tier 4 is experimental.

React layers are added at tier 2 (best practices) and above. Lower tiers match @ariestools/eslint-config-flat without React rules. Storybook is opt-in via configReactStorybook.

Extending with custom rules

import { recommendedConfig } from '@ariestools/eslint-config-react-flat'

export default [
  ...recommendedConfig({ tier: 3, isTypeChecked: true }),
  {
    rules: {
      // your overrides
    },
  },
]

What's included

Everything from @ariestools/eslint-config-flat, plus:

  • React component linting via eslint-plugin-react-x
  • DOM API validation via eslint-plugin-react-dom
  • Hooks rules via eslint-plugin-react-hooks
  • Naming convention enforcement via eslint-plugin-react-naming-convention
  • React Refresh validation via eslint-plugin-react-refresh
  • Web API best practices via eslint-plugin-react-web-api

There is no SonarJS layer in this package.

License

LGPL-3.0-only. See LICENSE (LGPLv3) and COPYING (GPLv3, incorporated by LGPL-3).

Credits

Made with 🔥 and ❄️ by Aries Tools

版本与发布记录

@ariestools/eslint-config-react-flat 共发布 62 个版本,首次发布于 2026/07/08;过去 12 个月发布了 62 个版本。

版本发布日期距今
10.3.0latest2026/11/07今天
10.2.22026/10/317 天前
10.2.12026/10/2612 天前
10.2.02026/10/1226 天前
10.1.52026/10/1028 天前
10.1.42026/10/1029 天前

关于 @ariestools/eslint-config-react-flat 的常见问题

@ariestools/eslint-config-react-flat 是什么?

React ESLint flat config extending @ariestools/eslint-config-flat

如何安装 @ariestools/eslint-config-react-flat?

在项目目录运行 npm install @ariestools/eslint-config-react-flat,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:eslint(^10.3)、eslint-import-resolver-typescript(^4.4)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@ariestools/eslint-config-react-flat 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ariestools/eslint-config-react-flat 支持 ESM 还是 CommonJS?

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

@ariestools/eslint-config-react-flat 需要什么版本的 Node.js?

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

@ariestools/eslint-config-react-flat 可以商用吗?

@ariestools/eslint-config-react-flat 使用 LGPL-3.0-only 许可。弱 Copyleft:作为库被调用时通常不要求开源你自己的代码,但修改库本身需以 LGPL 开源;前端打包合并后的适用边界存在不同理解。以上为概括,不构成法律意见,请以许可原文为准。

@ariestools/eslint-config-react-flat 的下载量有多少?

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

@ariestools/eslint-config-react-flat 还在维护吗?

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