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 2020/03/26 20:05:20 UTC
[incubator-echarts] branch next updated: ts: tweak const lint rule
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
The following commit(s) were added to refs/heads/next by this push:
new 1637e79 ts: tweak const lint rule
1637e79 is described below
commit 1637e79475da3efc0f7f55a8822ce974f87369ab
Author: 100pah <su...@gmail.com>
AuthorDate: Fri Mar 27 04:04:31 2020 +0800
ts: tweak const lint rule
---
extension-src/.eslintrc.yaml | 5 +----
src/.eslintrc.yaml | 5 +----
src/model/Series.ts | 4 ++--
src/stream/Scheduler.ts | 4 ++--
4 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/extension-src/.eslintrc.yaml b/extension-src/.eslintrc.yaml
index 1a7f6e0..5667b9c 100644
--- a/extension-src/.eslintrc.yaml
+++ b/extension-src/.eslintrc.yaml
@@ -24,10 +24,7 @@ rules:
no-constant-condition: 0
comma-dangle: 2
no-debugger: 2
- prefer-const:
- - 1
- -
- ignoreReadBeforeAssign: true
+ prefer-const: 1
no-dupe-keys: 2
no-empty-character-class: 2
no-ex-assign: 2
diff --git a/src/.eslintrc.yaml b/src/.eslintrc.yaml
index c2c425b..fe91738 100644
--- a/src/.eslintrc.yaml
+++ b/src/.eslintrc.yaml
@@ -33,10 +33,7 @@ rules:
allow:
- "warn"
- "error"
- prefer-const:
- - 1
- -
- ignoreReadBeforeAssign: true
+ prefer-const: 1
no-constant-condition: 0
comma-dangle: 2
no-debugger: 2
diff --git a/src/model/Series.ts b/src/model/Series.ts
index e6c97f2..9c898df 100644
--- a/src/model/Series.ts
+++ b/src/model/Series.ts
@@ -452,8 +452,8 @@ class SeriesModel<Opt extends SeriesOption = SeriesOption> extends ComponentMode
};
}
- let data = this.getData();
- let tooltipDims = data.mapDimension('defaultedTooltip', true);
+ const data = this.getData();
+ const tooltipDims = data.mapDimension('defaultedTooltip', true);
const tooltipDimLen = tooltipDims.length;
const value = this.getRawValue(dataIndex) as any;
const isValueArr = zrUtil.isArray(value);
diff --git a/src/stream/Scheduler.ts b/src/stream/Scheduler.ts
index 20de230..b5759b4 100644
--- a/src/stream/Scheduler.ts
+++ b/src/stream/Scheduler.ts
@@ -651,8 +651,8 @@ function detectSeriseType(legacyFunc: StageHandlerOverallReset): string {
return seriesType;
}
-let ecModelMock: GlobalModel = {} as GlobalModel;
-let apiMock: ExtensionAPI = {} as ExtensionAPI;
+const ecModelMock: GlobalModel = {} as GlobalModel;
+const apiMock: ExtensionAPI = {} as ExtensionAPI;
let seriesType;
mockMethods(ecModelMock, GlobalModel);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org