You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2018/09/21 16:58:58 UTC

[incubator-echarts] 03/03: fix: code style and clarify eslint.

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

sushuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit 90696f7f58ecd1192bea14af067d00d438c84051
Author: sushuang <su...@gmail.com>
AuthorDate: Sat Sep 22 00:58:30 2018 +0800

    fix: code style and clarify eslint.
---
 .eslintrc.yaml                   | 59 ++++++++++++++++++++--------------------
 src/chart/funnel/funnelLayout.js |  6 ++--
 2 files changed, 34 insertions(+), 31 deletions(-)

diff --git a/.eslintrc.yaml b/.eslintrc.yaml
index 7d18fe3..32f9d78 100644
--- a/.eslintrc.yaml
+++ b/.eslintrc.yaml
@@ -15,15 +15,15 @@ rules:
             allow:
                 - "warn"
                 - "error"
-    no-constant-condition: 1
+    no-constant-condition: 0
     comma-dangle: 2
     no-debugger: 2
-    no-dupe-keys: 1
+    no-dupe-keys: 2
     no-empty-character-class: 2
     no-ex-assign: 2
-    no-extra-boolean-cast: 1
-    no-func-assign: 1
-    no-inner-declarations: 1
+    no-extra-boolean-cast: 0
+    no-func-assign: 2
+    no-inner-declarations: 2
     no-invalid-regexp: 2
     no-negated-in-lhs: 2
     no-obj-calls: 2
@@ -31,55 +31,56 @@ rules:
     no-unreachable: 2
     use-isnan: 2
     valid-typeof: 2
+    block-scoped-var: 0
     curly:
         - 2
         - "all"
     eqeqeq:
         - 2
         - "allow-null"
-    guard-for-in: 1
+    guard-for-in: 2
     no-else-return: 0
     no-labels:
-        - 1
+        - 2
         -
             allowLoop: true
-    no-eval: 1
+    no-eval: 2
     no-extend-native: 2
-    no-extra-bind: 1
-    no-implied-eval: 1
+    no-extra-bind: 0
+    no-implied-eval: 2
     no-iterator: 2
-    no-irregular-whitespace: 1
-    no-lone-blocks: 1
-    no-loop-func: 1
-    no-multi-str: 1
+    no-irregular-whitespace: 2
+    no-lone-blocks: 2
+    no-loop-func: 2
+    no-multi-str: 2
     no-native-reassign: 2
     no-new-wrappers: 2
-    no-octal: 1
-    no-octal-escape: 1
+    no-octal: 2
+    no-octal-escape: 2
     no-proto: 2
     no-redeclare: 0
     no-self-compare: 2
     no-unneeded-ternary: 2
-    no-with: 1
+    no-with: 2
     radix: 2
     wrap-iife:
         - 2
         - "any"
-    no-delete-var: 1
+    no-delete-var: 2
     no-dupe-args: 2
     no-duplicate-case: 2
-    no-label-var: 1
+    no-label-var: 2
     no-shadow-restricted-names: 2
     no-undef: 2
     no-undef-init: 2
     no-unused-vars:
-        - 1
+        - 2
         -
             vars: "local"
             args: "none"
     no-use-before-define: 0
     brace-style:
-        - 1
+        - 2
         - "stroustrup"
         - {}
     comma-spacing:
@@ -90,7 +91,7 @@ rules:
     comma-style:
         - 2
         - "last"
-    new-parens: 1
+    new-parens: 2
     no-array-constructor: 2
     no-multi-spaces:
         - 2
@@ -138,7 +139,7 @@ rules:
     space-in-parens:
         - 2
         - "never"
-    space-unary-ops: 1
+    space-unary-ops: 2
     spaced-comment: 0
 
     max-nested-callbacks:
@@ -171,14 +172,14 @@ rules:
         - 2
         -
             allowParens: true
-    no-class-assign: 1
+    no-class-assign: 2
     no-const-assign: 2
-    no-dupe-class-members: 1
-    no-this-before-super: 1
+    no-dupe-class-members: 2
+    no-this-before-super: 0
     no-var: 0
-    no-duplicate-imports: 1
+    no-duplicate-imports: 2
     prefer-rest-params: 0
-    unicode-bom: 1
+    unicode-bom: 2
     max-statements-per-line: 2
 
-    no-useless-constructor: 1
\ No newline at end of file
+    no-useless-constructor: 0
\ No newline at end of file
diff --git a/src/chart/funnel/funnelLayout.js b/src/chart/funnel/funnelLayout.js
index 5ac9ba6..ee133c3 100644
--- a/src/chart/funnel/funnelLayout.js
+++ b/src/chart/funnel/funnelLayout.js
@@ -77,11 +77,13 @@ function labelLayout(data) {
                 textX = (points[0][0] + points[3][0]) / 2 + 5;
                 textY = (points[0][1] + points[3][1]) / 2;
                 textAlign = 'left';
-            } else if (labelPosition === 'insideRight') {
+            }
+            else if (labelPosition === 'insideRight') {
                 textX = (points[1][0] + points[2][0]) / 2 - 5;
                 textY = (points[1][1] + points[2][1]) / 2;
                 textAlign = 'right';
-            } else {
+            }
+            else {
                 textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;
                 textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;
                 textAlign = 'center';


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