Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(experimental-utils): add types for suggestions from CLIEngine (#…
  • Loading branch information
bradzacher committed Apr 4, 2020
1 parent c49d771 commit 7c11bd6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 8 additions & 0 deletions packages/experimental-utils/src/ts-eslint/Linter.ts
Expand Up @@ -81,18 +81,26 @@ namespace Linter {
reportUnusedDisableDirectives?: boolean;
}

export interface LintSuggestion {
desc: string;
fix: RuleFix;
messageId?: string;
}

export interface LintMessage {
column: number;
line: number;
endColumn?: number;
endLine?: number;
ruleId: string | null;
message: string;
messageId?: string;
nodeType: string;
fatal?: true;
severity: Severity;
fix?: RuleFix;
source: string | null;
suggestions?: LintSuggestion[];
}

export interface FixOptions extends LintOptions {
Expand Down
2 changes: 0 additions & 2 deletions packages/experimental-utils/src/ts-eslint/Rule.ts
Expand Up @@ -129,8 +129,6 @@ interface ReportDescriptorBase<TMessageIds extends string> {
*/
messageId: TMessageIds;
// we disallow this because it's much better to use messageIds for reusable errors that are easily testable
// message?: string;
// suggestions instead have this property that works the same, but again it's much better to use messageIds
// desc?: string;
}
interface ReportDescriptorWithSuggestion<TMessageIds extends string>
Expand Down

0 comments on commit 7c11bd6

Please sign in to comment.