TheDocumentation 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.
Rule module is the primary entry point for authoring Effect-first oxlint rules. Rule.define lets you write a create generator that uses yield* for state, context access, and diagnostics, while the convenience factories — banMember, banImport, banCallOf, banCallOfMember, banNewExpr, banStatement, and banMultiple — cover the most common lint patterns without requiring a full generator.
Rule.define
Defines an Effect-first oxlint rule. Thecreate generator runs once per file; each visitor handler runs once per matching node. State created via Ref.make in create persists across handler calls through closure.
RuleConfig interface
Rule name used for tracing spans.
Oxlint rule metadata. Build with
Rule.meta(...).Optional Effect Schema for rule options. When provided, the first element of the raw JSON options array is decoded at
create time.The create generator. Receives decoded options and returns a
TypedEffectVisitor. Runs inside an Effect context where RuleContext is available. May yield* Ref.make(...) for state and yield* RuleContext for context access.Both the
create generator and individual visitor handlers have a fixed error channel of never. Rules cannot fail via Effect.fail. If a handler needs a fallible sub-effect, catch the error inside the handler and surface it as a diagnostic.Rule.meta
Builds aRuleMeta object with sensible defaults.
The rule category. Use
'problem' for likely bugs, 'suggestion' for style improvements, and 'layout' for formatting.Human-readable description of what the rule enforces.
Set when the rule provides an autofix.
'code' for semantic changes, 'whitespace' for formatting-only fixes.Set to
true when the rule provides suggestion fixes (non-automatic fixes users can apply manually).A map of message IDs to message templates, used with
Diagnostic.fromId.Additional documentation metadata passed to oxlint.
Rule.banMember
Creates a rule that bansobj.prop member expression access.
The object identifier to match (e.g.
'Math', 'console').One or more property names to ban on the object.
The diagnostic message reported when the pattern is found.
Overrides the default rule type (
'suggestion').Rule.banImport
Creates a rule that bans imports matching a source string or predicate.Either an exact source string to match, or a predicate function that receives the import source and returns
true to ban it.The diagnostic message reported when the pattern is found.
Overrides the default rule type (
'suggestion').Rule.banCallOf
Creates a rule that bans bare identifier call expressions such asfetch(...) or useState(...).
One or more bare identifier names to ban when called.
The diagnostic message reported when the pattern is found.
Overrides the default rule type (
'suggestion').Rule.banCallOfMember
Creates a rule that bansobj.prop(...) method-call patterns.
The object identifier whose method calls to ban (e.g.
'Effect', 'console').One or more method names to ban on the object.
The diagnostic message reported when the pattern is found.
Overrides the default rule type (
'suggestion').Rule.banNewExpr
Creates a rule that bansnew expressions with the given callee name.
One or more constructor names to ban (e.g.
'Date', 'Error').The diagnostic message reported when the pattern is found.
Overrides the default rule type (
'suggestion').Rule.banStatement
Creates a rule that bans a specific AST statement node type.The ESTree node type name to ban, such as
'ThrowStatement' or 'ForStatement'.The diagnostic message reported when the pattern is found.
Overrides the default rule type (
'suggestion').Rule.banMultiple
Creates a rule that bans multiple patterns under a shared message, combining call bans,new expression bans, member bans, import bans, and statement bans into a single merged rule.
BanMultipleSpec interface
Bare identifier calls to ban (e.g.
'fetch' or ['useState', 'useEffect']).new expressions to ban (e.g. 'Date' or ['Error', 'TypeError']).Member expressions to ban as
[object, property | properties] tuples.Member call expressions to ban as
[object, property | properties] tuples.Import sources to ban — each entry is either an exact string or a predicate.
Statement node type names to ban (e.g.
'ThrowStatement').opts
Custom rule name. Defaults to
'ban-multiple'.The diagnostic message reported for every matched pattern.
Overrides the default rule type (
'suggestion').