Skip to content

Commit

Permalink
Fix behavior when endColumn or endLine is null
Browse files Browse the repository at this point in the history
  • Loading branch information
mattlyons0 committed Jan 7, 2019
1 parent d58732b commit d3d5938
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export async function processESLintMessages(messages, textEditor, showRule) {
keep doing so in later uses.
*/
const msgLine = line - 1
if (typeof endColumn !== 'undefined' && typeof endLine !== 'undefined') {
if (typeof endColumn === 'number' && typeof endLine === 'number') {
eslintFullRange = true
// Here we always want the column to be a number
msgCol = Math.max(0, column - 1)
Expand All @@ -283,7 +283,7 @@ export async function processESLintMessages(messages, textEditor, showRule) {
} else {
// We want msgCol to remain undefined if it was initially so
// `generateRange` will give us a range over the entire line
msgCol = typeof column !== 'undefined' ? column - 1 : column
msgCol = typeof column === 'number' ? column - 1 : column
}

let ret = {
Expand Down

0 comments on commit d3d5938

Please sign in to comment.