Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/oxlint/test/fixtures/fixes/fix.snap.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let magic = 3;
let damned = 4;
let elephant = 5;
let feck = 6;
let numpty = 7;
let rage = 7;
let dangermouse = 8;
let granular = 9;
let cowabunga = 10;
Expand Down
2 changes: 1 addition & 1 deletion apps/oxlint/test/fixtures/fixes/output.snap.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
9 | let g = 7;
`----

x fixes-plugin(fixes): Replace "g" with "numpty"
x fixes-plugin(fixes): Replace "g" with "rage"
,-[files/index.js:9:5]
8 | let f = 6;
9 | let g = 7;
Expand Down
10 changes: 5 additions & 5 deletions apps/oxlint/test/fixtures/fixes/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ const rule: Rule = {

case "g":
return context.report({
message: 'Replace "g" with "numpty"',
message: 'Replace "g" with "rage"',
node,
fix(fixer) {
// Fixes can be in any order
// Add text before and after the node only, to test combining fixes that include original source.
// Fixes can be in any order.
return [
fixer.insertTextAfter(node, "ty"),
// Test that any object with `range` property works
fixer.replaceText({ range: [node.start, node.end] } as Node, "mp"),
fixer.insertTextBefore(node, "nu"),
fixer.insertTextAfter({ range: [node.start, node.end] }, "e"),
fixer.insertTextBefore(node, "ra"),
];
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let magic = 3;
let damned = 4;
let elephant = 5;
let feck = 6;
let numpty = 7;
let rage = 7;
let dangermouse = 8;
let granular = 9;
let cowabunga = 10;
Expand Down
2 changes: 1 addition & 1 deletion apps/oxlint/test/fixtures/suggestions/fix.snap.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
9 | let g = 7;
`----

x suggestions-plugin(suggestions): Replace "g" with "numpty"
x suggestions-plugin(suggestions): Replace "g" with "rage"
,-[files/index.js:9:5]
8 | let f = 6;
9 | let g = 7;
Expand Down
2 changes: 1 addition & 1 deletion apps/oxlint/test/fixtures/suggestions/output.snap.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
9 | let g = 7;
`----

x suggestions-plugin(suggestions): Replace "g" with "numpty"
x suggestions-plugin(suggestions): Replace "g" with "rage"
,-[files/index.js:9:5]
8 | let f = 6;
9 | let g = 7;
Expand Down
10 changes: 5 additions & 5 deletions apps/oxlint/test/fixtures/suggestions/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,18 @@ const rule: Rule = {

case "g":
return context.report({
message: 'Replace "g" with "numpty"',
message: 'Replace "g" with "rage"',
node,
suggest: [
{
desc: "Do it",
fix(fixer) {
// Fixes can be in any order
// Add text before and after the node only, to test combining fixes that include original source.
// Fixes can be in any order.
return [
fixer.insertTextAfter(node, "ty"),
// Test that any object with `range` property works
fixer.replaceText({ range: [node.start, node.end] } as Node, "mp"),
fixer.insertTextBefore(node, "nu"),
fixer.insertTextAfter({ range: [node.start, node.end] }, "e"),
fixer.insertTextBefore(node, "ra"),
];
},
},
Expand Down
Loading