Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update RuleVisitor type #135

Merged
merged 6 commits into from
Nov 27, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,14 @@ export type RuleType = "problem" | "suggestion" | "layout";
*/
export type RuleFixType = "code" | "whitespace";

/* eslint-disable @typescript-eslint/consistent-indexed-object-style -- Needs to be interface so people can extend it. */
/* eslint-disable @typescript-eslint/no-explicit-any -- Necessary to allow subclasses to work correctly */
/**
* An object containing visitor information for a rule. Each method is either the
* name of a node type or a selector, or is a method that will be called at specific
* times during the traversal.
*/
export interface RuleVisitor {
/**
* Called for each node in the AST or at specific times during the traversal.
*/
[key: string]: (...args: any[]) => void;
}
/* eslint-enable @typescript-eslint/consistent-indexed-object-style -- Needs to be interface so people can extend it. */
export type RuleVisitor = Record<string, (...args: any[]) => void>;
nzakas marked this conversation as resolved.
Show resolved Hide resolved

/* eslint-enable @typescript-eslint/no-explicit-any -- Necessary to allow subclasses to work correctly */

/**
Expand Down