From 186c6927c160cf8d216b6cee5c410b7e90f8ee81 Mon Sep 17 00:00:00 2001 From: lvjiaxuan <11309921+lvjiaxuan@users.noreply.github.com> Date: Wed, 22 Mar 2023 17:11:40 +0800 Subject: [PATCH] fix: extra line number --- src/extension.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 26f38f9..501e23c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -33,7 +33,7 @@ const disableForLines = commands.registerCommand('eslint-disable.disable', () => const insertRules = eslintDiagnostics.reduce((insertRules, item) => { const isRuleInLine = selection.isSingleLine ? item.range.start.line === selection.start.line - : selection.start.line + 1 <= item.range.start.line && item.range.start.line <= selection.end.line + 1 + : selection.start.line <= item.range.start.line && item.range.start.line <= selection.end.line if (isRuleInLine) { // @ts-ignore @@ -81,7 +81,7 @@ const disableForFile = commands.registerCommand('eslint-disable.entire', async ( if (!isAlwaysAdd) { isAlwaysAdd = selection.isSingleLine ? item.range.start.line === selection.start.line - : selection.start.line + 1 <= item.range.start.line && item.range.start.line <= selection.end.line + 1 + : selection.start.line <= item.range.start.line && item.range.start.line <= selection.end.line } if (isAlwaysAdd) {