Skip to content

Commit

Permalink
refactor!: removed TRuleListener generic from the CLIEngine and `…
Browse files Browse the repository at this point in the history
…RuleCreateFunction`
  • Loading branch information
Andarist committed May 22, 2022
1 parent 4b50e45 commit cc2fc8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions packages/utils/src/ts-eslint/CLIEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { CLIEngine as ESLintCLIEngine } from 'eslint';
import { Linter } from './Linter';
import { RuleListener, RuleMetaData, RuleModule } from './Rule';
import { RuleMetaData, RuleModule } from './Rule';

declare class CLIEngineBase {
/**
Expand Down Expand Up @@ -70,9 +70,7 @@ declare class CLIEngineBase {
getRules<
TMessageIds extends string = string,
TOptions extends readonly unknown[] = unknown[],
// for extending base rules
TRuleListener extends RuleListener = RuleListener,
>(): Map<string, RuleModule<TMessageIds, TOptions, TRuleListener>>;
>(): Map<string, RuleModule<TMessageIds, TOptions>>;

////////////////////
// static members //
Expand Down
4 changes: 1 addition & 3 deletions packages/utils/src/ts-eslint/Rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,7 @@ interface RuleModule<
type RuleCreateFunction<
TMessageIds extends string = never,
TOptions extends readonly unknown[] = unknown[],
// for extending base rules
TRuleListener extends RuleListener = RuleListener,
> = (context: Readonly<RuleContext<TMessageIds, TOptions>>) => TRuleListener;
> = (context: Readonly<RuleContext<TMessageIds, TOptions>>) => RuleListener;

export {
ReportDescriptor,
Expand Down

0 comments on commit cc2fc8c

Please sign in to comment.