Skip to content

Commit

Permalink
fix: extra line number
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjiaxuan committed Mar 22, 2023
1 parent aa0c646 commit 186c692
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 186c692

Please sign in to comment.