Skip to content

Commit

Permalink
Fixed column handling of edge cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
bre1470 committed Jul 1, 2020
1 parent 76807c2 commit bea18f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rules/no-highcharts-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module.exports = {

while (regex2.exec(code, regex2.lastIndex)) {

const codeBefore = code.substr(0, regex2.lastIndex - 1);
const codeBefore = code.substr(0, regex2.lastIndex - 12);
const linesBefore = codeBefore.split('\n');
const line = linesBefore[linesBefore.length - 1];

Expand All @@ -59,7 +59,7 @@ module.exports = {

const loc = {
line: linesBefore.length,
column: line.length - 11
column: line.length
};

context.report({
Expand Down

0 comments on commit bea18f9

Please sign in to comment.