Skip to content

Commit 72c5ef1

Browse files
authored
Merge pull request #366 from OpenGeoscience/eslint
Resolve some ESLint issues
2 parents 88f6e81 + 63e746d commit 72c5ef1

17 files changed

Lines changed: 51 additions & 57 deletions

web/eslint.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ 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',
23-
'@typescript-eslint/no-unused-vars': 'off',
2422
'vue/valid-v-for': 'off',
25-
'@typescript-eslint/ban-ts-comment': 'off',
2623
'vue/return-in-computed-property': 'off',
2724
'vue/no-ref-as-operand': 'off',
2825
'vue/no-side-effects-in-computed-properties': 'off',

web/src/components/ControlsBar.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ function createBasemapPreviews() {
7575
bounds,
7676
});
7777
78-
// Ignore typing due to "Type instantiation is excessively deep and possibly infinite"
79-
// @ts-ignore
8078
preview.setStyle(basemap.style);
8179
basemapPreviews.value[basemap.id] = preview;
8280
})

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/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/map/ToggleCompareMap.vue

Lines changed: 2 additions & 3 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 {
@@ -163,7 +163,6 @@ const transformRequest = (url: string, _resourceType?: ResourceType) => {
163163
return { url };
164164
}
165165
166-
// @ts-ignore for "Type instantiation is excessively deep and possibly infinite"
167166
const mapStyleA: Ref<StyleSpecification | string> = ref(mapStore.currentBasemap?.style as StyleSpecification);
168167
watch(isComparing, (newVal) => {
169168
if (!newVal && mapStore.map) {

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/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/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";

0 commit comments

Comments
 (0)