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.
Comment module provides boolean predicates and a text accessor for working with oxlint comment nodes. Oxlint comments have a type of "Line", "Block", or "Shebang" and a value string containing the comment text without its delimiters. Use these helpers inside visitors that call sourceCode.getAllComments() to filter and inspect comments without manual string checks.
Type predicates
Comment.isLine
Returns true if the comment is a line comment (// ...).
An oxlint
Comment node, typically from sourceCode.getAllComments().true when comment.type === "Line".Comment.isBlock
Returns true if the comment is a block comment (/* ... */).
An oxlint
Comment node.true when comment.type === "Block".Comment.isShebang
Returns true if the comment is a shebang line (#!/usr/bin/env node).
An oxlint
Comment node.true when comment.type === "Shebang".Comment.isJSDoc
Returns true if the comment is a JSDoc block comment (/** ... */).
value starts with *. This matches the /** opening delimiter pattern — the leading * is the first character after /*.
An oxlint
Comment node.true when comment.type === "Block" and comment.value starts with "*".Comment.isDisableDirective
Returns true if the comment is an eslint or oxlint disable directive.
// eslint-disable-next-line ..., // oxlint-disable-next-line ...) and block comments (/* eslint-disable ... */, /* oxlint-disable ... */). The check trims leading whitespace from the comment value before matching.
An oxlint
Comment node.true when the trimmed value starts with "eslint-disable" or "oxlint-disable".Comment.isEnableDirective
Returns true if the comment is an eslint or oxlint enable directive.
// eslint-enable ..., /* eslint-enable ... */, // oxlint-enable ..., and /* oxlint-enable ... */. Leading whitespace is trimmed before matching.
An oxlint
Comment node.true when the trimmed value starts with "eslint-enable" or "oxlint-enable".Text accessor
Comment.text
Returns the text content of a comment without its delimiters.
// hello world, text returns " hello world". For a block comment /* some text */, it returns " some text ". The delimiters themselves (//, /*, */) are never included.
An oxlint
Comment node.The raw
comment.value string.Usage with SourceCode.getAllComments
The typical pattern is to call getAllComments() inside a Program visitor, then filter and inspect comments using the predicates:
Comment.isJSDoc implies Comment.isBlock. You do not need to check both — isJSDoc already verifies the "Block" type before checking the leading *.