Skip to content

Commit 71ec35c

Browse files
committed
Resolve ESLint @typescript-eslint/no-unused-vars
1 parent 2e7b218 commit 71ec35c

7 files changed

Lines changed: 34 additions & 36 deletions

File tree

web/eslint.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export default defineConfigWithVueTs(
2020
// Temporary ignores until rules can be fixed
2121
'vue/require-v-for-key': 'off',
2222
'prefer-const': 'off',
23-
'@typescript-eslint/no-unused-vars': 'off',
2423
'vue/valid-v-for': 'off',
2524
'vue/return-in-computed-property': 'off',
2625
'vue/no-ref-as-operand': 'off',

web/src/components/map/LegacyMap.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import "maplibre-gl/dist/maplibre-gl.css";
66
77
import MapTooltip from "./MapTooltip.vue";
88
import { oauthClient } from "@/api/auth";
9-
import { THEMES } from "@/themes";
109
1110
import { useAppStore, useMapStore, useLayerStore } from "@/store";
1211
const appStore = useAppStore();

web/src/components/map/ToggleCompareMap.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ToggleCompare } from "vue-maplibre-compare";
77
import { oauthClient } from "@/api/auth";
88
import 'vue-maplibre-compare/dist/vue-maplibre-compare.css'
99
import { addProtocol, AttributionControl, Popup } from "maplibre-gl";
10-
import type { StyleSpecification, Map, ResourceType } from "maplibre-gl";
10+
import type { StyleSpecification, Map } from "maplibre-gl";
1111
import { useTheme } from 'vuetify';
1212
import { Protocol } from "pmtiles";
1313
import { storeToRefs } from "pinia";
@@ -152,7 +152,7 @@ watch(() => appStore.openSidebars, () => {
152152
setAttributionControlStyle();
153153
});
154154
155-
const transformRequest = (url: string, _resourceType?: ResourceType) => {
155+
const transformRequest = (url: string) => {
156156
// Only add auth headers to our own tile requests
157157
if (url.includes(import.meta.env.VITE_APP_API_ROOT)) {
158158
return {

web/src/components/projects/ProjectConfig.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
deleteProject,
1111
patchProject,
1212
} from "@/api/rest";
13-
import type { Project, Dataset, TaskResult } from "@/types";
13+
import type { Project, Dataset } from "@/types";
1414
1515
import { useMapStore, useAppStore, useProjectStore } from "@/store";
1616
const projectStore = useProjectStore();
@@ -208,7 +208,7 @@ function handleEditFocus(focused: boolean) {
208208
}
209209
}
210210
211-
function datasetUploaded(result: {dataset: Dataset, conversionTask: TaskResult}) {
211+
function datasetUploaded() {
212212
projectStore.refreshAllDatasets()
213213
refreshProjectDatasets(null)
214214
}

web/src/components/sidebars/CompareLayerStyle.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script setup lang="ts">
2-
import { computed, onMounted, ref, watch } from 'vue';
2+
import { computed, ref, watch } from 'vue';
33
import type { Ref } from 'vue';
44
import type { Layer, LayerStyle, StyleSpec } from '@/types';
55
import { getLayerStyles } from '@/api/rest';
66
import SliderNumericInput from '../SliderNumericInput.vue';
77
88
import { useStyleStore, usePanelStore, useLayerStore, useMapStore } from '@/store';
9-
import { cloneDeep, debounce, map } from 'lodash';
9+
import { cloneDeep } from 'lodash';
1010
import { useMapCompareStore } from '@/store/compare';
1111
const styleStore = useStyleStore();
1212
const panelStore = usePanelStore();

web/src/store/compare.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineStore } from 'pinia';
2-
import { computed, ref, watch } from 'vue';
2+
import { ref, watch } from 'vue';
33
import { useLayerStore } from './layer';
4-
import { cloneDeep, map } from 'lodash';
4+
import { cloneDeep } from 'lodash';
55
import { useMapStore } from './map';
66
import { useStyleStore } from './style';
77
import type { MapLayerStyleRaw } from './style';
@@ -37,10 +37,10 @@ function findSourceDifferences(
3737
if (!existingStyle) {
3838
return { added: Object.keys(newStyle.sources), removed: [] };
3939
}
40-
40+
4141
const existing = new Set(Object.keys(existingStyle.sources));
4242
const current = new Set(Object.keys(newStyle.sources));
43-
43+
4444
return {
4545
added: Array.from(current).filter(id => !existing.has(id)),
4646
removed: Array.from(existing).filter(id => !current.has(id)),
@@ -58,10 +58,10 @@ function findLayerDifferences(
5858
if (!existingStyle) {
5959
return { added: newStyle.layers, removed: [] };
6060
}
61-
61+
6262
const existing = new Set(existingStyle.layers.map((l: any) => l.id));
6363
const current = new Set(newStyle.layers.map((l: any) => l.id));
64-
64+
6565
return {
6666
added: newStyle.layers.filter((l: any) => !existing.has(l.id)),
6767
removed: Array.from(existing).filter(id => !current.has(id)),
@@ -96,7 +96,7 @@ export const useMapCompareStore = defineStore('mapCompare', () => {
9696
A: {},
9797
B: {},
9898
});
99-
99+
100100

101101
const initializeComparing = () => {
102102
const map = mapStore.getMap();
@@ -161,7 +161,7 @@ export const useMapCompareStore = defineStore('mapCompare', () => {
161161
mapStats.value.center = event.center;
162162
mapStats.value.zoom = event.zoom;
163163
mapStats.value.bearing = event.bearing;
164-
mapStats.value.pitch = event.pitch;
164+
mapStats.value.pitch = event.pitch;
165165
}
166166
function updateSlider(event: { percentage: number, position: number }) {
167167
sliderEnd.value = event;
@@ -222,7 +222,7 @@ export const useMapCompareStore = defineStore('mapCompare', () => {
222222
if (newVal) {
223223
initializeComparing();
224224
}
225-
});
225+
});
226226

227227
/**
228228
* Reapply stored opacity values to all layers in compare mode
@@ -234,59 +234,59 @@ export const useMapCompareStore = defineStore('mapCompare', () => {
234234
// Process both map A and map B
235235
(['A', 'B'] as const).forEach((panel) => {
236236
const storedStyles = compareLayerStyles.value[panel];
237-
237+
238238
// Iterate through all stored layer styles
239239
Object.entries(storedStyles).forEach(([styleKey, storedStyle]) => {
240240
// Parse the style key to get layer id and copy_id
241241
const [layerIdStr, copyIdStr] = styleKey.split('.');
242242
const layerId = parseInt(layerIdStr);
243243
const copyId = parseInt(copyIdStr);
244-
244+
245245
// Find the layer object
246246
const layer = layerStore.selectedLayers.find(
247247
(l) => l.id === layerId && l.copy_id === copyId
248248
);
249-
249+
250250
if (!layer) return;
251-
251+
252252
// Get all map layer IDs for this layer
253253
const mapLayerIds = layerStore.getMapLayersFromLayerObject(layer).flat();
254-
254+
255255
// Get the current frame
256256
const frames = layerStore.layerFrames(layer);
257257
const currentFrame = frames.find(
258258
(f) => f.index === layer.current_frame_index
259259
);
260-
260+
261261
if (!currentFrame) return;
262-
262+
263263
// Get the stored style spec with the stored opacity
264264
const styleSpec = storedStyle.style?.style_spec;
265265
if (!styleSpec) return;
266-
266+
267267
// Update the opacity in the style spec to match stored value
268268
const styleSpecWithOpacity = cloneDeep(styleSpec);
269269
styleSpecWithOpacity.opacity = storedStyle.opacity;
270-
270+
271271
// Apply the style to all map layers for this layer
272272
mapLayerIds.forEach((mapLayerId) => {
273273
// Check if the map layer exists in the main map (required for returnMapLayerStyle)
274274
const mainMap = mapStore.getMap();
275275
if (!mainMap || !mainMap.getLayer(mapLayerId)) {
276276
return;
277277
}
278-
278+
279279
const visibileLayers = panel === 'A' ? mapLayersA.value : mapLayersB.value;
280280
const visibility = visibileLayers.includes(mapLayerId) ? 'visible' : 'none';
281-
281+
282282
const result = styleStore.returnMapLayerStyle(
283283
mapLayerId,
284284
styleSpecWithOpacity,
285285
currentFrame,
286286
currentFrame.vector,
287287
visibility
288288
);
289-
289+
290290
if (result) {
291291
updateMapLayerStyle(panel, mapLayerId, result);
292292
}
@@ -298,19 +298,19 @@ export const useMapCompareStore = defineStore('mapCompare', () => {
298298
function updateCompareLayerStyle() {
299299
const compareMapAddedSources: {sourceId: string, sourceType: SourceSpecification['type']}[] = [];
300300
if (!isComparing.value) return compareMapAddedSources;
301-
301+
302302
const newStyle = mapStore.getMap()?.getStyle();
303303
if (!newStyle || !mapAStyle.value || !mapBStyle.value) {
304304
mapAStyle.value = newStyle;
305305
mapBStyle.value = newStyle;
306306
return compareMapAddedSources;
307307
}
308-
308+
309309
// Process both maps
310310
(['A', 'B'] as const).forEach((panel) => {
311311
const mapStyle = panel === 'A' ? mapAStyle.value : mapBStyle.value;
312312
if (!mapStyle) return;
313-
313+
314314
// Handle sources
315315
const sourceDiff = findSourceDifferences(newStyle, mapStyle);
316316
sourceDiff.added.forEach((sourceId) => {
@@ -325,7 +325,7 @@ export const useMapCompareStore = defineStore('mapCompare', () => {
325325
sourceDiff.removed.forEach((sourceId) => {
326326
delete mapStyle.sources[sourceId];
327327
});
328-
328+
329329
// Handle layers
330330
const layerDiff = findLayerDifferences(newStyle, mapStyle);
331331
layerDiff.added.forEach((layer) => {
@@ -335,7 +335,7 @@ export const useMapCompareStore = defineStore('mapCompare', () => {
335335
mapStyle.layers = mapStyle.layers.filter((l: any) => l.id !== layerId);
336336
});
337337
});
338-
338+
339339
generateDisplayLayers();
340340
reapplyStoredOpacityValues();
341341
return compareMapAddedSources;
@@ -347,7 +347,7 @@ export const useMapCompareStore = defineStore('mapCompare', () => {
347347
if (isComparing.value && mapStore.compareMap) {
348348
if (sourceType === 'vector') {
349349
mapStore.setupVectorLayerClickHandlers(mapStore.compareMap, sourceId, mapStore.handleCompareLayerClick);
350-
}
350+
}
351351
}
352352
});
353353
}, { deep: true });

web/src/store/project.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const useProjectStore = defineStore('project', () => {
9494
selected_layer_current_frames: styleKeysToCurrentFrames,
9595
selected_layer_order: Object.keys(styleKeysToCurrentFrames),
9696
selected_layer_styles: Object.fromEntries(
97-
Object.entries(styleStore.selectedLayerStyles).filter(([styleKey, _]) => {
97+
Object.entries(styleStore.selectedLayerStyles).filter(([styleKey]) => {
9898
return Object.keys(styleKeysToCurrentFrames).includes(styleKey)
9999
})
100100
),

0 commit comments

Comments
 (0)