Skip to content

Commit 8d98a49

Browse files
committed
Revert "fix: require fix in suggestion objects (#298)"
This reverts commit 02bac50.
1 parent f5ecc7e commit 8d98a49

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

packages/core/src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ export interface ViolationReportBase {
487487
/**
488488
* The data to insert into the message.
489489
*/
490-
data?: Record<string, unknown> | undefined;
490+
data?: Record<string, string> | undefined;
491491

492492
/**
493493
* The fix to be applied for the violation.
@@ -521,12 +521,12 @@ export interface SuggestedEditBase {
521521
/**
522522
* The data to insert into the message.
523523
*/
524-
data?: Record<string, unknown> | undefined;
524+
data?: Record<string, string> | undefined;
525525

526526
/**
527527
* The fix to be applied for the suggestion.
528528
*/
529-
fix: RuleFixer;
529+
fix?: RuleFixer | null | undefined;
530530
}
531531

532532
export type SuggestionMessage = { desc: string } | { messageId: string };

packages/core/tests/types/types.test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ const testRule: RuleDefinition<{
298298
start: { line: node.start, column: 1 },
299299
end: { line: node.start + 1, column: Infinity },
300300
},
301-
data: undefined,
302301
fix(fixer: RuleTextEditor): RuleTextEdit {
303302
return fixer.replaceText(
304303
node,
@@ -319,12 +318,6 @@ const testRule: RuleDefinition<{
319318
suggest: [
320319
{
321320
messageId: "Bar",
322-
data: {
323-
foo: "foo",
324-
bar: 1,
325-
baz: true,
326-
},
327-
// @ts-expect-error -- 'fix' is required in suggestion objects
328321
fix: null,
329322
},
330323
],
@@ -335,11 +328,6 @@ const testRule: RuleDefinition<{
335328
context.report({
336329
message: "This baz is foobar",
337330
loc: { line: node.start, column: 1 },
338-
data: {
339-
foo: "foo",
340-
bar: 1,
341-
baz: true,
342-
},
343331
fix: null,
344332
suggest: null,
345333
});

0 commit comments

Comments
 (0)