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/20 23:48:21 UTC

[incubator-echarts] 03/04: ts: tweak lint

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

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

commit 198ccdb4d45dba67c5194dbe69d8fc48d823107f
Author: 100pah <su...@gmail.com>
AuthorDate: Sat Mar 21 07:19:23 2020 +0800

    ts: tweak lint
---
 src/chart/bar/BarView.ts                       | 12 ++++++------
 src/chart/graph/GraphSeries.ts                 |  4 ++--
 src/chart/sunburst/SunburstPiece.ts            |  2 +-
 src/chart/treemap/treemapVisual.ts             |  2 +-
 src/component/axisPointer/SingleAxisPointer.ts |  2 +-
 src/component/axisPointer/axisTrigger.ts       |  2 +-
 src/component/calendar/CalendarView.ts         |  4 ++--
 src/component/dataZoom/roams.ts                |  2 +-
 src/component/helper/RoamController.ts         |  2 +-
 src/component/legend/ScrollableLegendModel.ts  |  5 ++---
 src/component/toolbox/feature/DataZoom.ts      |  2 +-
 src/component/toolbox/feature/SaveAsImage.ts   |  2 +-
 src/component/visualMap/ContinuousView.ts      |  2 +-
 src/data/Graph.ts                              |  4 ++--
 src/model/Global.ts                            |  2 +-
 src/stream/Scheduler.ts                        |  4 ++--
 src/util/symbol.ts                             |  2 +-
 17 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/src/chart/bar/BarView.ts b/src/chart/bar/BarView.ts
index 9ef7ce3..4fee71c 100644
--- a/src/chart/bar/BarView.ts
+++ b/src/chart/bar/BarView.ts
@@ -81,16 +81,16 @@ function getClipArea(coord: CoordSysOfBar, data: List) {
 
 
 class BarView extends ChartView {
-    static type = 'bar' as const
-    type = BarView.type
+    static type = 'bar' as const;
+    type = BarView.type;
 
-    _data: List
+    _data: List;
 
-    _isLargeDraw: boolean
+    _isLargeDraw: boolean;
 
-    _backgroundGroup: Group
+    _backgroundGroup: Group;
 
-    _backgroundEls: (Rect | Sector)[]
+    _backgroundEls: (Rect | Sector)[];
 
     render(seriesModel: BarSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {
         this._updateDrawMode(seriesModel);
diff --git a/src/chart/graph/GraphSeries.ts b/src/chart/graph/GraphSeries.ts
index 5c5e152..e2366e9 100644
--- a/src/chart/graph/GraphSeries.ts
+++ b/src/chart/graph/GraphSeries.ts
@@ -219,9 +219,9 @@ class GraphSeriesModel extends SeriesModel<GraphSeriesOption> {
     /**
      * Preserved points during layouting
      */
-    preservedPoints?: Dictionary<VectorArray>
+    preservedPoints?: Dictionary<VectorArray>;
 
-    forceLayout?: ForceLayoutInstance
+    forceLayout?: ForceLayoutInstance;
 
     init(option: GraphSeriesOption) {
         super.init.apply(this, arguments as any);
diff --git a/src/chart/sunburst/SunburstPiece.ts b/src/chart/sunburst/SunburstPiece.ts
index 2017514..2e7b3d1 100644
--- a/src/chart/sunburst/SunburstPiece.ts
+++ b/src/chart/sunburst/SunburstPiece.ts
@@ -313,7 +313,7 @@ class SunburstPiece extends graphic.Group {
         }
         label.attr('rotation', rotate);
 
-        type LabelOption = SunburstSeriesNodeOption['label']
+        type LabelOption = SunburstSeriesNodeOption['label'];
         function getLabelAttr<T extends keyof LabelOption>(name: T): LabelOption[T] {
             var stateAttr = labelModel.get(name);
             if (stateAttr == null) {
diff --git a/src/chart/treemap/treemapVisual.ts b/src/chart/treemap/treemapVisual.ts
index 20f9bb8..88c009a 100644
--- a/src/chart/treemap/treemapVisual.ts
+++ b/src/chart/treemap/treemapVisual.ts
@@ -26,7 +26,7 @@ import { ColorString, ZRColor } from '../../util/types';
 import { modifyHSL, modifyAlpha } from 'zrender/src/tool/color';
 import { makeInner } from '../../util/model';
 
-type NodeModel = Model<TreemapSeriesNodeItemOption>
+type NodeModel = Model<TreemapSeriesNodeItemOption>;
 type NodeItemStyleModel = Model<TreemapSeriesNodeItemOption['itemStyle']>;
 
 const ITEM_STYLE_NORMAL = 'itemStyle';
diff --git a/src/component/axisPointer/SingleAxisPointer.ts b/src/component/axisPointer/SingleAxisPointer.ts
index 2037823..b3b5a79 100644
--- a/src/component/axisPointer/SingleAxisPointer.ts
+++ b/src/component/axisPointer/SingleAxisPointer.ts
@@ -34,7 +34,7 @@ const XY = ['x', 'y'] as const;
 const WH = ['width', 'height'] as const;
 
 // Not use top level axisPointer model
-type AxisPointerModel = Model<CommonAxisPointerOption>
+type AxisPointerModel = Model<CommonAxisPointerOption>;
 
 class SingleAxisPointer extends BaseAxisPointer {
 
diff --git a/src/component/axisPointer/axisTrigger.ts b/src/component/axisPointer/axisTrigger.ts
index ef03e9c..f41117e 100644
--- a/src/component/axisPointer/axisTrigger.ts
+++ b/src/component/axisPointer/axisTrigger.ts
@@ -100,7 +100,7 @@ interface AxisTriggerPayload extends Payload {
 type ShowValueMap = Dictionary<{
     value: AxisValue
     payloadBatch: BatchItem[]
-}>
+}>;
 
 /**
  * Basic logic: check all axis, if they do not demand show/highlight,
diff --git a/src/component/calendar/CalendarView.ts b/src/component/calendar/CalendarView.ts
index e3a7639..c153b38 100644
--- a/src/component/calendar/CalendarView.ts
+++ b/src/component/calendar/CalendarView.ts
@@ -67,12 +67,12 @@ class CalendarView extends ComponentView {
     /**
      * first day of month
      */
-    private _firstDayOfMonth: CalendarParsedDateInfo[]
+    private _firstDayOfMonth: CalendarParsedDateInfo[];
 
     /**
      * first day point of month
      */
-    private _firstDayPoints: number[][]
+    private _firstDayPoints: number[][];
 
     render(calendarModel: CalendarModel, ecModel: GlobalModel, api: ExtensionAPI) {
 
diff --git a/src/component/dataZoom/roams.ts b/src/component/dataZoom/roams.ts
index d8d1948..417aaad 100644
--- a/src/component/dataZoom/roams.ts
+++ b/src/component/dataZoom/roams.ts
@@ -58,7 +58,7 @@ interface PayloadBatch {
     dataZoomId: string
 }
 
-type Store = Dictionary<Record>
+type Store = Dictionary<Record>;
 
 const inner = makeInner<Store, ExtensionAPI>();
 
diff --git a/src/component/helper/RoamController.ts b/src/component/helper/RoamController.ts
index 33f840d..3ff8a7c 100644
--- a/src/component/helper/RoamController.ts
+++ b/src/component/helper/RoamController.ts
@@ -27,7 +27,7 @@ import Group from 'zrender/src/container/Group';
 
 // Can be null/undefined or true/false
 // or 'pan/move' or 'zoom'/'scale'
-export type RoamType = RoamOptionMixin['roam']
+export type RoamType = RoamOptionMixin['roam'];
 
 interface RoamOption {
     zoomOnMouseWheel?: boolean | 'ctrl' | 'shift' | 'alt'
diff --git a/src/component/legend/ScrollableLegendModel.ts b/src/component/legend/ScrollableLegendModel.ts
index 51a5313..b9ed1d2 100644
--- a/src/component/legend/ScrollableLegendModel.ts
+++ b/src/component/legend/ScrollableLegendModel.ts
@@ -26,7 +26,6 @@ import { ZRColor, LabelOption } from '../../util/types';
 import Model from '../../model/Model';
 import ComponentModel from '../../model/Component';
 import GlobalModel from '../../model/Global';
-import * as zrUtil from 'zrender/src/core/util';
 import { inheritDefaultOption } from '../../util/component';
 
 export interface ScrollableLegendOption extends LegendOption {
@@ -56,8 +55,8 @@ export interface ScrollableLegendOption extends LegendOption {
 
 class ScrollableLegendModel extends LegendModel<ScrollableLegendOption> {
 
-    static type = 'legend.scroll' as const
-    type = ScrollableLegendModel.type
+    static type = 'legend.scroll' as const;
+    type = ScrollableLegendModel.type;
 
     /**
      * @param {number} scrollDataIndex
diff --git a/src/component/toolbox/feature/DataZoom.ts b/src/component/toolbox/feature/DataZoom.ts
index 43cf528..e2b9ef0 100644
--- a/src/component/toolbox/feature/DataZoom.ts
+++ b/src/component/toolbox/feature/DataZoom.ts
@@ -64,7 +64,7 @@ interface ToolboxDataZoomFeatureOption extends ToolboxFeatureOption {
     yAxisIndex?: ModelFinderIndexQuery | false
 }
 
-type ToolboxDataZoomFeatureModel = ToolboxFeatureModel<ToolboxDataZoomFeatureOption>
+type ToolboxDataZoomFeatureModel = ToolboxFeatureModel<ToolboxDataZoomFeatureOption>;
 
 class DataZoomFeature extends ToolboxFeature<ToolboxDataZoomFeatureOption> {
 
diff --git a/src/component/toolbox/feature/SaveAsImage.ts b/src/component/toolbox/feature/SaveAsImage.ts
index d57b299..cef219f 100644
--- a/src/component/toolbox/feature/SaveAsImage.ts
+++ b/src/component/toolbox/feature/SaveAsImage.ts
@@ -108,7 +108,7 @@ class SaveAsImage extends ToolboxFeature<ToolboxSaveAsImageFeatureOption> {
         excludeComponents: ['toolbox'],
         pixelRatio: 1,
         lang: saveAsImageLang.lang.slice()
-    }
+    };
 }
 SaveAsImage.prototype.unusable = !env.canvasSupported;
 
diff --git a/src/component/visualMap/ContinuousView.ts b/src/component/visualMap/ContinuousView.ts
index dab55d7..555c084 100644
--- a/src/component/visualMap/ContinuousView.ts
+++ b/src/component/visualMap/ContinuousView.ts
@@ -60,7 +60,7 @@ type ShapeStorage = {
     indicator: graphic.Polygon
     indicatorLabel: graphic.Text
     indicatorLabelPoint: number[]
-}
+};
 
 type TargetDataIndices = ReturnType<ContinuousModel['findTargetDataIndices']>;
 
diff --git a/src/data/Graph.ts b/src/data/Graph.ts
index ca6ce18..39aec71 100644
--- a/src/data/Graph.ts
+++ b/src/data/Graph.ts
@@ -307,10 +307,10 @@ class Graph {
         var graph = new Graph(this._directed);
         var nodes = this.nodes;
         var edges = this.edges;
-        for (var i = 0; i < nodes.length; i++) {
+        for (let i = 0; i < nodes.length; i++) {
             graph.addNode(nodes[i].id, nodes[i].dataIndex);
         }
-        for (var i = 0; i < edges.length; i++) {
+        for (let i = 0; i < edges.length; i++) {
             var e = edges[i];
             graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);
         }
diff --git a/src/model/Global.ts b/src/model/Global.ts
index 0cb8c62..4a61f1f 100644
--- a/src/model/Global.ts
+++ b/src/model/Global.ts
@@ -654,7 +654,7 @@ class GlobalModel extends Model<ECUnitOption> {
             ecModel.mergeOption(baseOption);
         };
 
-    })()
+    })();
 }
 
 // -----------------------
diff --git a/src/stream/Scheduler.ts b/src/stream/Scheduler.ts
index a99988e..05f3dab 100644
--- a/src/stream/Scheduler.ts
+++ b/src/stream/Scheduler.ts
@@ -131,8 +131,8 @@ class Scheduler {
         // processors might be registered after echarts instance created.
         // Register processors incrementally for a echarts instance is
         // not supported by this stream architecture.
-        var dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();
-        var visualHandlers = this._visualHandlers = visualHandlers.slice();
+        dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();
+        visualHandlers = this._visualHandlers = visualHandlers.slice();
         this._allHandlers = dataProcessorHandlers.concat(visualHandlers);
     }
 
diff --git a/src/util/symbol.ts b/src/util/symbol.ts
index 2a7121a..f9f0c85 100644
--- a/src/util/symbol.ts
+++ b/src/util/symbol.ts
@@ -31,7 +31,7 @@ type ECSymbol = graphic.Path & {
     setColor: (color: ZRColor, innerColor?: string) => void
 };
 type SymbolCtor = { new(): ECSymbol };
-type SymbolShapeMaker = (x: number, y: number, w: number, h: number, shape: Dictionary<any>) => void
+type SymbolShapeMaker = (x: number, y: number, w: number, h: number, shape: Dictionary<any>) => void;
 
 /**
  * Triangle shape


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