Registry / devops / effect-oxlint

effect-oxlint

JSON →
library0.2.0jsnpmunverified

Effect-first library for writing oxlint custom lint rules. Current stable version: 0.2.0. Release cadence: irregular, with initial releases in early 2025. Key differentiators: provides typed errors, composable visitors, Option-safe AST matching, and Ref-based state without mutable variables, wrapping @oxlint/plugins in Effect idioms. Requires effect@^4.0.0-beta.57 as a peer dependency. Ideal for Effect ecosystem developers who want to write lint rules with Effect's effectful computation model.

npm install effect-oxlint
INSTALL
IMPORT
SIG · EFFECT-OXLINT
E
effect-oxlint
devopsjavascriptv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Rule
import { Rule } from 'effect-oxlint'
const { Rule } = require('effect-oxlint')
ESM-only; named export from main module.
AST
import { AST } from 'effect-oxlint'
import AST from 'effect-oxlint'
Default import not available; must use named import.
Plugin
import { Plugin } from 'effect-oxlint'
Named export for assembling plugins.
Diagnostic
import { Diagnostic } from 'effect-oxlint'
Named export for building diagnostics.
Testing
import { Testing } from 'effect-oxlint/testing'
import { Testing } from 'effect-oxlint'
Testing module is in a subpath export 'effect-oxlint/testing'.

Defines a custom oxlint rule using Effect idioms, then assembles it into a plugin.

import * as Effect from 'effect/Effect'; import * as Option from 'effect/Option'; import { AST, Diagnostic, Rule, RuleContext } from 'effect-oxlint'; 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' }) ) } ) }; } }); export default Plugin.define({ name: 'my-effect-rules', rules: { 'no-json-parse': noJsonParse } });
Debug
Known issues
breakingIn v0.2.0, SourceCode.getText was split into getText() (whole file) and getNodeText(node) (node-specific). Old overload with Option<Node> removed.
fix
Use SourceCode.getText() for full file and SourceCode.getNodeText(node) for specific nodes.
affects: >=0.2.0
breakingRequires effect@^4.0.0-beta.57; incompatible with older effect versions.
fix
Update effect to ^4.0.0-beta.57.
affects: >=0.2.0
deprecatedThe previous Option<Node> overload of SourceCode.getText is removed; update to split functions.
fix
Use getNodeText for node-specific text extraction.
affects: >=0.2.0
breakingPeer dependency effect must be at least 4.0.0-beta.57; earlier betas fail.
fix
npm install effect@^4.0.0-beta.57
affects: >=0.2.0
Errors
Common errors & fixes
Cannot find module 'effect-oxlint' or its corresponding type declarations.
Missing or incompatible peer dependency 'effect'.
fix
Install effect@^4.0.0-beta.57 alongside effect-oxlint.
TypeError: (intermediate value) is not iterable
Using yield* in a non-generator context or missing Effect.run*.
fix
Ensure create is a generator function and wrap in Effect.runSync or similar.
Error: Cannot find module 'effect-oxlint/testing'
Importing Testing from wrong path; Testing is a subpath export.
fix
import { Testing } from 'effect-oxlint/testing'
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
effectrequiredPeer dependency; provides Effect, Option, etc. for rule definitions
Agent activity
2 hits · last 30 days
node
2
Resources
effect-oxlint — npm install effect-oxlint · libregistry