Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/mpsuesser/effect-oxlint/llms.txt

Use this file to discover all available pages before exploring further.

effect-oxlint lets you write oxlint custom lint rules using Effect v4. Instead of mutable counters and nullable returns, you get Ref-based state, Option-returning AST matchers, and composable visitor combinators — all bridged to oxlint’s synchronous plugin API via Effect.runSync.

Quickstart

Define your first rule and assemble it into a plugin in minutes.

Installation

Install via npm, Bun, or Deno (JSR) and configure your runtime.

Writing Rules

Learn how to use Rule.define, convenience factories, and Effect generators.

API Reference

Explore every export across all 10 public modules.

What you can build

effect-oxlint is designed for teams running Effect who want to enforce Effect-specific conventions at lint time — rules like “no throw inside Effect.gen”, “use Clock service instead of new Date()”, or “import from effect/Array not Array.prototype”.

Rule.define

Write fully effectful create generators with yield* for state and context.

Visitor combinators

Compose, merge, filter, and accumulate visitors without mutation.

AST matchers

Option-returning matchers with dual API for safe, composable AST queries.

Diagnostics

Structured diagnostic builders with composable autofix functions.

Testing

50+ AST node builders and assertion helpers for @effect/vitest.

Plugin assembly

Assemble rules into oxlint-compatible plugins with Plugin.define.

Get started in 3 steps

1

Install the package

Add effect-oxlint and effect to your project:
npm install effect-oxlint effect@4.0.0-beta.57
2

Define a rule

Use Rule.define to write an Effect-first lint rule:
import { AST, Diagnostic, Rule, RuleContext } from 'effect-oxlint';
import * as Effect from 'effect/Effect';
import * as Option from 'effect/Option';

const noJsonParse = Rule.define({
  name: 'no-json-parse',
  meta: Rule.meta({
    type: 'suggestion',
    description: 'Use Schema for JSON decoding instead of JSON.parse'
  }),
  create: function* () {
    const ctx = yield* RuleContext;
    return {
      MemberExpression: (node) =>
        Option.match(
          AST.matchMember(node, 'JSON', ['parse', 'stringify']),
          {
            onNone: () => Effect.void,
            onSome: (matched) =>
              ctx.report(Diagnostic.make({ node: matched, message: 'Use Schema for JSON' }))
          }
        )
    };
  }
});
3

Assemble a plugin

Export your rules as an oxlint plugin:
import { Plugin } from 'effect-oxlint';

export default Plugin.define({
  name: 'my-effect-rules',
  rules: { 'no-json-parse': noJsonParse }
});
effect-oxlint ships as TypeScript source with no compiled dist/. It works out of the box with Bun, Deno (via JSR), and any TypeScript-aware bundler. See Installation for runtime-specific setup.

Build docs developers (and LLMs) love