@sarj/eslint-plugin

中文文档
17.1.0发布于 2026/11/02MITTypeScriptESM + CJS构建来源已验证

Custom ESLint rules for hypermodern TypeScript / React / Next.js projects

原始使用文档

@sarj/eslint-plugin

Custom ESLint rules for hypermodern TypeScript / React / Next.js projects

npm install --save-dev @sarj/eslint-plugin

Version 17 requires ESLint 10.13.0 or later. The plugin, rules and flat presets use ESLint's native TypeScript contracts and compose directly with defineConfig from eslint/config. Use Linter.Config and ESLint.Options from eslint for consumer annotations; legacy TSESLint.Plugin and TSESLint.FlatConfig.Config annotations are no longer supported. The exported rule names, preset severities and option settings are unchanged.

Rules and configuration are documented in the generated rule directory.

Documentation · Source

版本与发布记录

@sarj/eslint-plugin 共发布 246 个版本,首次发布于 2025/03/20;过去 12 个月发布了 242 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
17.1.0latest2026/11/021 天前
17.0.02026/11/021 天前
16.42.12026/11/021 天前
16.42.02026/11/021 天前
16.40.02026/11/021 天前
16.39.12026/11/021 天前

关于 @sarj/eslint-plugin 的常见问题

@sarj/eslint-plugin 是什么?

为超现代的TypeScript / React / Next.js项目定制ESLint规则

如何安装 @sarj/eslint-plugin?

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

@sarj/eslint-plugin 支持 TypeScript 吗?

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

@sarj/eslint-plugin 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@sarj/eslint-plugin 需要什么版本的 Node.js?

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

@sarj/eslint-plugin 可以商用吗?

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

@sarj/eslint-plugin 还在维护吗?

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