From 3c97a3aea60b9995315c90197da514cf3d7b8be2 Mon Sep 17 00:00:00 2001 From: bre1470 <40056287+bre1470@users.noreply.github.com> Date: Wed, 2 Jun 2021 10:45:35 +0200 Subject: [PATCH] Improved rule no-highcharts-object. --- lib/rules/no-highcharts-object.js | 4 ++-- package-lock.json | 2 +- package.json | 12 ++++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/rules/no-highcharts-object.js b/lib/rules/no-highcharts-object.js index a2c6708..2271594 100644 --- a/lib/rules/no-highcharts-object.js +++ b/lib/rules/no-highcharts-object.js @@ -5,7 +5,7 @@ */ 'use strict'; -const message = 'Do not use the global Highcharts object to access utility functions.'; +const message = 'Do not use the global Highcharts object, import Globals instead.'; //------------------------------------------------------------------------------ // Rule Definition @@ -38,7 +38,7 @@ module.exports = { return; } - const regex = /Highcharts\.[a-z]/g; + const regex = /Highcharts([,)\]]|\.[a-z]|\.\w+\()/g; let match; diff --git a/package-lock.json b/package-lock.json index 49f7da9..f4ebc9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-highcharts", - "version": "1.0.6", + "version": "1.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e25cbe1..a503364 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,17 @@ { "name": "eslint-plugin-highcharts", - "version": "1.0.6", + "version": "1.0.7", "description": "ESLint rules for the Highcharts project", "keywords": [ "eslint", "eslintplugin", "eslint-plugin" ], - "author": "Torstein", + "author": "Highsoft AS (http://www.highcharts.com/about)", + "repository": { + "type": "git", + "url": "https://github.com/highcharts/eslint-plugin-highcharts.git" + }, "main": "lib/index.js", "scripts": { "test": "mocha tests --recursive" @@ -16,8 +20,8 @@ "requireindex": "~1.2.0" }, "devDependencies": { - "eslint": "^7.23.0", - "mocha": "^8.3.2" + "eslint": "^7.27.0", + "mocha": "^8.4.0" }, "engines": { "node": ">=0.10.0"