Skip to content

Commit

Permalink
Merge pull request #8 from highcharts/v1.0.5
Browse files Browse the repository at this point in the history
v1.0.5
  • Loading branch information
bre1470 authored Mar 26, 2021
2 parents ce41b48 + a66c709 commit 8bac147
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/rules/no-optional-chaining.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ module.exports = {
//----------------------------------------------------------------------
const program = (node) => {

const match = /\w\?\.\w/.exec(code);
const pattern = /\?\.[\w\[\(]/g;
const match = pattern.exec(code);

if (match) {
const codeBefore = code.substr(0, match.lastIndex + 1);
const codeBefore = code.substr(0, pattern.lastIndex - match[0].length);
const linesBefore = codeBefore.split('\n');
const line = linesBefore[linesBefore.length - 1];

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-highcharts",
"version": "1.0.1",
"version": "1.0.5",
"description": "ESLint rules for the Highcharts project",
"keywords": [
"eslint",
Expand Down

0 comments on commit 8bac147

Please sign in to comment.