@atom.io/eslint-plugin

中文文档
0.1.1发布于 2026/10/29MPL-2.0TypeScriptES Module构建来源已验证近 30 天下载 2.1万

ESLint rules for atom.io state and transaction declarations.

原始使用文档
文档目录5 节
  1. ESLint rules for atom.io state and transaction declarations.
  2. 📖 Read the docs at atom.io.fyi
  3. Install
  4. Configuration
  5. Rules
atom.io logo

@atom.io/eslint-plugin

NPM VersionDependencies 1CoverageTypes

ESLint rules for atom.io state and transaction declarations.

📖 Read the docs at atom.io.fyi

Install this package as a development dependency alongside ESLint 9 or 10, @typescript-eslint/parser 8, and a supported TypeScript compiler (4.8.4 through 6.0.x).

The TypeScript peer describes the compiler API used by ESLint. You can build with TypeScript 7 alongside it: the starter templates alias TypeScript 7 as @typescript/native for tsc and @typescript/typescript6 as typescript for ESLint's compiler API and the separate tsc6 command.

The exact-catch-types rule requires a TypeScript parser configured with type information. Configure the parser in your ESLint configuration.

The opt-in ban-use-effect rule bans React useEffect in application code while allowing useLayoutEffect. Its diagnostics link to against useEffect and node_modules/atom.io/docs/agent/packages/against-use-effect.md for replacement guidance. See configuration and supported forms.

See the installation guide, configuration exhibit, and rule documentation. When migrating from atom.io/eslint-plugin, change the import to @atom.io/eslint-plugin; the default plugin export, named Rules export, rule names, and options are unchanged.

Install

pnpm add -D @atom.io/eslint-plugin eslint typescript-eslint \
  typescript@npm:@typescript/[email protected] \
  @typescript/native@npm:[email protected]

Configuration

import atomIO from "@atom.io/eslint-plugin"
import tseslint from "typescript-eslint"

export default tseslint.config(
    {
        ignores: [`dist/**`, `node_modules/**`],
    },
    ...tseslint.configs.recommendedTypeChecked,
    {
        files: [`**/*.{ts,tsx}`],
        languageOptions: {
            parserOptions: {
                projectService: true,
                tsconfigRootDir: import.meta.dirname,
            },
        },
        plugins: {
            "atom.io": atomIO,
        },
        rules: {
            "atom.io/exact-catch-types": `error`,
            "atom.io/explicit-state-types": `error`,
            "atom.io/explicit-transaction-types": `error`,
            "atom.io/naming-convention": `error`,
        },
    },
)

Rules

RuleDescription
atom.io/ban-use-effectBan React useEffect in atom.io application code
atom.io/naming-conventionThe variable names given to atom.io resources should match their key properties and follow a consistent format
atom.io/exact-catch-typesEnsures that when an error type (E) is provided to an atom, the 'catch' property is set and all constructors in it are assignable to E.
atom.io/explicit-state-typesState declarations must have generic type arguments directly passed to them
atom.io/explicit-transaction-typesTransaction declarations must have generic type arguments directly passed to them

版本与发布记录

@atom.io/eslint-plugin 共发布 4 个版本,首次发布于 2026/10/17;过去 12 个月发布了 4 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.1latest2026/10/299 天前
0.1.02026/10/2414 天前
0.0.02026/10/1722 天前
0.0.0-stage2026/10/1722 天前

关于 @atom.io/eslint-plugin 的常见问题

@atom.io/eslint-plugin 是什么?

ESLint rules for atom.io state and transaction declarations.

如何安装 @atom.io/eslint-plugin?

在项目目录运行 npm install @atom.io/eslint-plugin,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:eslint(^9.0.0 || ^10.0.0)、typescript(>=4.8.4 <6.1.0)、@typescript-eslint/parser(^8.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@atom.io/eslint-plugin 支持 TypeScript 吗?

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

@atom.io/eslint-plugin 支持 ESM 还是 CommonJS?

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

@atom.io/eslint-plugin 可以商用吗?

@atom.io/eslint-plugin 使用 MPL-2.0 许可。弱 Copyleft:可以商用,也可以和闭源代码一起使用;但如果分发时修改了 MPL 授权的文件,这些文件的修改需以 MPL 开源。以上为概括,不构成法律意见,请以许可原文为准。

@atom.io/eslint-plugin 的下载量有多少?

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

@atom.io/eslint-plugin 还在维护吗?

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