oxlint-plugin-effect
v0.2.3
Published
oxlint plugin with Effect-specific lint rules
Downloads
40,585
Readme
oxlint-plugin-effect
Oxlint plugin for Effect codebases.
Quick Start
bun add -D oxlint oxlint-plugin-effect.oxlintrc.json:
{
"jsPlugins": ["oxlint-plugin-effect/plugin"],
"rules": {
"effect/noEffectDo": "error",
"effect/noNestedPipe": "error",
"effect/noThrowStatement": "error",
"effect/noGlobals": "warn"
},
"overrides": [
{
"files": ["**/*.test.ts", "**/*.test.tsx", "**/tests/**", "**/test/**"],
"rules": {
"effect/noInlineProvide": "off"
}
}
]
}The overrides entry turns off noInlineProvide in test files. The rule's intent is "provide layers at the boundary, not scattered through production code" — in tests, it.effect(() => Effect.gen(function*() { ... }).pipe(Effect.provide(TestLayer))) is the boundary.
oxlintRule Authoring
The package also exports the Effect-first rule authoring bindings:
import { Diagnostic, Rule, RuleContext } from "oxlint-plugin-effect/rule-bindings";
export const noThing = Rule.define({
name: "no-thing",
meta: Rule.meta({
type: "problem",
description: "Avoid thing.",
}),
create: function* () {
const ctx = yield* RuleContext;
return {
Identifier: (node) => ctx.report(Diagnostic.make({ node, message: "Avoid thing." })),
};
},
});The same bindings are available from the root export for convenience:
import { Rule, Diagnostic, RuleContext } from "oxlint-plugin-effect";Rules
66 AST-only rules across categories: API bans, global bans, import bans, statement bans, AST patterns, and Effect-context rules. Five presets are available: core, full, effect-native, functional, and strict.
Development
bun install
bun run gate
bun run codegen
bun run add-rule <name> [--context]License
MIT
