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

feat(experimental-utils): add types for suggestions from CLIEngine #1844

Merged
merged 2 commits into from Apr 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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