Skip to content

Commit 495b086

Browse files
authoredOct 7, 2024··
chore(eslint-plugin-query): change naming for text variables (#8135)
1 parent 2fe16e5 commit 495b086

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed
 

‎packages/eslint-plugin-query/src/rules/infinite-query-property-order/infinite-query-property-order.rule.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -86,26 +86,28 @@ export const rule = createRule({
8686
fix(fixer) {
8787
const sourceCode = context.sourceCode
8888

89-
const text = sortedProperties.reduce(
89+
const reorderedText = sortedProperties.reduce(
9090
(sourceText, specifier, index) => {
91-
let text = ''
91+
let textBetweenProperties = ''
9292
if (index < allProperties.length - 1) {
93-
text = sourceCode
93+
textBetweenProperties = sourceCode
9494
.getText()
9595
.slice(
9696
allProperties[index]!.range[1],
9797
allProperties[index + 1]!.range[0],
9898
)
9999
}
100100
return (
101-
sourceText + sourceCode.getText(specifier.property) + text
101+
sourceText +
102+
sourceCode.getText(specifier.property) +
103+
textBetweenProperties
102104
)
103105
},
104106
'',
105107
)
106108
return fixer.replaceTextRange(
107109
[allProperties[0]!.range[0], allProperties.at(-1)!.range[1]],
108-
text,
110+
reorderedText,
109111
)
110112
},
111113
})

0 commit comments

Comments
 (0)
Please sign in to comment.