Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1416 from AtomLinter/find-eslint-plugins
Browse files Browse the repository at this point in the history
fix: handle prettier line-ending issue
  • Loading branch information
aminya authored Mar 14, 2021
2 parents 6c8d9e8 + 7262ac6 commit c374103
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,19 @@ export async function processESLintMessages(messages, textEditor, showRule) {
ret.url = rules.getRuleUrl(ruleId)
}

// HACK for https://github.com/AtomLinter/linter-eslint/issues/1249
let fixLineEnding = false
if (ruleId === 'prettier/prettier' && (message === 'Delete `␍`')) {
fixLineEnding = true
}

let range
try {
if (eslintFullRange) {
const buffer = textEditor.getBuffer()
throwIfInvalidPoint(buffer, msgLine, msgCol)
throwIfInvalidPoint(buffer, msgEndLine, msgEndCol)
if (!fixLineEnding) {
throwIfInvalidPoint(textBuffer, msgLine, msgCol)
throwIfInvalidPoint(textBuffer, msgEndLine, msgEndCol)
}
range = [[msgLine, msgCol], [msgEndLine, msgEndCol]]
} else {
range = generateRange(textEditor, msgLine, msgCol)
Expand Down

0 comments on commit c374103

Please sign in to comment.