Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[chore] Fix lint issues displayed on GitHub's File Changes page (#3001)

Igor Dykhtac5dbd571d98c
diff --git a/.eslintrc.js b/.eslintrc.js
index 04b42c4bb..bd02ee441 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -39,7 +39,12 @@ module.exports = {
'comma-dangle': 1,
'enzyme-deprecation/no-shallow': 2,
'enzyme-deprecation/no-mount': 2,
- 'no-constant-condition': ['error', {checkLoops: false}]
+ 'no-constant-condition': ['error', {checkLoops: false}],
+ 'no-unused-vars': ['warn', {argsIgnorePattern: '^_', varsIgnorePattern: '^_'}],
+ '@typescript-eslint/no-unused-vars': [
+ 'warn',
+ {argsIgnorePattern: '^_', varsIgnorePattern: '^_'}
+ ]
},
overrides: [
{
diff --git a/examples/demo-app/src/app.tsx b/examples/demo-app/src/app.tsx
index ea1442759..d48e89a1c 100644
--- a/examples/demo-app/src/app.tsx
+++ b/examples/demo-app/src/app.tsx
@@ -55,7 +55,7 @@ const KeplerGl = require('@kepler.gl/components').injectComponents([
// Sample data
/* eslint-disable no-unused-vars */
import sampleTripData, {testCsvData, sampleTripDataConfig} from './data/sample-trip-data';
-import sampleGeojson from './data/sample-small-geojson';
+// import sampleGeojson from './data/sample-small-geojson';
// import sampleGeojsonPoints from './data/sample-geojson-points';
import sampleGeojsonConfig from './data/sample-geojson-config';
import sampleH3Data, {config as h3MapConfig} from './data/sample-hex-id-csv';
@@ -199,6 +199,7 @@ const App = props => {
// Notifications
// no dependencies, as this was part of componentDidMount
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const _setStartScreenCapture = useCallback(
@@ -215,9 +216,11 @@ const App = props => {
[dispatch]
);
+ /*
const _showBanner = useCallback(() => {
toggleShowBanner(true);
}, [toggleShowBanner]);
+ */
const hideBanner = useCallback(() => {
toggleShowBanner(false);
diff --git a/src/common-utils/src/data-type.ts b/src/common-utils/src/data-type.ts
index d736b0d82..e81242168 100644
--- a/src/common-utils/src/data-type.ts
+++ b/src/common-utils/src/data-type.ts
@@ -90,7 +90,7 @@ export function getSampleForTypeAnalyze({
export function getSampleForTypeAnalyzeArrow(
table: ArrowTableInterface | ApacheVectorInterface[],
fields: string[],
- sampleCount: number = 50
+ sampleCount = 50
): any[] {
const isTable = !Array.isArray(table);
diff --git a/src/components/src/common/item-selector/dropdown-list.tsx b/src/components/src/common/item-selector/dropdown-list.tsx
index cafb23e35..7dfc8a249 100644
--- a/src/components/src/common/item-selector/dropdown-list.tsx
+++ b/src/components/src/common/item-selector/dropdown-list.tsx
@@ -26,12 +26,7 @@ export type ListItemProps<Option> = {
};
const defaultDisplay = d => d;
-export const ListItem = ({
- value,
- displayOption = defaultDisplay,
- disabled,
- light
-}: ListItemProps<any>) => {
+export const ListItem = ({value, displayOption = defaultDisplay, disabled}: ListItemProps<any>) => {
const displayValue = displayOption(value);
return (
<span title={displayValue} className={classNames(classList.listItemAnchor, {disabled})}>
diff --git a/src/components/src/hooks/use-legend-position.ts b/src/components/src/hooks/use-legend-position.ts
index a59208009..ceb793b58 100644
--- a/src/components/src/hooks/use-legend-position.ts
+++ b/src/components/src/hooks/use-legend-position.ts
@@ -81,7 +81,8 @@ export function useCalcLegendPosition({
? {y: topOffset, anchorY: 'top'}
: {y: bottomOffset, anchorY: 'bottom'})
};
- }, [isSidePanelShown, legendContentRef?.current, sidePanelWidth]);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [isSidePanelShown, sidePanelWidth]);
}
/**
@@ -116,6 +117,7 @@ export default function useLegendPosition({
if (content instanceof HTMLElement) {
startHeightRef.current = content.offsetHeight;
}
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const resize = useCallback(
deltaY => {
@@ -133,6 +135,7 @@ export default function useLegendPosition({
}
}
},
+ // eslint-disable-next-line react-hooks/exhaustive-deps
[contentHeight, pos, onChangeSettings]
);
@@ -152,7 +155,7 @@ export default function useLegendPosition({
});
}
}
- }, [isSidePanelShown, onChangeSettings]);
+ }, [isSidePanelShown, onChangeSettings, sidePanelWidth]);
return {positionStyles, updatePosition, contentHeight, startResize, resize};
}
diff --git a/src/components/src/map/map-legend-panel.tsx b/src/components/src/map/map-legend-panel.tsx
index 3b1a05544..f644b9a9a 100644
--- a/src/components/src/map/map-legend-panel.tsx
+++ b/src/components/src/map/map-legend-panel.tsx
@@ -300,7 +300,6 @@ const MapLegendPanelComponent = ({
onClickControlBtn,
isViewportUnsyncAllowed = true,
className,
- interactionConfig,
MapControlTooltip,
MapControlPanel,
MapLegend
@@ -387,7 +386,7 @@ function MapLegendPanelFactory(
): MapLegendPanelComponentType {
const MapLegendPanel = withState(
[uiStateLens],
- state => {
+ _state => {
return {
MapControlTooltip,
MapControlPanel,
diff --git a/src/components/src/side-panel/layer-panel/color-palette-preset.tsx b/src/components/src/side-panel/layer-panel/color-palette-preset.tsx
index 926660f37..7d9b82530 100644
--- a/src/components/src/side-panel/layer-panel/color-palette-preset.tsx
+++ b/src/components/src/side-panel/layer-panel/color-palette-preset.tsx
@@ -54,7 +54,7 @@ const PresetColorPalette: React.FC<PresetColorPaletteProps> = ({
<StyledColorPalette>
{themes.map(theme => (
<StyledColorColumn key={theme} className="single-color-palette__column">
- {range(1, ROWS + 1, 1).map((key, i) => (
+ {range(1, ROWS + 1, 1).map(key => (
<StyledColorBlock
className="single-color-palette__block"
style={{
diff --git a/src/components/src/side-panel/layer-panel/color-selector.tsx b/src/components/src/side-panel/layer-panel/color-selector.tsx
index 7d97f3c2d..67ade3915 100644
--- a/src/components/src/side-panel/layer-panel/color-selector.tsx
+++ b/src/components/src/side-panel/layer-panel/color-selector.tsx
@@ -168,7 +168,7 @@ function ColorSelectorFactory(
setColor(colorSet, color, colorSet.selectedColor[3]);
}
},
- [colorSets, editingColorSet, setColor]
+ [editingColorSet, setColor]
);
const onSelectOpacity = useCallback(
@@ -179,7 +179,7 @@ function ColorSelectorFactory(
setColor(colorSet, colorSet.selectedColor, Math.round(opacity[1] * 255));
}
},
- [colorSets, editingColorSet, setColor]
+ [editingColorSet, setColor]
);
const onToggleDropdown = useCallback(
diff --git a/src/components/src/side-panel/layer-panel/custom-palette.tsx b/src/components/src/side-panel/layer-panel/custom-palette.tsx
index b99a2b6b3..e67c35739 100644
--- a/src/components/src/side-panel/layer-panel/custom-palette.tsx
+++ b/src/components/src/side-panel/layer-panel/custom-palette.tsx
@@ -714,7 +714,6 @@ export const CategoricalCustomPaletteInput: React.FC<CategoricalCustomPaletteInp
actionIcons = defaultActionIcons,
onDelete,
disableDelete,
- onAdd,
onToggleSketcher,
addColorMapValue,
removeColorMapValue,
diff --git a/src/components/src/side-panel/layer-panel/layer-configurator.tsx b/src/components/src/side-panel/layer-panel/layer-configurator.tsx
index 432c5cd43..21d83eb28 100644
--- a/src/components/src/side-panel/layer-panel/layer-configurator.tsx
+++ b/src/components/src/side-panel/layer-panel/layer-configurator.tsx
@@ -276,12 +276,7 @@ export default function LayerConfiguratorFactory(
);
}
- _renderClusterLayerConfig({
- layer,
- visConfiguratorProps,
- layerConfiguratorProps,
- layerChannelConfigProps
- }) {
+ _renderClusterLayerConfig({layer, visConfiguratorProps, layerChannelConfigProps}) {
return (
<StyledLayerVisualConfigurator>
{/* Color */}
@@ -352,12 +347,7 @@ export default function LayerConfiguratorFactory(
return this._renderAggregationLayerConfig(props);
}
- _renderAggregationLayerConfig({
- layer,
- visConfiguratorProps,
- layerConfiguratorProps,
- layerChannelConfigProps
- }) {
+ _renderAggregationLayerConfig({layer, visConfiguratorProps, layerChannelConfigProps}) {
const {config} = layer;
const {
visConfig: {enable3d, fixedHeight}
diff --git a/src/components/src/side-panel/layer-panel/vector-tile-layer-configurator.tsx b/src/components/src/side-panel/layer-panel/vector-tile-layer-configurator.tsx
index 209927837..2e2434bd1 100644
--- a/src/components/src/side-panel/layer-panel/vector-tile-layer-configurator.tsx
+++ b/src/components/src/side-panel/layer-panel/vector-tile-layer-configurator.tsx
@@ -50,7 +50,6 @@ function VectorTileLayerConfiguratorFactory(
): React.FC<Props> {
const VectorTileLayerConfigurator = ({
layer,
- dataset,
visConfiguratorProps,
layerChannelConfigProps,
layerConfiguratorProps
diff --git a/src/constants/src/default-settings.ts b/src/constants/src/default-settings.ts
index 2ba76bf8d..6fa98fa8d 100644
--- a/src/constants/src/default-settings.ts
+++ b/src/constants/src/default-settings.ts
@@ -901,7 +901,7 @@ export const FIELD_OPTS = {
...notSupportAggrOpts
},
format: {
- legend: d => '...',
+ legend: () => '...',
tooltip: []
}
}
diff --git a/src/deckgl-arrow-layers/src/utils/utils.ts b/src/deckgl-arrow-layers/src/utils/utils.ts
index 2bf23dc76..a679fde4c 100644
--- a/src/deckgl-arrow-layers/src/utils/utils.ts
+++ b/src/deckgl-arrow-layers/src/utils/utils.ts
@@ -62,8 +62,7 @@ function isDataSeparatedCoords(
* this time deck.gl only supports interleaved.
*/
// TODO: this hasn't been tested yet
-// @ts-expect-error
-function convertStructToFixedSizeList(
+export function convertStructToFixedSizeList(
coords:
| arrow.Data<arrow.FixedSizeList<arrow.Float64>>
| arrow.Data<arrow.Struct<{x: arrow.Float64; y: arrow.Float64}>>
diff --git a/src/duckdb/src/components/monaco-editor.tsx b/src/duckdb/src/components/monaco-editor.tsx
index 236e8f6d1..b2367d800 100644
--- a/src/duckdb/src/components/monaco-editor.tsx
+++ b/src/duckdb/src/components/monaco-editor.tsx
@@ -92,7 +92,7 @@ const MonacoEditor: React.FC<MonacoEditorProps> = ({
});
monaco.languages.registerCompletionItemProvider('*', {
- provideCompletionItems: (model, position, context, cancelationToken) => {
+ provideCompletionItems: (model, position, _context, _cancelationToken) => {
const suggestions: monaco.languages.CompletionItem[] = [
{
label: 'myCustomSnippet',
@@ -152,7 +152,7 @@ const MonacoEditor: React.FC<MonacoEditorProps> = ({
...tableSchema
.filter(d => d.table_name === table_name)
.map(
- ({table_name, column_name}) =>
+ ({column_name}) =>
({
label: column_name,
kind: monaco.languages.CompletionItemKind.Field,
@@ -170,7 +170,7 @@ const MonacoEditor: React.FC<MonacoEditorProps> = ({
}
});
},
- [tableSchema]
+ [tableSchema, schemaTableNames, schemaTableNamesSet]
);
return (
diff --git a/src/duckdb/src/components/preview-data-panel.tsx b/src/duckdb/src/components/preview-data-panel.tsx
index d0529c958..dff8d16c9 100644
--- a/src/duckdb/src/components/preview-data-panel.tsx
+++ b/src/duckdb/src/components/preview-data-panel.tsx
@@ -57,7 +57,6 @@ export type PreviewDataPanelProps = BaseComponentProps & {
const PreviewDataPanelWOTheme: React.FC<PreviewDataPanelProps> = ({
result,
rowsToCalculatePreview = DEFAULT_ROWS_TO_CALCULATE_PREVIEW,
- setColumnDisplayFormat,
defaultPinnedColumns = [],
theme
}) => {
diff --git a/src/duckdb/src/components/schema-panel.tsx b/src/duckdb/src/components/schema-panel.tsx
index 0c493490d..06d4808d5 100644
--- a/src/duckdb/src/components/schema-panel.tsx
+++ b/src/duckdb/src/components/schema-panel.tsx
@@ -69,9 +69,7 @@ function getSchemaSuggestion(result) {
export const SchemaPanel = ({setTableSchema}) => {
const [columnSchemas, setColumnSchemas] = useState<TreeNodeData<{type: string}>[]>([]);
const datasets = useSelector((state: State) => state?.demo?.keplerGl?.map?.visState.datasets);
- useEffect(() => {
- getTableSchema();
- }, [datasets]);
+
const getTableSchema = useCallback(async () => {
const db = await getDuckDB();
const c = await db.connect();
@@ -88,6 +86,10 @@ export const SchemaPanel = ({setTableSchema}) => {
c.close();
}, [setColumnSchemas, setTableSchema]);
+ useEffect(() => {
+ getTableSchema();
+ }, [datasets, getTableSchema]);
+
return (
<StyledSchemaPanel>
{columnSchemas?.length ? (
diff --git a/src/duckdb/src/init.ts b/src/duckdb/src/init.ts
index a4ea932b3..d173c9576 100644
--- a/src/duckdb/src/init.ts
+++ b/src/duckdb/src/init.ts
@@ -38,9 +38,12 @@ const _initializeDuckDb = async (config?: DuckDBConfig): Promise<AsyncDuckDB> =>
// Select a bundle based on browser checks
const JSDELIVR_BUNDLES = duckdb.getJsDelivrBundles();
const bundle = await duckdb.selectBundle(JSDELIVR_BUNDLES);
+ if (!bundle.mainWorker) {
+ throw new Error('Failed to initialize DuckDB');
+ }
const worker_url = URL.createObjectURL(
- new Blob([`importScripts("${bundle.mainWorker!}");`], {
+ new Blob([`importScripts("${bundle.mainWorker}");`], {
type: 'text/javascript'
})
);
diff --git a/src/duckdb/src/processors/data-processor.ts b/src/duckdb/src/processors/data-processor.ts
index 48325d089..3bceb78a8 100644
--- a/src/duckdb/src/processors/data-processor.ts
+++ b/src/duckdb/src/processors/data-processor.ts
@@ -38,8 +38,8 @@ enum COLUMN_TYPES {
TIMESTAMP = 'TIMESTAMP',
VARCHAR = 'VARCHAR'
}
-// @ts-expect-error https://duckdb.org/docs/data/csv/auto_detection.html#type-detection
-const COLUMN_TYPES_PRIORITIES = [
+// https://duckdb.org/docs/data/csv/auto_detection.html#type-detection
+export const COLUMN_TYPES_PRIORITIES = [
'GEOMETRY',
'BOOLEAN',
'INTEGER',
diff --git a/src/duckdb/src/table/duckdb-table-utils.ts b/src/duckdb/src/table/duckdb-table-utils.ts
index a39dc9b83..1b9aa44df 100644
--- a/src/duckdb/src/table/duckdb-table-utils.ts
+++ b/src/duckdb/src/table/duckdb-table-utils.ts
@@ -69,7 +69,7 @@ export function constructST_asWKBQuery(tableName: string, columnsToConvertToWKB:
columnsToConvertToWKB.length > 0 ? `EXCLUDE ${columnsToConvertToWKB.join(', ')}` : '';
const asWKB =
columnsToConvertToWKB.length > 0
- ? ', ' + columnsToConvertToWKB.map(column => `ST_AsWKB(${column}) as ${column}`).join(', ')
+ ? `, ${columnsToConvertToWKB.map(column => `ST_AsWKB(${column}) as ${column}`).join(', ')}`
: '';
return `SELECT * ${exclude} ${asWKB} FROM '${tableName}';`;
}
diff --git a/src/duckdb/src/table/duckdb-table.ts b/src/duckdb/src/table/duckdb-table.ts
index 7ba32204a..42d70e506 100644
--- a/src/duckdb/src/table/duckdb-table.ts
+++ b/src/duckdb/src/table/duckdb-table.ts
@@ -155,7 +155,7 @@ export class KeplerGlDuckDbTable extends KeplerTable {
};
}
- async importArrowData({data, db, c}: ImportDataToDuckProps): Promise<ImportDataToDuckResult> {
+ async importArrowData({data, c}: ImportDataToDuckProps): Promise<ImportDataToDuckResult> {
let adjustedMetadata = {};
try {
// 1) data.rows contains an arrow table created by Add to Map data from DuckDb query.
diff --git a/src/layers/src/arc-layer/arc-layer.ts b/src/layers/src/arc-layer/arc-layer.ts
index 5a2c5af07..b0564f997 100644
--- a/src/layers/src/arc-layer/arc-layer.ts
+++ b/src/layers/src/arc-layer/arc-layer.ts
@@ -293,7 +293,7 @@ export default class ArcLayer extends Layer {
return hasStart && hasNeibors;
}
- static findDefaultLayerProps({fields, fieldPairs = []}: KeplerTable): {
+ static findDefaultLayerProps({fieldPairs = []}: KeplerTable): {
props: {color?: RGBColor; columns: ArcLayerColumnsConfig; label: string}[];
} {
if (fieldPairs.length < 2) {
diff --git a/src/layers/src/base-layer.ts b/src/layers/src/base-layer.ts
index 09784d78a..cec1a8992 100644
--- a/src/layers/src/base-layer.ts
+++ b/src/layers/src/base-layer.ts
@@ -1090,7 +1090,7 @@ class Layer implements KeplerLayer {
return this.getVisChannelScale(colorScale, colorDomain, colorRange.colors.map(hexToRgb));
}
- accessVSFieldValue(field, indexKey) {
+ accessVSFieldValue(_field, _indexKey) {
return defaultGetFieldValue;
}
/**
diff --git a/src/layers/src/layer-utils.ts b/src/layers/src/layer-utils.ts
index 6697e7701..a4554fb82 100644
--- a/src/layers/src/layer-utils.ts
+++ b/src/layers/src/layer-utils.ts
@@ -52,7 +52,10 @@ export type FindDefaultLayerPropsReturnValue = {
foundLayers?: (FindDefaultLayerProps & {type: string})[];
};
-export function assignPointPairToLayerColumn(pair: FieldPair, hasAlt: boolean): Record<string, LayerColumn> {
+export function assignPointPairToLayerColumn(
+ pair: FieldPair,
+ hasAlt: boolean
+): Record<string, LayerColumn> {
const {lat, lng, altitude} = pair.pair;
if (!hasAlt) {
return {lat, lng};
@@ -168,7 +171,6 @@ function getBinaryGeometriesFromWKBArrow(
}
export function getGeojsonLayerMetaFromArrow({
- dataContainer,
geoColumn,
geoField,
chunkIndex
diff --git a/src/layers/src/line-layer/line-layer.ts b/src/layers/src/line-layer/line-layer.ts
index 584a773ee..7f1e6021b 100644
--- a/src/layers/src/line-layer/line-layer.ts
+++ b/src/layers/src/line-layer/line-layer.ts
@@ -231,7 +231,7 @@ export default class LineLayer extends ArcLayer {
};
}
- static findDefaultLayerProps({fields, fieldPairs = []}: KeplerTable): {
+ static findDefaultLayerProps({fieldPairs = []}: KeplerTable): {
props: {color?: RGBColor; columns: LineLayerColumnsConfig; label: string}[];
} {
if (fieldPairs.length < 2) {
diff --git a/src/reducers/src/vis-state-updaters.ts b/src/reducers/src/vis-state-updaters.ts
index 363548c48..742568ebc 100644
--- a/src/reducers/src/vis-state-updaters.ts
+++ b/src/reducers/src/vis-state-updaters.ts
@@ -1401,7 +1401,7 @@ function _updateFilterProp(state, filter, prop, value, valueIndex, datasetIds?)
*/
export const setFilterPlotUpdater = (
state: VisState,
- {idx, newProp, valueIndex = 0}: VisStateActions.SetFilterPlotUpdaterAction
+ {idx, newProp}: VisStateActions.SetFilterPlotUpdaterAction
): VisState => {
if (!state.filters[idx]) {
Console.error(`filters[${idx}] is undefined`);
diff --git a/src/utils/map-utils.spec.js b/src/utils/map-utils.spec.js
index 2e634f5c5..5259e9bda 100644
--- a/src/utils/map-utils.spec.js
+++ b/src/utils/map-utils.spec.js
@@ -42,8 +42,7 @@ describe('mapUtils', () => {
const viewState = {...INITIAL_MAP_STATE, width: 0, height: 0};
onViewPortChange(viewState, mockOnUpdateMap, mockOnViewStateChange);
- /* eslint-disable no-unused-vars */
- const {width, height, ...restViewState} = INITIAL_MAP_STATE;
+ const {width: _width, height: _height, ...restViewState} = INITIAL_MAP_STATE;
expect(mockOnUpdateMap).toHaveBeenCalledWith({...restViewState, transitionDuration: 0}, 0);
});
diff --git a/src/utils/src/application-config.ts b/src/utils/src/application-config.ts
index 3bc979a4a..1818eaf74 100644
--- a/src/utils/src/application-config.ts
+++ b/src/utils/src/application-config.ts
@@ -20,7 +20,7 @@ export type BaseMapLibraryConfig = {
* A mechanism to override default Kepler values/settings so that we
* without having to make application-specific changes to the kepler repo.
*/
-export type KeplerApplicationConfig<Map> = {
+export type KeplerApplicationConfig = {
/** Default name of export HTML file, can be overridden by user */
defaultHtmlName?: string;
defaultImageName?: string;
@@ -41,7 +41,7 @@ export type KeplerApplicationConfig<Map> = {
showReleaseBanner?: boolean;
};
-const DEFAULT_APPLICATION_CONFIG: Required<KeplerApplicationConfig<mapboxgl.Map>> = {
+const DEFAULT_APPLICATION_CONFIG: Required<KeplerApplicationConfig> = {
defaultHtmlName: 'kepler.gl.html',
defaultImageName: 'kepler.gl.png',
defaultJsonName: 'kepler.gl.json',
@@ -76,12 +76,10 @@ const DEFAULT_APPLICATION_CONFIG: Required<KeplerApplicationConfig<mapboxgl.Map>
showReleaseBanner: true
};
-const applicationConfig: Required<KeplerApplicationConfig<mapboxgl.Map>> =
- DEFAULT_APPLICATION_CONFIG;
+const applicationConfig: Required<KeplerApplicationConfig> = DEFAULT_APPLICATION_CONFIG;
-export const getApplicationConfig = (): Required<KeplerApplicationConfig<mapboxgl.Map>> =>
- applicationConfig;
+export const getApplicationConfig = (): Required<KeplerApplicationConfig> => applicationConfig;
-export function initApplicationConfig<M>(appConfig: KeplerApplicationConfig<M> = {}) {
+export function initApplicationConfig(appConfig: KeplerApplicationConfig = {}) {
Object.assign(applicationConfig, appConfig);
}
diff --git a/src/utils/src/data-scale-utils.ts b/src/utils/src/data-scale-utils.ts
index 2c385113a..0c7867c7d 100644
--- a/src/utils/src/data-scale-utils.ts
+++ b/src/utils/src/data-scale-utils.ts
@@ -208,7 +208,7 @@ function getScaleLabels(
scale: D3ScaleFunction,
labelFormat: LabelFormat
): Omit<ColorBreak, 'data'>[] {
- return scale.range().map((d, i) => {
+ return scale.range().map(d => {
// @ts-ignore
const invert = scale.invertExtent(d);
const inputs = [
@@ -419,7 +419,7 @@ export function colorMapToCategoricalColorBreaks(
if (!colorMap) {
return null;
}
- const colorBreaks = colorMap.map(([value, color], i) => {
+ const colorBreaks = colorMap.map(([value, color]) => {
return {
data: color,
label: value
@@ -540,7 +540,7 @@ export function getHistogramDomain({
];
}
if (dataset && fieldValueAccessor) {
- dataset.allIndexes.forEach((x, i) => {
+ dataset.allIndexes.forEach(x => {
const val = fieldValueAccessor(x);
if (isNumber(val)) {
if (val < domainMin) domainMin = val;
diff --git a/src/utils/src/map-style-utils/mapbox-utils.ts b/src/utils/src/map-style-utils/mapbox-utils.ts
index d09bdf9de..1e0cac12c 100644
--- a/src/utils/src/map-style-utils/mapbox-utils.ts
+++ b/src/utils/src/map-style-utils/mapbox-utils.ts
@@ -45,9 +45,9 @@ export function isStyleUsingOpenStreetMapTiles(mapStyle: any) {
* @returns transformed url
*/
export const transformRequest = (
- mapboxKey: string
+ _mapboxKey: string
): ((url: string, resourceType: string) => {url: string}) => {
- return (url: string, resourceType: string) => {
+ return (url: string, _resourceType: string) => {
/*
if (isMapboxURL(url)) {
// ! TODO - use MapBox directly?
diff --git a/src/utils/src/plot.ts b/src/utils/src/plot.ts
index be51bdc45..a99c9fcf2 100644
--- a/src/utils/src/plot.ts
+++ b/src/utils/src/plot.ts
@@ -172,7 +172,7 @@ export function getTimeBins(
): TimeBins {
let bins = filter.timeBins || {};
- filter.dataId.forEach((dataId, dataIdIdx) => {
+ filter.dataId.forEach(dataId => {
// reuse bins if filterData did not change
if (bins[dataId] && bins[dataId][interval]) {
return;
@@ -396,7 +396,7 @@ export const getAggregationOptiosnBasedOnField = field => {
function getDelta(
bins: LineDatum[],
y: number,
- interval: PlotType['interval']
+ _interval: PlotType['interval']
): Partial<LineDatum> & {delta: 'last'; pct: number | null} {
// if (WOW[interval]) return getWow(bins, y, interval);
const lastBin = bins[bins.length - 1];
@@ -441,7 +441,7 @@ export function getLineChart(datasets: Datasets, filter: Filter): LineChart {
const getYValue = getValueAggrFunc(yAxis, aggregation, dataset);
const init: LineDatum[] = [];
- const series = (bins || []).reduce((accu, bin, i) => {
+ const series = (bins || []).reduce((accu, bin) => {
const y = getYValue(bin);
const delta = getDelta(accu, y, interval);
accu.push({
@@ -588,7 +588,7 @@ export function updateTimeFilterPlotType(
filter: TimeRangeFilter,
plotType: TimeRangeFilter['plotType'],
datasets: Datasets,
- dataId?: string
+ _dataId?: string
): TimeRangeFilter {
let nextFilter = filter;
let nextPlotType = plotType;
@@ -655,7 +655,7 @@ export function updateRangeFilterPlotType(
filter: RangeFilter,
plotType: RangeFilter['plotType'],
datasets: Datasets,
- dataId?: string
+ _dataId?: string
): RangeFilter {
const nextFilter = {
...filter,
diff --git a/test/node/reducers/vis-state-test.js b/test/node/reducers/vis-state-test.js
index b273efdcf..9620c9213 100644
--- a/test/node/reducers/vis-state-test.js
+++ b/test/node/reducers/vis-state-test.js
@@ -5931,8 +5931,7 @@ test('#visStateReducer -> LOAD_FILES', async t => {
t.equal(task10.type, 'DELAY_TASK', 'should return an DELAY_TASK for onFinish');
// calling delayed task succeed to trigger load next file
- /* eslint-disable no-unused-vars */
- const resultState11 = reducer(resultState10, succeedTaskInTest(task10));
+ const _resultState11 = reducer(resultState10, succeedTaskInTest(task10));
t.ok(loadFilesSuccessSpy.calledOnce);
const expectedArgs = [
@@ -5994,7 +5993,7 @@ test('#visStateReducer -> layerFilteredItemsChange', t => {
count: 100
};
const layer = StateWFiles.visState.layers[0];
- const nextState = reducer(
+ const _nextState = reducer(
StateWFiles.visState,
VisStateActions.layerFilteredItemsChange(layer, mockEvent)
);
diff --git a/test/node/utils/layer-utils-test.js b/test/node/utils/layer-utils-test.js
index bde34a443..8d98eedf3 100644
--- a/test/node/utils/layer-utils-test.js
+++ b/test/node/utils/layer-utils-test.js
@@ -596,7 +596,7 @@ test('layerUtils -> findDefaultLayer:GeojsonLayer', t => {
});
// eslint-disable-next-line no-unused-vars
- const [layer1Color, layer2Color, layer2Stroke] = getNextColorMakerValue(3);
+ const [_layer1Color, _layer2Color, layer2Stroke] = getNextColorMakerValue(3);
expected1.updateLayerVisConfig({filled: true, stroked: false});
expected2.updateLayerVisConfig({
filled: true,
@@ -664,8 +664,7 @@ test('layerUtils -> findDefaultLayer:GeojsonLayer.wkt', t => {
}
});
- // eslint-disable-next-line no-unused-vars
- const [layer1Color, strokeColor1, layer2Color, strokeColor2] = getNextColorMakerValue(4);
+ const [_layer1Color, strokeColor1, _layer2Color, strokeColor2] = getNextColorMakerValue(4);
expected1.updateLayerVisConfig({
filled: true,
stroked: true,