Skip to content

Commit

Permalink
Make more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Sep 25, 2024
1 parent cc0f453 commit 766986b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,9 @@ export interface RulesMeta {
* view into the outside world.
*/
export interface RuleContext<
Code extends SourceCode = SourceCode,
LangOptions = LanguageOptions,
Code extends SourceCode = SourceCode,
RuleOptions = unknown[],
> {
/**
* The current working directory for the session.
Expand Down Expand Up @@ -262,7 +263,7 @@ export interface RuleContext<
/**
* The rule's configured options.
*/
options: unknown[];
options: RuleOptions;

/**
* The report function that the rule should use to report problems.
Expand Down Expand Up @@ -428,9 +429,10 @@ export type SuggestedEdit = SuggestedEditBase & SuggestionMessage;
* The definition of an ESLint rule.
*/
export interface RuleDefinition<
Visitor extends RuleVisitor = RuleVisitor,
Code extends SourceCode = SourceCode,
LangOptions = LanguageOptions,
Code extends SourceCode = SourceCode,
RuleOptions = unknown[],
Visitor extends RuleVisitor = RuleVisitor,
> {
/**
* The meta information for the rule.
Expand All @@ -442,7 +444,7 @@ export interface RuleDefinition<
* @param context The rule context.
* @returns The rule visitor.
*/
create(context: RuleContext<Code, LangOptions>): Visitor;
create(context: RuleContext<LangOptions, Code, RuleOptions>): Visitor;
}

//------------------------------------------------------------------------------
Expand Down

0 comments on commit 766986b

Please sign in to comment.