Skip to content

Commit c0fdcb3

Browse files
committed
refactor(linter/plugins): clarify types
1 parent 63ddbdb commit c0fdcb3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

apps/oxlint/src-js/plugins/visitor.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ import {
9292
} from "./selector.ts";
9393
import { debugAssert, debugAssertIsNonNull } from "../utils/asserts.ts";
9494

95-
import type { Node, Visitor } from "./types.ts";
95+
import type { Node } from "./types.ts";
96+
import type { VisitorObject } from "../generated/visitor.d.ts";
9697

9798
// Visit function for a specific AST node type.
9899
export type VisitFn = (node: Node) => void;
@@ -252,7 +253,7 @@ export function initCompiledVisitor(): void {
252253
*
253254
* @param visitor - Visitor object
254255
*/
255-
export function addVisitorToCompiled(visitor: Visitor): void {
256+
export function addVisitorToCompiled(visitor: VisitorObject): void {
256257
if (visitor === null || typeof visitor !== "object") {
257258
throw new TypeError("Visitor returned from `create` method must be an object");
258259
}

0 commit comments

Comments
 (0)