You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2022/09/25 13:35:56 UTC

[echarts] 01/03: style(lint): fix spacing issues

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

wangzx pushed a commit to branch fix-lint
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit bc32dc4e273d5bb8c7ac5c12c3ac7a58e931cd68
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Sun Sep 25 21:26:19 2022 +0800

    style(lint): fix spacing issues
---
 .huskyrc                                |  2 +-
 src/chart/bar/BaseBarSeries.ts          |  4 ++--
 src/chart/line/helper.ts                |  4 ++--
 src/chart/map/MapSeries.ts              |  2 +-
 src/chart/sankey/sankeyLayout.ts        |  2 +-
 src/chart/tree/TreeSeries.ts            |  2 +-
 src/chart/treemap/TreemapSeries.ts      |  4 ++--
 src/component/dataZoom/DataZoomModel.ts |  2 +-
 src/component/legend/LegendView.ts      |  2 +-
 src/component/marker/MarkAreaView.ts    | 14 +++++++-------
 src/component/marker/MarkLineModel.ts   |  2 +-
 src/component/marker/MarkPointModel.ts  |  4 ++--
 src/component/marker/markerHelper.ts    |  2 +-
 src/coord/cartesian/Grid.ts             |  4 ++--
 src/coord/geo/GeoModel.ts               |  4 ++--
 src/coord/geo/GeoSVGResource.ts         |  2 +-
 src/coord/geo/fix/textCoord.ts          |  2 +-
 17 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/.huskyrc b/.huskyrc
index 92e4551cb..3f05f5dba 100644
--- a/.huskyrc
+++ b/.huskyrc
@@ -1,5 +1,5 @@
 {
   "hooks": {
-    "pre-commit": "npm run lint && npm run checktype",
+    "pre-commit": "npm run lint && npm run checktype"
   }
 }
diff --git a/src/chart/bar/BaseBarSeries.ts b/src/chart/bar/BaseBarSeries.ts
index e21d96830..cfbb81ee7 100644
--- a/src/chart/bar/BaseBarSeries.ts
+++ b/src/chart/bar/BaseBarSeries.ts
@@ -92,11 +92,11 @@ class BaseBarSeriesModel<Opts extends BaseBarSeriesOption<unknown> = BaseBarSeri
             const pt = coordSys.dataToPoint(coordSys.clampData(value));
             if (startingAtTick) {
                 each(coordSys.getAxes(), function (axis: Axis2D, idx: number) {
-                    //If axis type is category, use tick coords instead
+                    // If axis type is category, use tick coords instead
                     if (axis.type === 'category') {
                         const tickCoords = axis.getTicksCoords();
                         let tickIdx = coordSys.clampData(value)[idx];
-                        //The index of rightmost tick of markArea is 1 larger than x1/y1 index
+                        // The index of rightmost tick of markArea is 1 larger than x1/y1 index
                         if (dims && (dims[idx] === 'x1' || dims[idx] === 'y1')) {
                             tickIdx += 1;
                         }
diff --git a/src/chart/line/helper.ts b/src/chart/line/helper.ts
index c9ebef65e..13a1c2c01 100644
--- a/src/chart/line/helper.ts
+++ b/src/chart/line/helper.ts
@@ -58,11 +58,11 @@ export function prepareDataCoordInfo(
 
     let stacked = false;
     const stackResultDim = data.getCalculationInfo('stackResultDimension');
-    if (isDimensionStacked(data, dims[0] /*, dims[1]*/)) { // jshint ignore:line
+    if (isDimensionStacked(data, dims[0] /* , dims[1] */)) { // jshint ignore:line
         stacked = true;
         dims[0] = stackResultDim;
     }
-    if (isDimensionStacked(data, dims[1] /*, dims[0]*/)) { // jshint ignore:line
+    if (isDimensionStacked(data, dims[1] /* , dims[0] */)) { // jshint ignore:line
         stacked = true;
         dims[1] = stackResultDim;
     }
diff --git a/src/chart/map/MapSeries.ts b/src/chart/map/MapSeries.ts
index acca989f1..c65aa6bfb 100644
--- a/src/chart/map/MapSeries.ts
+++ b/src/chart/map/MapSeries.ts
@@ -286,7 +286,7 @@ class MapSeries extends SeriesModel<MapSeriesOption> {
         // for geoJSON source: 0.75.
         aspectScale: null,
 
-        ///// Layout with center and size
+        // Layout with center and size
         // If you wan't to put map in a fixed size box with right aspect ratio
         // This two properties may more conveninet
         // layoutCenter: [50%, 50%]
diff --git a/src/chart/sankey/sankeyLayout.ts b/src/chart/sankey/sankeyLayout.ts
index c4343694b..0ae24df1c 100644
--- a/src/chart/sankey/sankeyLayout.ts
+++ b/src/chart/sankey/sankeyLayout.ts
@@ -122,7 +122,7 @@ function computeNodeBreadths(
     const remainEdges = [];
     // Storage each node's indegree.
     const indegreeArr = [];
-    //Used to storage the node with indegree is equal to 0.
+    // Used to storage the node with indegree is equal to 0.
     let zeroIndegrees: GraphNode[] = [];
     let nextTargetNode: GraphNode[] = [];
     let x = 0;
diff --git a/src/chart/tree/TreeSeries.ts b/src/chart/tree/TreeSeries.ts
index 659dfc16c..245bf91dc 100644
--- a/src/chart/tree/TreeSeries.ts
+++ b/src/chart/tree/TreeSeries.ts
@@ -146,7 +146,7 @@ class TreeSeriesModel extends SeriesModel<TreeSeriesOption> {
      */
     getInitialData(option: TreeSeriesOption): SeriesData {
 
-        //create an virtual root
+        // create a virtual root
         const root: TreeSeriesNodeItemOption = {
             name: option.name,
             children: option.data
diff --git a/src/chart/treemap/TreemapSeries.ts b/src/chart/treemap/TreemapSeries.ts
index 2e5f22835..9207d88f1 100644
--- a/src/chart/treemap/TreemapSeries.ts
+++ b/src/chart/treemap/TreemapSeries.ts
@@ -265,14 +265,14 @@ class TreemapSeriesModel extends SeriesModel<TreemapSeriesOption> {
             // bottom
             emptyItemWidth: 25,             // Width of empty node.
             itemStyle: {
-                color: 'rgba(0,0,0,0.7)', //'#5793f3',
+                color: 'rgba(0,0,0,0.7)', // '#5793f3',
                 textStyle: {
                     color: '#fff'
                 }
             },
             emphasis: {
                 itemStyle: {
-                    color: 'rgba(0,0,0,0.9)' //'#5793f3',
+                    color: 'rgba(0,0,0,0.9)' // '#5793f3',
                 }
             }
         },
diff --git a/src/component/dataZoom/DataZoomModel.ts b/src/component/dataZoom/DataZoomModel.ts
index 12382f3ef..bcaae6a10 100644
--- a/src/component/dataZoom/DataZoomModel.ts
+++ b/src/component/dataZoom/DataZoomModel.ts
@@ -234,7 +234,7 @@ class DataZoomModel<Opts extends DataZoomOption = DataZoomOption> extends Compon
     mergeOption(newOption: Opts): void {
         const inputRawOption = retrieveRawOption(newOption);
 
-        //FIX #2591
+        // FIX #2591
         merge(this.option, newOption, true);
         merge(this.settledOption, inputRawOption, true);
 
diff --git a/src/component/legend/LegendView.ts b/src/component/legend/LegendView.ts
index 6e6c9ceb8..12ffaa198 100644
--- a/src/component/legend/LegendView.ts
+++ b/src/component/legend/LegendView.ts
@@ -510,7 +510,7 @@ class LegendView extends ComponentView {
                 contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;
             }
 
-            //Always align selector to content as 'middle'
+            // Always align selector to content as 'middle'
             selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;
             selectorGroup.x = selectorPos[0];
             selectorGroup.y = selectorPos[1];
diff --git a/src/component/marker/MarkAreaView.ts b/src/component/marker/MarkAreaView.ts
index 801a74b6a..9b2476d36 100644
--- a/src/component/marker/MarkAreaView.ts
+++ b/src/component/marker/MarkAreaView.ts
@@ -133,11 +133,11 @@ function markAreaFilter(coordSys: CoordinateSystem, item: MarkAreaMergedItemOpti
         ) {
             return true;
         }
-        //Directly returning true may also do the work,
-        //because markArea will not be shown automatically
-        //when it's not included in coordinate system.
-        //But filtering ahead can avoid keeping rendering markArea
-        //when there are too many of them.
+        // Directly returning true may also do the work,
+        // because markArea will not be shown automatically
+        // when it's not included in coordinate system.
+        // But filtering ahead can avoid keeping rendering markArea
+        // when there are too many of them.
         return markerHelper.zoneFilter(coordSys, item0, item1);
     }
     return markerHelper.dataFilter(coordSys, item0)
@@ -164,8 +164,8 @@ function getSingleMarkerEndPoint(
     else {
         // Chart like bar may have there own marker positioning logic
         if (seriesModel.getMarkerPosition) {
-            //Consider the case that user input the right-bottom point first
-            //Pick the larger x and y as 'x1' and 'y1'
+            // Consider the case that user input the right-bottom point first
+            // Pick the larger x and y as 'x1' and 'y1'
             const pointValue0 = data.getValues(['x0', 'y0'], idx);
             const pointValue1 = data.getValues(['x1', 'y1'], idx);
             const clampPointValue0 = coordSys.clampData(pointValue0);
diff --git a/src/component/marker/MarkLineModel.ts b/src/component/marker/MarkLineModel.ts
index c10025c64..903f196ec 100644
--- a/src/component/marker/MarkLineModel.ts
+++ b/src/component/marker/MarkLineModel.ts
@@ -118,7 +118,7 @@ class MarkLineModel extends MarkerModel<MarkLineOption> {
         symbol: ['circle', 'arrow'],
         symbolSize: [8, 16],
 
-        //symbolRotate: 0,
+        // symbolRotate: 0,
         symbolOffset: 0,
 
         precision: 2,
diff --git a/src/component/marker/MarkPointModel.ts b/src/component/marker/MarkPointModel.ts
index 4a4a67a1a..1b672317c 100644
--- a/src/component/marker/MarkPointModel.ts
+++ b/src/component/marker/MarkPointModel.ts
@@ -73,8 +73,8 @@ class MarkPointModel extends MarkerModel<MarkPointOption> {
         z: 5,
         symbol: 'pin',
         symbolSize: 50,
-        //symbolRotate: 0,
-        //symbolOffset: [0, 0]
+        // symbolRotate: 0,
+        // symbolOffset: [0, 0]
         tooltip: {
             trigger: 'item'
         },
diff --git a/src/component/marker/markerHelper.ts b/src/component/marker/markerHelper.ts
index 1616df422..8da0f9dc0 100644
--- a/src/component/marker/markerHelper.ts
+++ b/src/component/marker/markerHelper.ts
@@ -61,7 +61,7 @@ function markerTypeCalculatorWithExtent(
 ): [ParsedValue[], ParsedValue] {
     const coordArr: ParsedValue[] = [];
 
-    const stacked = isDimensionStacked(data, targetDataDim /*, otherDataDim*/);
+    const stacked = isDimensionStacked(data, targetDataDim /* , otherDataDim */);
     const calcDataDim = stacked
         ? data.getCalculationInfo('stackResultDimension')
         : targetDataDim;
diff --git a/src/coord/cartesian/Grid.ts b/src/coord/cartesian/Grid.ts
index 691effdd0..d22ddef55 100644
--- a/src/coord/cartesian/Grid.ts
+++ b/src/coord/cartesian/Grid.ts
@@ -369,7 +369,7 @@ class Grid implements CoordinateSystemMaster {
             y: 0
         };
 
-        /// Create axis
+        // Create axis
         ecModel.eachComponent('xAxis', createAxisCreator('x'), this);
         ecModel.eachComponent('yAxis', createAxisCreator('y'), this);
 
@@ -382,7 +382,7 @@ class Grid implements CoordinateSystemMaster {
 
         this._axesMap = axesMap;
 
-        /// Create cartesian2d
+        // Create cartesian2d
         each(axesMap.x, (xAxis, xAxisIndex) => {
             each(axesMap.y, (yAxis, yAxisIndex) => {
                 const key = 'x' + xAxisIndex + 'y' + yAxisIndex;
diff --git a/src/coord/geo/GeoModel.ts b/src/coord/geo/GeoModel.ts
index 796f77282..e22d29454 100644
--- a/src/coord/geo/GeoModel.ts
+++ b/src/coord/geo/GeoModel.ts
@@ -81,7 +81,7 @@ export interface GeoCommonOptionMixin extends RoamOptionMixin {
     // This parameter is used for scale this aspect
     aspectScale?: number;
 
-    ///// Layout with center and size
+    // Layout with center and size
     // If you wan't to put map in a fixed size box with right aspect ratio
     // This two properties may more conveninet
     // Like: `40` or `'50%'`.
@@ -156,7 +156,7 @@ class GeoModel extends ComponentModel<GeoOption> {
         // for geoJSON source: 0.75.
         aspectScale: null,
 
-        ///// Layout with center and size
+        // /// Layout with center and size
         // If you wan't to put map in a fixed size box with right aspect ratio
         // This two properties may more conveninet
         // layoutCenter: [50%, 50%]
diff --git a/src/coord/geo/GeoSVGResource.ts b/src/coord/geo/GeoSVGResource.ts
index e0e6d5900..56ed4f50f 100644
--- a/src/coord/geo/GeoSVGResource.ts
+++ b/src/coord/geo/GeoSVGResource.ts
@@ -267,7 +267,7 @@ export class GeoSVGResource implements GeoResource {
      * So we maintain graphic elements in this module, and enables `view` to use/return these
      * graphics from/to the pool with it's uid.
      */
-    useGraphic(hostKey: string /*, nameMap: NameMap */): GeoSVGGraphicRecord {
+    useGraphic(hostKey: string /* , nameMap: NameMap */): GeoSVGGraphicRecord {
         const usedRootMap = this._usedGraphicMap;
 
         let svgGraphic = usedRootMap.get(hostKey);
diff --git a/src/coord/geo/fix/textCoord.ts b/src/coord/geo/fix/textCoord.ts
index 813e26a44..3c9647bc1 100644
--- a/src/coord/geo/fix/textCoord.ts
+++ b/src/coord/geo/fix/textCoord.ts
@@ -26,7 +26,7 @@ const coordsOffsetMap = {
     '广东': [0, -10],
     '香港': [10, 5],
     '澳门': [-10, 10],
-    //'北京': [-10, 0],
+    // '北京': [-10, 0],
     '天津': [5, 5]
 } as Dictionary<number[]>;
 


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