Skip to content

Commit 63e746d

Browse files
committed
Resolve ESLint prefer-const
1 parent 71ec35c commit 63e746d

10 files changed

Lines changed: 16 additions & 15 deletions

File tree

web/eslint.config.ts

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

web/src/components/map/MapTooltip.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ const rasterValue = computed(() => {
7474
const data = mapStore.rasterTooltipDataCache[raster.id]?.data;
7575
if (data) {
7676
const { lng, lat } = clickedFeature.value.pos;
77-
let { xmin, xmax, ymin, ymax, srs } = raster.metadata.bounds;
77+
const { srs } = raster.metadata.bounds;
78+
let { xmin, xmax, ymin, ymax } = raster.metadata.bounds;
7879
[xmin, ymin] = proj4(srs, "EPSG:4326", [xmin, ymin]);
7980
[xmax, ymax] = proj4(srs, "EPSG:4326", [xmax, ymax]);
8081
// Convert lat/lng to array indices

web/src/components/projects/DatasetUpload.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ function submit() {
130130
}
131131
const layerOptions = await Promise.all(
132132
layers.value.map(async (l) => {
133-
let fileValues = await Promise.all(
133+
const fileValues = await Promise.all(
134134
l.files.map(async (f) => await uploadFile(f))
135135
)
136-
let fileItems = await Promise.all(
136+
const fileItems = await Promise.all(
137137
l.files.map(async (f, i) => await createFileItem({
138138
name: f.name,
139139
file: fileValues[i],

web/src/components/sidebars/FloatingPanel.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function getPanelContainerClass() {
2727
}
2828
2929
function getPanelContainerStyle() {
30-
let styleObj: Record<string, string> = {};
30+
const styleObj: Record<string, string> = {};
3131
styleObj.order = panel.value?.order.toString() || '0';
3232
if (!panel.value?.position) {
3333
if (panel.value?.height && !panel.value.collapsed) {
@@ -39,7 +39,7 @@ function getPanelContainerStyle() {
3939
}
4040
4141
function getPanelStyle() {
42-
let styleObj: Record<string, string> = {};
42+
const styleObj: Record<string, string> = {};
4343
if (panel.value?.position) {
4444
styleObj["z-index"] = "2"; // above vuetify navigation drawer
4545
styleObj.visibility = "visible"; // prevent hiding when sidebar closes

web/src/components/sidebars/LayerStyle.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ const colormaps = computed(() => styleStore.colormaps);
4545
4646
const projectPermission = computed(() => {
4747
if (!projectStore.currentProject || !appStore.currentUser) return 'none'
48-
let user = appStore.currentUser
49-
let proj = projectStore.currentProject
48+
const user = appStore.currentUser
49+
const proj = projectStore.currentProject
5050
let perm = 'follower'
5151
if (proj.owner?.id === user.id || user.is_superuser ) {
5252
perm = "owner";

web/src/components/sidebars/LegendPanel.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ function getColormapPreviews(layer: Layer) {
2626
)
2727
const vector = currentFrame?.vector
2828
return currentStyleSpec.colors.map((colorConfig) => {
29-
let name = colorConfig.name
29+
const name = colorConfig.name
3030
let discrete = false;
3131
let nColors = 1;
3232
let colorBy = undefined;
3333
let range: [number | undefined, number | undefined] = [undefined, undefined];
34-
let useFeatureProps = vector && colorConfig.use_feature_props;
34+
const useFeatureProps = vector && colorConfig.use_feature_props;
3535
let valueColors = undefined
3636
let colormap = styleStore.colormaps.find((cmap) => cmap.id === colorConfig.colormap?.id)
3737
if (colormap) {

web/src/components/sidebars/NodeAnimation.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function rewind() {
6767
6868
watch(currentTick, async () => {
6969
if (nodeChanges.value) {
70-
let deactivated = nodeChanges.value[currentTick.value];
70+
const deactivated = nodeChanges.value[currentTick.value];
7171
if (props.network) networkStore.setNetworkDeactivatedNodes(props.network, deactivated || [], true);
7272
if (props.additionalAnimationLayers) {
7373
props.additionalAnimationLayers.forEach((layer) => {

web/src/store/map.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export const useMapStore = defineStore('map', () => {
313313

314314
// Must collect all source Ids so they can be removed after all layers
315315
// have been removed, since multple layers may use the same source
316-
let sourceIdsToRemove = new Set<string>();
316+
const sourceIdsToRemove = new Set<string>();
317317
const updatedLayerIds: string[] = [];
318318
layerIds.forEach((id) => {
319319
// Rasters have implicit bounds layers that also need to be removed
@@ -519,7 +519,8 @@ export const useMapStore = defineStore('map', () => {
519519

520520
const bounds = raster.metadata.bounds;
521521
const boundsSourceId = sourceId.replace('raster', 'bounds');
522-
let { xmin, xmax, ymin, ymax, srs } = bounds;
522+
const { srs } = bounds;
523+
let { xmin, xmax, ymin, ymax } = bounds;
523524
[xmin, ymin] = proj4(srs, "EPSG:4326", [xmin, ymin]);
524525
[xmax, ymax] = proj4(srs, "EPSG:4326", [xmax, ymax]);
525526
map.addSource(boundsSourceId, {

web/src/store/network.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export const useNetworkStore = defineStore('network', () => {
175175
async function isNodeActive(nodeId: number, dataset: Dataset) {
176176
const network = await getNetwork(nodeId, dataset);
177177
if (network) {
178-
let deactivated = Array.from(networkStates.value[network.id]?.deactivated?.nodes || []);
178+
const deactivated = Array.from(networkStates.value[network.id]?.deactivated?.nodes || []);
179179
return !deactivated.includes(nodeId)
180180
}
181181
}

web/src/store/style.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ function getVectorSizePaintProperty(styleSpec: StyleSpec, groupName: string, pro
271271
}
272272

273273
function getVectorVisibilityPaintProperty(styleSpec: StyleSpec, groupName: string) {
274-
let filters: any[] = []
274+
const filters: any[] = []
275275
const colorSpec = styleSpec.colors.find((c) => [groupName, 'all'].includes(c.name))
276276
if (colorSpec && !colorSpec.visible) {
277277
return 0

0 commit comments

Comments
 (0)