@catenarycloud/linteffect

中文文档
0.1.0发布于 2026/11/02MITES Module构建来源已验证近 30 天下载 6794

Biome Grit rules for declarative Effect TypeScript composition and repository-wide style consistency.

原始使用文档
文档目录8 节
  1. Try it on your code
  2. Add it to your project
  3. Install and configure
  4. Run your project checks
  5. Presets
  6. Lint findings
  7. Develop and contribute
  8. Forks and similar projects

lintEffect

lintEffect is a collection of Biome lint rules for TypeScript projects that use Effect v4. The rules keep related steps together and make each operation's decisions and results explicit.

I developed and maintain these rules for tradedal.com, an options trading app. I use them to keep the code declarative and reduce unnecessary boilerplate.

Roman Naumenko, author and maintainer

The rules identify anti-patterns such as nested Effect.gen blocks and consecutive operations written with Effect.all. Each diagnostic explains the pattern and suggests how to rewrite the code.

The rules target Effect 4. Version 0.0.9 is the final release for Effect v3.

You can use the full rule set or choose a smaller preset. Start with a smaller preset to introduce the rules to an established project.

For example, this code uses nested Effect calls to fetch a user and read their profile:

const loadUser = Effect.map(
  Effect.flatMap(getUserId, (userId) => fetchUser(userId)),
  (user) => user.profile
);

In a pipeline, the calls appear in the order they run:

const loadUser = getUserId.pipe(
  Effect.flatMap((userId) => fetchUser(userId)),
  Effect.map((user) => user.profile)
);

In this demo, Codex uses the rules to refactor Messages.ts from the Effect Discord bot.

Messages refactor demo

Try it on your code

You can check your code with npx without changes to your project's dependencies or configuration. Run this command from your project directory:

npx @catenarycloud/linteffect check src --preset=core

The command requires Node.js 24 or newer. It checks src with the core preset and leaves your source files unchanged. It runs Biome's WebAssembly engine in the same Node.js process, independently of your project's Biome settings. It loads the selected rules into an isolated in-memory workspace and creates no temporary configuration files.

Directory targets include supported files recursively. The CLI skips dependency and version-control directories during traversal, and it never follows directory symlinks. Files larger than 1 MiB fail the check.

Choose core, web, ts-type, or full with --preset. The preset table describes each group. If you omit --preset, the command uses full.

The package includes a lint guide for agents to fix lint errors and check the result. Add --guide to include its text in the command output, before the diagnostics:

npx @catenarycloud/linteffect check src --preset=core --guide

If an agent runs this command, it can read the guide along with the lint results.

Use --help for the command options. To try a prerelease, use @catenarycloud/linteffect@dev in the command.

Add it to your project

Install and configure

Install Biome and the rules with your project's package manager:

npm install -D @biomejs/biome @catenarycloud/linteffect
yarn add -D @biomejs/biome @catenarycloud/linteffect
pnpm add -D @biomejs/biome @catenarycloud/linteffect

Create a biome.json or biome.jsonc with the core preset in extends. If you already have either file, add the preset to its extends array and keep the rest of your configuration:

{
  "extends": ["@catenarycloud/linteffect/core"]
}

The presets use Biome 2.6.3's configuration schema. The standalone CLI bundles the matching WebAssembly engine and does not need a separate Biome installation.

With Yarn Berry, set nodeLinker: node-modules so Biome can find the rules in node_modules.

Run your project checks

After you save the configuration, run Biome from the project directory:

npx biome lint src

Biome now reads the preset as part of your project configuration. Your scripts and CI checks will also use these rules when they run Biome with this configuration.

Presets

To change presets, replace the package path in extends with one from this table. For a trial run, pass the preset name to the CLI, such as --preset=core.

Package pathRules included
@catenarycloud/linteffectThe full preset, also available as @catenarycloud/linteffect/recommended
@catenarycloud/linteffect/coreEffect composition, control flow, and execution order
@catenarycloud/linteffect/webReact hooks, atom access, state updates, and Vanilla Extract styles
@catenarycloud/linteffect/ts-typeType assertions, data guards, optional values, and string statuses

Lint findings

Each diagnostic message suggests a rewrite.

The guide explains the diagnostics and how to fix the code. Ask agents to read it before they make changes. Provide the guide separately when the agent uses your project's Biome setup.

Develop and contribute

Clone this repository and install its development dependencies with yarn install. Run yarn test to check the rules and yarn build to regenerate project files, run the tests, and create the npm archive.

yarn lint checks implementation code with the installed @catenarycloud/linteffect@dev package. yarn lint:dev selects it explicitly. Yarn locks the installed release; run yarn up -R @catenarycloud/linteffect to update that resolution without replacing the dev tag with a version range.

yarn lint:local checks the same files with this checkout's rules. Both configurations share formatting, import organization, recommended Biome rules, and Git ignore settings. Fixture source files stay outside these checks because they contain deliberate violations. Pass a path to focus either check:

yarn lint:dev src/cli.ts
yarn lint:local src/cli.ts

Tests and builds run yarn lint. Set BIOME_CONFIG_PATH=biome.local.jsonc to use the checkout's rules, for example BIOME_CONFIG_PATH=biome.local.jsonc yarn test. Compare published and local diagnostics before a rewrite.

.projenrc.ts generates both configurations and their shared biome.base.jsonc. It derives the local plugin list from configs/full.jsonc.

The Effect Language Service checks Effect usage and boolean conditions in editors and yarn typecheck. Compiler tasks apply its patch automatically. yarn effect:diagnostics reports its findings separately. Errors fail the typecheck; warnings and suggestions do not. Biome checks syntax and format.

Add rule test cases using the fixture layout and commands.

The rules are in rules/*.grit, and the files in configs/ list the rules for each preset. The project uses Projen. Edit .projenrc.ts to change package metadata or build tasks.

The rule development guide explains how to write a rule, test it against valid and invalid code, and add it to a preset. Follow docs/unslop.md for documentation and diagnostic messages.

Forks and similar projects

This project has been adapted for other linters through community forks:

  • OXC Effect by shekohex adapts the rules for Oxlint and ESLint. It targets Effect v4.

Effect also provides tools to check Effect code:

  • Effect Language Service adds Effect diagnostics, quick fixes, and refactors to your editor. It checks for problems such as unresolved service requirements and Effects that never execute.
  • Effect tsgo brings those tools to the native TypeScript compiler for TypeScript 7 and newer. It also supports type-aware Effect rules in Oxlint, with an Oxlint setup guide.

版本与发布记录

@catenarycloud/linteffect 共发布 29 个版本,首次发布于 2026/04/07;过去 12 个月发布了 29 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.0latest2026/11/027 天前
0.1.0-dev.5dev2026/10/319 天前
0.1.0-dev.42026/10/3010 天前
0.1.0-dev.32026/10/3010 天前
0.1.0-dev.22026/10/2910 天前
0.1.0-dev.12026/10/2910 天前

关于 @catenarycloud/linteffect 的常见问题

@catenarycloud/linteffect 是什么?

Biome Grit rules for declarative Effect TypeScript composition and repository-wide style consistency.

如何安装 @catenarycloud/linteffect?

在项目目录运行 npm install @catenarycloud/linteffect,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 linteffect,可以用 npx linteffect 直接运行。

@catenarycloud/linteffect 支持 TypeScript 吗?

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

@catenarycloud/linteffect 支持 ESM 还是 CommonJS?

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

@catenarycloud/linteffect 需要什么版本的 Node.js?

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

@catenarycloud/linteffect 可以商用吗?

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

@catenarycloud/linteffect 的下载量有多少?

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

@catenarycloud/linteffect 还在维护吗?

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