From d3d593803f133db5e29f180ebc7ed6e8ea3c7a38 Mon Sep 17 00:00:00 2001 From: Matt Lyons Date: Mon, 7 Jan 2019 11:15:57 -0500 Subject: [PATCH] Fix behavior when endColumn or endLine is null Fixes #1197, #1196, #1195, #1192 --- src/helpers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers.js b/src/helpers.js index 2b6eac9d..68b3bd3e 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -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) @@ -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 = {