You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2021/01/08 05:55:21 UTC

[incubator-echarts] 01/01: fix: fix unexpected global name usage #13983.

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch fix-unexpected-global-name
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit 6d4fe65b7fd198b3fb125ea68e1bc9d826858e5c
Author: pissang <bm...@gmail.com>
AuthorDate: Fri Jan 8 13:54:31 2021 +0800

    fix: fix unexpected global name usage #13983.
    
    add no-restricted-globals rule
---
 .eslintrc-common.yaml | 12 +++++++++++-
 src/data/Source.ts    |  2 +-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/.eslintrc-common.yaml b/.eslintrc-common.yaml
index d0fe9be..081c0bf 100644
--- a/.eslintrc-common.yaml
+++ b/.eslintrc-common.yaml
@@ -216,4 +216,14 @@ rules:
         -
             vars: "local"
             args: "none"
-    "@typescript-eslint/no-redeclare": 2
\ No newline at end of file
+    # Avoid dangerous usage of globals.
+    "no-restricted-globals":
+        - 2
+        - "event"
+        - "name"
+        - "length"
+        - "orientation"
+        - "top"
+        - "parent"
+        - "location"
+        - "closed"
\ No newline at end of file
diff --git a/src/data/Source.ts b/src/data/Source.ts
index 5fb0c1e..bedebb1 100644
--- a/src/data/Source.ts
+++ b/src/data/Source.ts
@@ -471,7 +471,7 @@ function normalizeDimensionsOption(dimensionsDefine: DimensionDefinitionLoose[])
         // User can set null in dimensions.
         // We dont auto specify name, othewise a given name may
         // cause it be refered unexpectedly.
-        if (name == null) {
+        if (item.name == null) {
             return item;
         }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org