Skip to content

Commit d897f6b

Browse files
committed
lint
1 parent 96eaeaa commit d897f6b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rule.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import * as os from 'os'
99
import * as path from 'path'
1010
import {dependencies} from './dependencies'
1111
import * as presetsModule from './presets'
12-
import {equivalentSimplified} from './simplify'
1312

1413
export const codegen: eslint.Rule.RuleModule = {
1514
// @ts-expect-error types are wrong?
@@ -215,14 +214,15 @@ export const codegen: eslint.Rule.RuleModule = {
215214
return
216215
}
217216

218-
const patch = diff.createPatch(context.physicalFilename, existingContent, result.right)
217+
const patch = diff.createPatch(context.physicalFilename, existingContent.trimEnd(), result.right.trimEnd())
219218
for (const parsedPatch of diff.parsePatch(patch)) {
220219
for (const hunk of parsedPatch.hunks) {
221220
let message = `Content doesn't match:\n`
222221
message += hunk.lines.join('\n')
223222
const startPosition = position(range[0])
224223

225-
const fix: Parameters<typeof context.report>[0]['fix'] = fixer => fixer.replaceTextRange(range, normalise(result.right) + os.EOL)
224+
const fix: Parameters<typeof context.report>[0]['fix'] = fixer =>
225+
fixer.replaceTextRange(range, normalise(result.right) + os.EOL)
226226
context.report({
227227
message,
228228
loc: {

0 commit comments

Comments
 (0)