Skip to content

Commit

Permalink
fix(eslint): do not remove space around
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Feb 2, 2023
1 parent b4e0587 commit b8630cd
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/eslint-plugin/src/rules/order-attributify.ts
Expand Up @@ -52,13 +52,8 @@ export default ESLintUtils.RuleCreator(name => name)({
.map((i: TSESTree.Node) => [i.range[0] - offset, i.range[1] - offset] as const)
.sort((a: any, b: any) => b[0] - a[0])

for (let [start, end] of sortedNodes.slice(1)) {
if (code[start - 1] === ' ')
start--
if (code[end] === ' ')
end++
for (const [start, end] of sortedNodes.slice(1))
s.remove(start, end)
}

s.overwrite(sortedNodes[0][0], sortedNodes[0][1], ` ${sorted.trim()} `)

Expand Down

0 comments on commit b8630cd

Please sign in to comment.