From 01369e6affbfb1e5795c2b06479bb249c54ccf35 Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Fri, 21 Jul 2023 09:17:42 +0100 Subject: [PATCH] Chore: fix `.eslintignore` to only ignore folder paths at the root (#72032) fix eslintignore to only ignore folder paths at the root --- .betterer.results | 37 ++++++++++++++++++ .eslintignore | 18 ++++----- .../live/data/StreamingDataFrame.test.ts | 1 + .../features/live/data/StreamingDataFrame.ts | 3 +- public/app/features/live/data/utils.ts | 1 + .../geomap/layers/data/dayNightLayer.tsx | 26 ++++++------- .../geomap/layers/data/geojsonDynamic.ts | 35 +++++++++-------- .../panel/geomap/layers/data/geojsonLayer.ts | 33 +++++++++------- .../panel/geomap/layers/data/heatMap.tsx | 11 +++--- .../plugins/panel/geomap/layers/data/index.ts | 8 ++-- .../geomap/layers/data/lastPointTracker.ts | 9 +++-- .../panel/geomap/layers/data/markersLayer.tsx | 18 +++++---- .../panel/geomap/layers/data/photosLayer.tsx | 17 ++++---- .../panel/geomap/layers/data/routeLayer.tsx | 39 +++++++++---------- 14 files changed, 153 insertions(+), 103 deletions(-) diff --git a/.betterer.results b/.betterer.results index b19bf8a9210..8bbd416ff1b 100644 --- a/.betterer.results +++ b/.betterer.results @@ -2682,6 +2682,23 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], + "public/app/features/live/data/StreamingDataFrame.ts:5381": [ + [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "Do not use any type assertions.", "1"], + [0, 0, 0, "Do not use any type assertions.", "2"], + [0, 0, 0, "Do not use any type assertions.", "3"], + [0, 0, 0, "Do not use any type assertions.", "4"], + [0, 0, 0, "Unexpected any. Specify a different type.", "5"], + [0, 0, 0, "Do not use any type assertions.", "6"], + [0, 0, 0, "Do not use any type assertions.", "7"] + ], + "public/app/features/live/data/amendTimeSeries.ts:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Do not use any type assertions.", "1"], + [0, 0, 0, "Do not use any type assertions.", "2"], + [0, 0, 0, "Do not use any type assertions.", "3"], + [0, 0, 0, "Do not use any type assertions.", "4"] + ], "public/app/features/live/index.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], @@ -4853,6 +4870,26 @@ exports[`better eslint`] = { "public/app/plugins/panel/geomap/layers/basemaps/esri.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], + "public/app/plugins/panel/geomap/layers/data/dayNightLayer.tsx:5381": [ + [0, 0, 0, "Do not use any type assertions.", "0"] + ], + "public/app/plugins/panel/geomap/layers/data/geojsonDynamic.ts:5381": [ + [0, 0, 0, "Do not use any type assertions.", "0"] + ], + "public/app/plugins/panel/geomap/layers/data/heatMap.tsx:5381": [ + [0, 0, 0, "Do not use any type assertions.", "0"] + ], + "public/app/plugins/panel/geomap/layers/data/markersLayer.tsx:5381": [ + [0, 0, 0, "Do not use any type assertions.", "0"] + ], + "public/app/plugins/panel/geomap/layers/data/photosLayer.tsx:5381": [ + [0, 0, 0, "Do not use any type assertions.", "0"] + ], + "public/app/plugins/panel/geomap/layers/data/routeLayer.tsx:5381": [ + [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "Do not use any type assertions.", "1"], + [0, 0, 0, "Do not use any type assertions.", "2"] + ], "public/app/plugins/panel/geomap/layers/registry.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] diff --git a/.eslintignore b/.eslintignore index 012f471e24a..01e0c6ec342 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,23 +3,23 @@ .yarn build compiled -data +/data deployment_tools_config.json -devenv +/devenv dist -e2e/tmp +/e2e/tmp node_modules -pkg -public/lib/monaco -scripts/grafana-server/tmp +/pkg +/public/lib/monaco +/scripts/grafana-server/tmp vendor # TS generate from cue by cuetsy **/*.gen.ts # Auto-generated internationalization files -public/locales/_build/ -public/locales/**/*.js +/public/locales/_build/ +/public/locales/**/*.js # Auto-generated icon file -packages/grafana-ui/src/components/Icon/iconBundle.ts +/packages/grafana-ui/src/components/Icon/iconBundle.ts diff --git a/public/app/features/live/data/StreamingDataFrame.test.ts b/public/app/features/live/data/StreamingDataFrame.test.ts index 97366e20d4e..e20d431ab04 100644 --- a/public/app/features/live/data/StreamingDataFrame.test.ts +++ b/public/app/features/live/data/StreamingDataFrame.test.ts @@ -1,5 +1,6 @@ import { DataFrame, DataFrameJSON, FieldType, getFieldDisplayName, reduceField, ReducerID } from '@grafana/data'; import { StreamingFrameAction, StreamingFrameOptions } from '@grafana/runtime'; + import { closestIdx, getStreamingFrameOptions, StreamingDataFrame } from './StreamingDataFrame'; describe('Streaming JSON', () => { diff --git a/public/app/features/live/data/StreamingDataFrame.ts b/public/app/features/live/data/StreamingDataFrame.ts index a4c326ccec0..17b2b8b28b3 100644 --- a/public/app/features/live/data/StreamingDataFrame.ts +++ b/public/app/features/live/data/StreamingDataFrame.ts @@ -1,3 +1,5 @@ +import { AlignedData } from 'uplot'; + import { DataFrame, DataFrameJSON, @@ -15,7 +17,6 @@ import { import { join } from '@grafana/data/src/transformations/transformers/joinDataFrames'; import { StreamingFrameAction, StreamingFrameOptions } from '@grafana/runtime/src/services/live'; import { renderLegendFormat } from 'app/plugins/datasource/prometheus/legend'; -import { AlignedData } from 'uplot'; /** * Stream packet info is attached to StreamingDataFrames and indicate how many diff --git a/public/app/features/live/data/utils.ts b/public/app/features/live/data/utils.ts index 5ffdc6c6380..36630be4ff5 100644 --- a/public/app/features/live/data/utils.ts +++ b/public/app/features/live/data/utils.ts @@ -1,4 +1,5 @@ import { DataQueryResponseData, isDataFrame } from '@grafana/data'; + import { StreamingDataFrame } from './StreamingDataFrame'; /** diff --git a/public/app/plugins/panel/geomap/layers/data/dayNightLayer.tsx b/public/app/plugins/panel/geomap/layers/data/dayNightLayer.tsx index 15151aa6f61..ae937a62911 100644 --- a/public/app/plugins/panel/geomap/layers/data/dayNightLayer.tsx +++ b/public/app/plugins/panel/geomap/layers/data/dayNightLayer.tsx @@ -1,3 +1,16 @@ +import Feature from 'ol/Feature'; +import Map from 'ol/Map'; +import { Coordinate } from 'ol/coordinate'; +import { MultiLineString } from 'ol/geom'; +import Point from 'ol/geom/Point'; +import { Group as LayerGroup } from 'ol/layer'; +import VectorLayer from 'ol/layer/Vector'; +import { fromLonLat } from 'ol/proj'; +import VectorSource from 'ol/source/Vector'; +import { Fill, Stroke, Style, Circle } from 'ol/style'; +import DayNight from 'ol-ext/source/DayNight'; +import { Subscription } from 'rxjs'; + import { MapLayerRegistryItem, MapLayerOptions, @@ -7,19 +20,6 @@ import { DataHoverEvent, DataHoverClearEvent, } from '@grafana/data'; -import Map from 'ol/Map'; -import VectorLayer from 'ol/layer/Vector'; -import VectorSource from 'ol/source/Vector'; -import { Fill, Stroke, Style, Circle } from 'ol/style'; -import { Group as LayerGroup } from 'ol/layer'; -import Feature from 'ol/Feature'; -import Point from 'ol/geom/Point'; - -import DayNight from 'ol-ext/source/DayNight'; -import { fromLonLat } from 'ol/proj'; -import { Subscription } from 'rxjs'; -import { MultiLineString } from 'ol/geom'; -import { Coordinate } from 'ol/coordinate'; export enum ShowTime { From = 'from', diff --git a/public/app/plugins/panel/geomap/layers/data/geojsonDynamic.ts b/public/app/plugins/panel/geomap/layers/data/geojsonDynamic.ts index d591e2966f0..3692bbc31a8 100644 --- a/public/app/plugins/panel/geomap/layers/data/geojsonDynamic.ts +++ b/public/app/plugins/panel/geomap/layers/data/geojsonDynamic.ts @@ -1,3 +1,13 @@ +import { FeatureLike } from 'ol/Feature'; +import OlMap from 'ol/Map'; +import { unByKey } from 'ol/Observable'; +import GeoJSON from 'ol/format/GeoJSON'; +import VectorLayer from 'ol/layer/Vector'; +import VectorSource from 'ol/source/Vector'; +import { Fill, Stroke, Style } from 'ol/style'; +import { ReplaySubject } from 'rxjs'; +import { map as rxjsmap, first } from 'rxjs/operators'; + import { MapLayerRegistryItem, MapLayerOptions, @@ -6,25 +16,18 @@ import { PluginState, EventBus, } from '@grafana/data'; -import OlMap from 'ol/Map'; -import VectorLayer from 'ol/layer/Vector'; -import VectorSource from 'ol/source/Vector'; -import GeoJSON from 'ol/format/GeoJSON'; -import { unByKey } from 'ol/Observable'; -import { checkFeatureMatchesStyleRule } from '../../utils/checkFeatureMatchesStyleRule'; -import { FeatureRuleConfig, FeatureStyleConfig } from '../../types'; -import { Fill, Stroke, Style } from 'ol/style'; -import { FeatureLike } from 'ol/Feature'; +import { ComparisonOperation } from '@grafana/schema'; +import { findField } from 'app/features/dimensions'; + +import { StyleEditor } from '../../editor/StyleEditor'; +import { polyStyle } from '../../style/markers'; import { defaultStyleConfig, StyleConfig, StyleConfigState } from '../../style/types'; import { getStyleConfigState } from '../../style/utils'; -import { polyStyle } from '../../style/markers'; -import { StyleEditor } from '../../editor/StyleEditor'; -import { ReplaySubject } from 'rxjs'; -import { map as rxjsmap, first } from 'rxjs/operators'; +import { FeatureRuleConfig, FeatureStyleConfig } from '../../types'; +import { checkFeatureMatchesStyleRule } from '../../utils/checkFeatureMatchesStyleRule'; import { getLayerPropertyInfo } from '../../utils/getFeatures'; -import { findField } from 'app/features/dimensions'; import { getStyleDimension, getPublicGeoJSONFiles } from '../../utils/utils'; -import { ComparisonOperation } from '@grafana/schema'; + export interface DynamicGeoJSONMapperConfig { // URL for a geojson file @@ -87,7 +90,7 @@ export const dynamicGeoJSONLayer: MapLayerRegistryItem { //one geojson loads - if (source.getState() == 'ready') { + if (source.getState() === 'ready') { unByKey(key); features.next(source.getFeatures()); } diff --git a/public/app/plugins/panel/geomap/layers/data/geojsonLayer.ts b/public/app/plugins/panel/geomap/layers/data/geojsonLayer.ts index 66ec688a35c..cf59b65294a 100644 --- a/public/app/plugins/panel/geomap/layers/data/geojsonLayer.ts +++ b/public/app/plugins/panel/geomap/layers/data/geojsonLayer.ts @@ -1,3 +1,13 @@ +import { FeatureLike } from 'ol/Feature'; +import Map from 'ol/Map'; +import { unByKey } from 'ol/Observable'; +import GeoJSON from 'ol/format/GeoJSON'; +import VectorLayer from 'ol/layer/Vector'; +import VectorSource from 'ol/source/Vector'; +import { Style } from 'ol/style'; +import { ReplaySubject } from 'rxjs'; +import { map as rxjsmap, first } from 'rxjs/operators'; + import { MapLayerRegistryItem, MapLayerOptions, @@ -5,25 +15,18 @@ import { PluginState, EventBus, } from '@grafana/data'; -import Map from 'ol/Map'; -import VectorLayer from 'ol/layer/Vector'; -import VectorSource from 'ol/source/Vector'; -import GeoJSON from 'ol/format/GeoJSON'; -import { unByKey } from 'ol/Observable'; -import { checkFeatureMatchesStyleRule } from '../../utils/checkFeatureMatchesStyleRule'; -import { FeatureRuleConfig, FeatureStyleConfig } from '../../types'; -import { Style } from 'ol/style'; -import { FeatureLike } from 'ol/Feature'; +import { ComparisonOperation } from '@grafana/schema'; + import { GeomapStyleRulesEditor } from '../../editor/GeomapStyleRulesEditor'; +import { StyleEditor } from '../../editor/StyleEditor'; +import { polyStyle } from '../../style/markers'; import { defaultStyleConfig, StyleConfig, StyleConfigState } from '../../style/types'; import { getStyleConfigState } from '../../style/utils'; -import { polyStyle } from '../../style/markers'; -import { StyleEditor } from '../../editor/StyleEditor'; -import { ReplaySubject } from 'rxjs'; -import { map as rxjsmap, first } from 'rxjs/operators'; +import { FeatureRuleConfig, FeatureStyleConfig } from '../../types'; +import { checkFeatureMatchesStyleRule } from '../../utils/checkFeatureMatchesStyleRule'; import { getLayerPropertyInfo } from '../../utils/getFeatures'; import { getPublicGeoJSONFiles } from '../../utils/utils'; -import { ComparisonOperation } from '@grafana/schema'; + export interface GeoJSONMapperConfig { // URL for a geojson file @@ -81,7 +84,7 @@ export const geojsonLayer: MapLayerRegistryItem = { const key = source.on('change', () => { //one geojson loads - if (source.getState() == 'ready') { + if (source.getState() === 'ready') { unByKey(key); features.next(source.getFeatures()); } diff --git a/public/app/plugins/panel/geomap/layers/data/heatMap.tsx b/public/app/plugins/panel/geomap/layers/data/heatMap.tsx index 8df150a4f3a..96bb66e2377 100644 --- a/public/app/plugins/panel/geomap/layers/data/heatMap.tsx +++ b/public/app/plugins/panel/geomap/layers/data/heatMap.tsx @@ -1,3 +1,7 @@ +import Map from 'ol/Map'; +import { Point } from 'ol/geom'; +import * as layer from 'ol/layer'; + import { EventBus, FieldType, @@ -7,14 +11,11 @@ import { MapLayerRegistryItem, PanelData, } from '@grafana/data'; -import Map from 'ol/Map'; -import * as layer from 'ol/layer'; -import { getLocationMatchers } from 'app/features/geo/utils/location'; +import { ScaleDimensionConfig } from '@grafana/schema'; import { getScaledDimension } from 'app/features/dimensions'; import { ScaleDimensionEditor } from 'app/features/dimensions/editors'; import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource'; -import { Point } from 'ol/geom'; -import { ScaleDimensionConfig } from '@grafana/schema'; +import { getLocationMatchers } from 'app/features/geo/utils/location'; // Configuration options for Heatmap overlays export interface HeatmapConfig { diff --git a/public/app/plugins/panel/geomap/layers/data/index.ts b/public/app/plugins/panel/geomap/layers/data/index.ts index faa09c12805..2ea9660baa5 100644 --- a/public/app/plugins/panel/geomap/layers/data/index.ts +++ b/public/app/plugins/panel/geomap/layers/data/index.ts @@ -1,11 +1,11 @@ -import { markersLayer } from './markersLayer'; +import { dayNightLayer } from './dayNightLayer'; +import { dynamicGeoJSONLayer } from './geojsonDynamic'; import { geojsonLayer } from './geojsonLayer'; import { heatmapLayer } from './heatMap'; import { lastPointTracker } from './lastPointTracker'; -import { routeLayer } from './routeLayer'; -import { dayNightLayer } from './dayNightLayer'; -import { dynamicGeoJSONLayer } from './geojsonDynamic'; +import { markersLayer } from './markersLayer'; import { photosLayer } from './photosLayer'; +import { routeLayer } from './routeLayer'; /** * Registry for layer handlers diff --git a/public/app/plugins/panel/geomap/layers/data/lastPointTracker.ts b/public/app/plugins/panel/geomap/layers/data/lastPointTracker.ts index 30b3e379215..300324d5539 100644 --- a/public/app/plugins/panel/geomap/layers/data/lastPointTracker.ts +++ b/public/app/plugins/panel/geomap/layers/data/lastPointTracker.ts @@ -1,9 +1,10 @@ -import { MapLayerRegistryItem, MapLayerOptions, PanelData, GrafanaTheme2, PluginState, EventBus } from '@grafana/data'; -import Map from 'ol/Map'; import Feature from 'ol/Feature'; -import * as style from 'ol/style'; -import * as source from 'ol/source'; +import Map from 'ol/Map'; import * as layer from 'ol/layer'; +import * as source from 'ol/source'; +import * as style from 'ol/style'; + +import { MapLayerRegistryItem, MapLayerOptions, PanelData, GrafanaTheme2, PluginState, EventBus } from '@grafana/data'; import { getGeometryField, getLocationMatchers } from 'app/features/geo/utils/location'; export interface LastPointConfig { diff --git a/public/app/plugins/panel/geomap/layers/data/markersLayer.tsx b/public/app/plugins/panel/geomap/layers/data/markersLayer.tsx index a7b0f9ee16b..8d128ab4880 100644 --- a/public/app/plugins/panel/geomap/layers/data/markersLayer.tsx +++ b/public/app/plugins/panel/geomap/layers/data/markersLayer.tsx @@ -1,4 +1,10 @@ +import { isNumber } from 'lodash'; +import { FeatureLike } from 'ol/Feature'; +import Map from 'ol/Map'; +import VectorLayer from 'ol/layer/Vector'; import React, { ReactNode } from 'react'; +import { ReplaySubject } from 'rxjs'; + import { MapLayerRegistryItem, MapLayerOptions, @@ -7,18 +13,14 @@ import { FrameGeometrySourceMode, EventBus, } from '@grafana/data'; -import Map from 'ol/Map'; -import { FeatureLike } from 'ol/Feature'; +import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource'; import { getLocationMatchers } from 'app/features/geo/utils/location'; -import { ObservablePropsWrapper } from '../../components/ObservablePropsWrapper'; + import { MarkersLegend, MarkersLegendProps } from '../../components/MarkersLegend'; -import { ReplaySubject } from 'rxjs'; -import { defaultStyleConfig, StyleConfig } from '../../style/types'; +import { ObservablePropsWrapper } from '../../components/ObservablePropsWrapper'; import { StyleEditor } from '../../editor/StyleEditor'; +import { defaultStyleConfig, StyleConfig } from '../../style/types'; import { getStyleConfigState } from '../../style/utils'; -import VectorLayer from 'ol/layer/Vector'; -import { isNumber } from 'lodash'; -import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource'; import { getStyleDimension} from '../../utils/utils'; // Configuration options for Circle overlays diff --git a/public/app/plugins/panel/geomap/layers/data/photosLayer.tsx b/public/app/plugins/panel/geomap/layers/data/photosLayer.tsx index 3ad48928a59..1d06044b740 100644 --- a/public/app/plugins/panel/geomap/layers/data/photosLayer.tsx +++ b/public/app/plugins/panel/geomap/layers/data/photosLayer.tsx @@ -1,3 +1,9 @@ +import { FeatureLike } from 'ol/Feature'; +import Map from 'ol/Map'; +import VectorLayer from 'ol/layer/Vector'; +import { Stroke, Style } from 'ol/style'; +import Photo from 'ol-ext/style/Photo'; + import { MapLayerRegistryItem, PanelData, @@ -8,14 +14,9 @@ import { Field, } from '@grafana/data'; import { FrameGeometrySourceMode, MapLayerOptions } from '@grafana/schema'; -import Map from 'ol/Map'; -import { FeatureLike } from 'ol/Feature'; -import { getLocationMatchers } from 'app/features/geo/utils/location'; -import VectorLayer from 'ol/layer/Vector'; -import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource'; -import { Stroke, Style } from 'ol/style'; -import Photo from 'ol-ext/style/Photo'; import { findField } from 'app/features/dimensions'; +import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource'; +import { getLocationMatchers } from 'app/features/geo/utils/location'; // Configuration options for Circle overlays export interface PhotoConfig { @@ -93,7 +94,7 @@ export const photosLayer: MapLayerRegistryItem = { vectorLayer.setStyle((feature: FeatureLike) => { let src = unknownImage; - let idx: number = Infinity; + let idx = Infinity; if (images.length > 0) { idx = feature.get('rowIndex') as number; src = images[idx] ?? unknownImage; diff --git a/public/app/plugins/panel/geomap/layers/data/routeLayer.tsx b/public/app/plugins/panel/geomap/layers/data/routeLayer.tsx index 8c952a71c05..4e1384f5f83 100644 --- a/public/app/plugins/panel/geomap/layers/data/routeLayer.tsx +++ b/public/app/plugins/panel/geomap/layers/data/routeLayer.tsx @@ -1,3 +1,15 @@ +import { isNumber } from 'lodash'; +import Feature, { FeatureLike } from 'ol/Feature'; +import Map from 'ol/Map'; +import { LineString, Point, SimpleGeometry } from 'ol/geom'; +import { Group as LayerGroup } from 'ol/layer'; +import VectorLayer from 'ol/layer/Vector'; +import VectorSource from 'ol/source/Vector'; +import { Fill, Stroke, Style, Circle } from 'ol/style'; +import FlowLine from 'ol-ext/style/FlowLine'; +import { Subscription, throttleTime } from 'rxjs'; +import tinycolor from 'tinycolor2'; + import { MapLayerRegistryItem, PanelData, @@ -9,28 +21,15 @@ import { DataFrame, TIME_SERIES_TIME_FIELD_NAME, } from '@grafana/data'; - +import { alpha } from '@grafana/data/src/themes/colorManipulator'; import { MapLayerOptions, FrameGeometrySourceMode } from '@grafana/schema'; - -import Map from 'ol/Map'; -import { FeatureLike } from 'ol/Feature'; -import { Subscription, throttleTime } from 'rxjs'; +import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource'; import { getGeometryField, getLocationMatchers } from 'app/features/geo/utils/location'; -import { defaultStyleConfig, StyleConfig } from '../../style/types'; + import { StyleEditor } from '../../editor/StyleEditor'; -import { getStyleConfigState } from '../../style/utils'; -import VectorLayer from 'ol/layer/Vector'; -import { isNumber } from 'lodash'; import { routeStyle } from '../../style/markers'; -import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource'; -import { Group as LayerGroup } from 'ol/layer'; -import VectorSource from 'ol/source/Vector'; -import { Fill, Stroke, Style, Circle } from 'ol/style'; -import Feature from 'ol/Feature'; -import { alpha } from '@grafana/data/src/themes/colorManipulator'; -import { LineString, Point, SimpleGeometry } from 'ol/geom'; -import FlowLine from 'ol-ext/style/FlowLine'; -import tinycolor from 'tinycolor2'; +import { defaultStyleConfig, StyleConfig } from '../../style/types'; +import { getStyleConfigState } from '../../style/utils'; import { getStyleDimension, isSegmentVisible } from '../../utils/utils'; // Configuration options for Circle overlays @@ -87,7 +86,7 @@ export const routeLayer: MapLayerRegistryItem = { const location = await getLocationMatchers(options.location); const source = new FrameVectorSource(location); const vectorLayer = new VectorLayer({ source }); - const hasArrows = config.arrow == 1 || config.arrow == -1; + const hasArrows = config.arrow === 1 || config.arrow === -1; if (!style.fields && !hasArrows) { // Set a global style @@ -132,7 +131,7 @@ export const routeLayer: MapLayerRegistryItem = { const flowStyle = new FlowLine({ visible: true, - lineCap: config.arrow == 0 ? 'round' : 'square', + lineCap: config.arrow === 0 ? 'round' : 'square', color: color1, color2: color2, width: (dims.size && dims.size.get(startIndex)) ?? style.base.size,