Every matcher in 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.
AST module returns Option rather than a nullable value or a thrown exception. This keeps matching composable: you chain matchers with Option.map, Option.flatMap, and Option.match, and the absence of a match is just Option.none() — no special-casing required. All public matchers support a dual API: pass the node as the first argument (data-first) or omit it to get a curried data-last function for use in pipe.
The dual API
The dual API is implemented viadual from effect/Function. Both call shapes compile to the same underlying implementation:
pipe or Option.flatMap chain.
matchMember — match obj.prop member expressions
matchMember(node, obj, prop) matches a MemberExpression of the form obj.prop where obj is an identifier with the given name and prop matches one of the given property names. Returns Option<ESTree.StaticMemberExpression>.
prop accepts either a single string or a ReadonlyArray<string>. Computed member expressions (e.g. obj[prop]) and private identifiers always return Option.none().
isMember — boolean predicate shorthand
isMember(node, obj, prop) is the boolean version of matchMember. Use it when you need a predicate rather than the narrowed node — for example, in Visitor.tracked.
matchCallOf — match obj.prop(…) call expressions
matchCallOf(node, obj, prop) matches a CallExpression whose callee is the static member expression obj.prop. Returns Option<ESTree.CallExpression>.
isCallOf — boolean predicate
isCallOf(node, obj, prop) is the boolean counterpart to matchCallOf. Useful in predicates passed to Visitor.tracked.
matchImport — match imports by string or predicate
matchImport(node, source) matches an ImportDeclaration whose source string satisfies the given matcher. Pass a string for exact match, or a function for custom logic.
isImport — boolean predicate
calleeName — extract bare identifier callee
calleeName(node) extracts the name of a bare identifier callee from a CallExpression. Returns Option.none() when the callee is not a plain identifier (e.g. it is a member expression or complex expression).
calleeIdentifier — unified for CallExpression and NewExpression
calleeIdentifier(node) works identically to calleeName but accepts either a CallExpression or a NewExpression. Use this when you need to extract the constructor name from new Date() or new Error().
memberNames — extract [obj, prop] pair
memberNames(node) extracts the object and property identifier names from a static MemberExpression. Returns Option<readonly [obj: string, prop: string]>. Returns Option.none() for computed members.
importSource — extract source string
importSource(node) extracts the raw source string from an ImportDeclaration. Unlike matchImport, this is not a matcher — it always returns a string.
objectKeys, objectHasKey, objectGetValue
These helpers operate onObjectExpression nodes — useful for inspecting object literals passed as rule options or configuration objects.
narrow — safe node narrowing to Option
narrow(node, type) checks whether an ESTree.Node’s type field matches the given string literal, and if so returns Option.some(node) narrowed to ESTree.Node & { type: T }. This is the safe, cast-free alternative to as.
narrow with matchers for a fully type-safe chain:
memberPath — full chain a.b.c → [‘a’, ‘b’, ‘c’]
memberPath(node) walks a (possibly chained) MemberExpression and collects every identifier name into a NonEmptyReadonlyArray<string>. Returns Option.none() if any segment is computed or non-identifier.
findAncestor and hasAncestor — parent chain walking
findAncestor(node, type) walks the .parent chain starting from the immediate parent and returns the first ancestor whose type field matches the given string. The return type narrows type to the provided literal.
hasAncestor(node, type) is the boolean shorthand.
Both functions support the dual API.
findAncestor depends on .parent links being set on AST nodes. oxlint sets these before calling visitor handlers, so they are always available in real rule handlers. In tests, use Testing.withParentChain(...) or Testing.astNode(type, parent) to construct nodes with parent pointers.Pipe chaining example
The dual API andOption composition shine when you need to combine multiple matching steps. This pattern narrows a raw ESTree.Node to a CallExpression, then confirms the callee is Effect.gen:
Option.match for the report/skip branching: