Skip to content

Commit

Permalink
Fix operator-no-newline-before end positions (#937)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Dec 20, 2023
1 parent b641a06 commit 201166d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/rules/operator-no-newline-before/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ testRule({
description: "Newline-indentation-operator: 10px\\n + 1.",
message: messages.rejected("+"),
line: 4,
column: 9
column: 9,
endLine: 4,
endColumn: 10
},
{
code: `
Expand Down
4 changes: 3 additions & 1 deletion src/rules/operator-no-newline-before/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ function checkNewlineBefore({
}

if (newLineBefore) {
const index = globalIndex + startIndex;
utils.report({
ruleName,
result,
node,
message: messages.rejected(symbol),
index: endIndex + globalIndex
index,
endIndex: index + symbol.length
});
}
}
Expand Down

0 comments on commit 201166d

Please sign in to comment.