Skip to content

Commit

Permalink
Apply fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Jan 24, 2025
1 parent 196d814 commit 59603d9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rules/fix/remove-argument.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ export default function removeArgument(fixer, node, sourceCode) {
}
/* c8 ignore end */

return fixer.replaceTextRange([start, end], '');
return fixer.removeRange([start, end]);
}
2 changes: 1 addition & 1 deletion rules/prefer-array-some.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const create = context => {
}

const parenthesizedRange = getParenthesizedRange(callExpression, context.sourceCode);
yield fixer.replaceTextRange([parenthesizedRange[1], callExpression.parent.range[1]], '');
yield fixer.removeRange([parenthesizedRange[1], callExpression.parent.range[1]]);

if (callExpression.parent.operator === '!=' || callExpression.parent.operator === '!==') {
return;
Expand Down
2 changes: 1 addition & 1 deletion rules/prefer-object-from-entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function fixReduceAssignOrSpread({sourceCode, callExpression, property}) {
const startToken = sourceCode.getTokenBefore(firstToken);
const [start] = startToken.range;
const [, end] = lastToken.range;
return fixer.replaceTextRange([start, end], '');
return fixer.removeRange([start, end]);
};

function * removeFirstParameter(fixer) {
Expand Down
2 changes: 1 addition & 1 deletion rules/prefer-spread.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function fixConcat(node, sourceCode, fixableArguments) {
const [leadingSpaces] = textAfter.match(/^\s*/);
end += leadingSpaces.length;

return fixer.replaceTextRange([start, end], '');
return fixer.removeRange([start, end]);
}

return function * (fixer) {
Expand Down
4 changes: 2 additions & 2 deletions rules/prefer-switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ function fix({discriminant, ifStatements}, sourceCode, options) {
if (alternate) {
const [, start] = consequent.range;
const [end] = alternate.range;
yield fixer.replaceTextRange([start, end], '');
yield fixer.removeRange([start, end]);
}

yield fixer.replaceTextRange(headRange, '');
yield fixer.removeRange(headRange);
for (const {left, right} of compareExpressions) {
const node = isSame(left, discriminant) ? right : left;
const text = sourceCode.getText(node);
Expand Down

0 comments on commit 59603d9

Please sign in to comment.