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.
Diagnostic module provides structured builders for creating and enhancing oxlint diagnostics. make and fromId construct basic diagnostics from a node location and message. withFix and withSuggestions attach autofix or suggestion metadata. The fix helpers — replaceText, insertBefore, insertAfter, removeFix, and composeFixes — produce composable FixFn values that can be combined freely before attaching to a diagnostic.
Diagnostic.make
Creates a diagnostic with a message and node location.The AST node or token that the diagnostic points to. Any value with range information satisfies
Ranged.The human-readable diagnostic message shown to the user.
Optional interpolation data for message templates.
Diagnostic.fromId
Creates a diagnostic using amessageId key from meta.messages rather than an inline string. The oxlint runtime resolves the template at report time.
The AST node or token that the diagnostic points to.
A key from the
messages record in Rule.meta. The runtime substitutes it with the corresponding message template.Optional interpolation data for the message template.
Diagnostic.withFix
Attaches an autofix function to a diagnostic. Dual API — supports both data-first and data-last calling conventions.The diagnostic to attach the fix to.
A fix function, typically produced by
replaceText, insertBefore, insertAfter, removeFix, or composeFixes.Diagnostic.withSuggestions
Attaches suggestion fixes to a diagnostic. Suggestions differ from autofixes in that the user applies them manually. Dual API — supports both data-first and data-last calling conventions.The diagnostic to attach suggestions to.
An array of
Suggestion objects, each containing a description and a fix function.To enable suggestions, set
hasSuggestions: true in your Rule.meta call.Diagnostic.replaceText
Returns aFixFn that replaces the text of a node or token with the given string.
The node or token whose source text should be replaced.
The replacement text.
Diagnostic.insertBefore
Returns aFixFn that inserts text immediately before a node or token.
The node or token to insert text before.
The text to insert.
Diagnostic.insertAfter
Returns aFixFn that inserts text immediately after a node or token.
The node or token to insert text after.
The text to insert.
Diagnostic.removeFix
Returns aFixFn that removes a node or token from the source.
The node or token to remove.
Diagnostic.composeFixes
Composes multipleFixFn values into a single FixFn. All individual fixes are collected into a single array result, letting you apply several edits atomically.
Any number of fix functions to compose. All are applied when the composed fix runs.