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.
Token module provides boolean predicates and accessors for working with oxlint Token nodes. Tokens are the lexical units that oxlint’s parser emits — keywords, identifiers, punctuators, string literals, and more. Two predicates (isKeyword and isPunctuator) support the dual API pattern, which lets you use them both data-first and data-last for pipe composition.
Dual API predicates
Token.isKeyword
Returns true if the token is a keyword with the given value.
The keyword string to match against
token.value (e.g., "const", "return", "async").An oxlint
Token node.true when token.type === "Keyword" and token.value === keyword.Token.isPunctuator
Returns true if the token is a punctuator with the given value.
The punctuator string to match against
token.value (e.g., "{", ";", "=>").An oxlint
Token node.true when token.type === "Punctuator" and token.value === value.Simple predicates
These predicates take only aToken and return a boolean. They do not support the dual API.
Token.isIdentifier
true when token.type === "Identifier".
Token.isString
true when token.type === "String".
Token.isNumeric
true when token.type === "Numeric".
Token.isBoolean
true when token.type === "Boolean".
Token.isNull
true when token.type === "Null".
Token.isTemplate
true when token.type === "Template". Matches template literal parts (`, ${, }).
Token.isRegularExpression
true when token.type === "RegularExpression".
Token.isPrivateIdentifier
true when token.type === "PrivateIdentifier". Matches class private fields such as #foo.
Accessors
Token.value
Returns the string value of a token.
An oxlint
Token node.The raw
token.value string (e.g., "const", "{", "hello").Token.type
Returns the type discriminant of a token.
An oxlint
Token node.One of
"Keyword", "Identifier", "Punctuator", "String", "Numeric", "Boolean", "Null", "Template", "RegularExpression", or "PrivateIdentifier".Usage example
The following rule checks that everyconst declaration is immediately followed by a semicolon, using SourceCode.getTokens to walk the tokens of a node:
Token.isKeyword and Token.isPunctuator both use the dual combinator from effect/Function. When called with one argument they return a curried predicate, making them directly usable as Arr.filter callbacks.