Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Aug 19, 2024
1 parent 67997f0 commit b5f0abf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rules/prefer-string-slice.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function * fixSubstrArguments({node, fixer, context, abort}) {
const firstArgumentText = getParenthesizedText(firstArgument, sourceCode);

yield fixer.insertTextBeforeRange(secondArgumentRange, `(${firstArgumentText} + `);
yield fixer.insertTextAfterRange(secondArgumentRange, `) || undefined`);
yield fixer.insertTextAfterRange(secondArgumentRange, ') || undefined');
return;
}

Expand Down
2 changes: 1 addition & 1 deletion test/prefer-string-slice.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,6 @@ test.snapshot({
outdent`
const string = "::";
const output = string.substr(-2, 2);
`
`,
],
});

0 comments on commit b5f0abf

Please sign in to comment.