Skip to content

Commit

Permalink
fix(experimental-utils): require fix in suggestions (#3949)
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Oct 3, 2021
1 parent edaa3c1 commit f022fb1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/experimental-utils/src/ts-eslint/Rule.ts
Expand Up @@ -112,11 +112,16 @@ interface RuleFixer {
replaceTextRange(range: AST.Range, text: string): RuleFix;
}

interface SuggestionReportDescriptor<TMessageIds extends string>
extends Omit<ReportDescriptorBase<TMessageIds>, 'fix'> {
readonly fix: ReportFixFunction;
}

type ReportFixFunction = (
fixer: RuleFixer,
) => null | RuleFix | readonly RuleFix[] | IterableIterator<RuleFix>;
type ReportSuggestionArray<TMessageIds extends string> =
ReportDescriptorBase<TMessageIds>[];
SuggestionReportDescriptor<TMessageIds>[];

interface ReportDescriptorBase<TMessageIds extends string> {
/**
Expand Down

0 comments on commit f022fb1

Please sign in to comment.