diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 471f1aa7ec..cdd4eec08f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: - name: Collect changed files run: | mkdir ~/tmp/ - git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} --name-only --relative '*src/**/*.ts' > ~/tmp/changed_files + git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} --diff-filter=ACM --name-only --relative '*src/**/*.ts' > ~/tmp/changed_files echo -e "Changed files: \n$(cat ~/tmp/changed_files)" - name: Lint diff --git a/.huskyrc b/.huskyrc index 92e4551cbd..3f05f5dbad 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 e21d968300..cfbb81ee77 100644 --- a/src/chart/bar/BaseBarSeries.ts +++ b/src/chart/bar/BaseBarSeries.ts @@ -92,11 +92,11 @@ class BaseBarSeriesModel = 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/boxplot/boxplotVisual.ts b/src/chart/boxplot/boxplotVisual.ts deleted file mode 100644 index 067738a7b0..0000000000 --- a/src/chart/boxplot/boxplotVisual.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -import GlobalModel from '../../model/Global'; -import ExtensionAPI from '../../core/ExtensionAPI'; -import BoxplotSeriesModel from './BoxplotSeries'; - -export default function boxplotVisual(ecModel: GlobalModel, api: ExtensionAPI) { - -} \ No newline at end of file diff --git a/src/chart/boxplot/install.ts b/src/chart/boxplot/install.ts index e579f296f2..b5a7efcd98 100644 --- a/src/chart/boxplot/install.ts +++ b/src/chart/boxplot/install.ts @@ -20,14 +20,12 @@ import { EChartsExtensionInstallRegisters } from '../../extension'; import BoxplotSeriesModel from './BoxplotSeries'; import BoxplotView from './BoxplotView'; -import boxplotVisual from './boxplotVisual'; import boxplotLayout from './boxplotLayout'; import { boxplotTransform } from './boxplotTransform'; export function install(registers: EChartsExtensionInstallRegisters) { registers.registerSeriesModel(BoxplotSeriesModel); registers.registerChartView(BoxplotView); - registers.registerVisual(boxplotVisual); registers.registerLayout(boxplotLayout); registers.registerTransform(boxplotTransform); -} \ No newline at end of file +} diff --git a/src/chart/graph/GraphView.ts b/src/chart/graph/GraphView.ts index bd5b9669cc..0c6d1e01bc 100644 --- a/src/chart/graph/GraphView.ts +++ b/src/chart/graph/GraphView.ts @@ -17,7 +17,6 @@ * under the License. */ -import * as zrUtil from 'zrender/src/core/util'; import SymbolDraw, { ListForSymbolDraw } from '../helper/SymbolDraw'; import LineDraw from '../helper/LineDraw'; import RoamController, { RoamControllerHost } from '../../component/helper/RoamController'; @@ -307,4 +306,4 @@ class GraphView extends ChartView { } } -export default GraphView; \ No newline at end of file +export default GraphView; diff --git a/src/chart/line/helper.ts b/src/chart/line/helper.ts index c9ebef65e1..13a1c2c01a 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 acca989f1c..c65aa6bfb0 100644 --- a/src/chart/map/MapSeries.ts +++ b/src/chart/map/MapSeries.ts @@ -286,7 +286,7 @@ class MapSeries extends SeriesModel { // 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 c4343694b1..0ae24df1c5 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/sunburst/sunburstLayout.ts b/src/chart/sunburst/sunburstLayout.ts index f84fc3b53e..a45f211c50 100644 --- a/src/chart/sunburst/sunburstLayout.ts +++ b/src/chart/sunburst/sunburstLayout.ts @@ -21,9 +21,8 @@ import { parsePercent } from '../../util/number'; import * as zrUtil from 'zrender/src/core/util'; import GlobalModel from '../../model/Global'; import ExtensionAPI from '../../core/ExtensionAPI'; -import SunburstSeriesModel, { SunburstSeriesNodeItemOption, SunburstSeriesOption } from './SunburstSeries'; +import SunburstSeriesModel, { SunburstSeriesOption } from './SunburstSeries'; import { TreeNode } from '../../data/Tree'; -import SeriesModel from '../../model/Series'; // let PI2 = Math.PI * 2; const RADIAN = Math.PI / 180; diff --git a/src/chart/tree/TreeSeries.ts b/src/chart/tree/TreeSeries.ts index 659dfc16cf..245bf91dc8 100644 --- a/src/chart/tree/TreeSeries.ts +++ b/src/chart/tree/TreeSeries.ts @@ -146,7 +146,7 @@ class TreeSeriesModel extends SeriesModel { */ 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 2e5f22835f..9207d88f18 100644 --- a/src/chart/treemap/TreemapSeries.ts +++ b/src/chart/treemap/TreemapSeries.ts @@ -265,14 +265,14 @@ class TreemapSeriesModel extends SeriesModel { // 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 12382f3ef1..bcaae6a101 100644 --- a/src/component/dataZoom/DataZoomModel.ts +++ b/src/component/dataZoom/DataZoomModel.ts @@ -234,7 +234,7 @@ class DataZoomModel 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 6e6c9ceb8c..12ffaa1980 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 801a74b6ae..9b2476d36a 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 c10025c648..903f196ec8 100644 --- a/src/component/marker/MarkLineModel.ts +++ b/src/component/marker/MarkLineModel.ts @@ -118,7 +118,7 @@ class MarkLineModel extends MarkerModel { 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 4a4a67a1a3..1b672317c7 100644 --- a/src/component/marker/MarkPointModel.ts +++ b/src/component/marker/MarkPointModel.ts @@ -73,8 +73,8 @@ class MarkPointModel extends MarkerModel { 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 1616df4226..8da0f9dc07 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 691effdd0e..d22ddef556 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 796f77282e..e22d294542 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 { // 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 e0e6d5900b..56ed4f50fe 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 813e26a44c..3c9647bc19 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;