We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
prefer-const
1 parent 71ec35c commit 63e746dCopy full SHA for 63e746d
10 files changed
web/eslint.config.ts
@@ -19,7 +19,6 @@ export default defineConfigWithVueTs(
19
'@typescript-eslint/no-explicit-any': 'off',
20
// Temporary ignores until rules can be fixed
21
'vue/require-v-for-key': 'off',
22
- 'prefer-const': 'off',
23
'vue/valid-v-for': 'off',
24
'vue/return-in-computed-property': 'off',
25
'vue/no-ref-as-operand': 'off',
web/src/components/map/MapTooltip.vue
@@ -74,7 +74,8 @@ const rasterValue = computed(() => {
74
const data = mapStore.rasterTooltipDataCache[raster.id]?.data;
75
if (data) {
76
const { lng, lat } = clickedFeature.value.pos;
77
- let { xmin, xmax, ymin, ymax, srs } = raster.metadata.bounds;
+ const { srs } = raster.metadata.bounds;
78
+ let { xmin, xmax, ymin, ymax } = raster.metadata.bounds;
79
[xmin, ymin] = proj4(srs, "EPSG:4326", [xmin, ymin]);
80
[xmax, ymax] = proj4(srs, "EPSG:4326", [xmax, ymax]);
81
// Convert lat/lng to array indices
web/src/components/projects/DatasetUpload.vue
@@ -130,10 +130,10 @@ function submit() {
130
}
131
const layerOptions = await Promise.all(
132
layers.value.map(async (l) => {
133
- let fileValues = await Promise.all(
+ const fileValues = await Promise.all(
134
l.files.map(async (f) => await uploadFile(f))
135
)
136
- let fileItems = await Promise.all(
+ const fileItems = await Promise.all(
137
l.files.map(async (f, i) => await createFileItem({
138
name: f.name,
139
file: fileValues[i],
web/src/components/sidebars/FloatingPanel.vue
@@ -27,7 +27,7 @@ function getPanelContainerClass() {
27
28
29
function getPanelContainerStyle() {
30
- let styleObj: Record<string, string> = {};
+ const styleObj: Record<string, string> = {};
31
styleObj.order = panel.value?.order.toString() || '0';
32
if (!panel.value?.position) {
33
if (panel.value?.height && !panel.value.collapsed) {
@@ -39,7 +39,7 @@ function getPanelContainerStyle() {
39
40
41
function getPanelStyle() {
42
43
if (panel.value?.position) {
44
styleObj["z-index"] = "2"; // above vuetify navigation drawer
45
styleObj.visibility = "visible"; // prevent hiding when sidebar closes
web/src/components/sidebars/LayerStyle.vue
@@ -45,8 +45,8 @@ const colormaps = computed(() => styleStore.colormaps);
46
const projectPermission = computed(() => {
47
if (!projectStore.currentProject || !appStore.currentUser) return 'none'
48
- let user = appStore.currentUser
49
- let proj = projectStore.currentProject
+ const user = appStore.currentUser
+ const proj = projectStore.currentProject
50
let perm = 'follower'
51
if (proj.owner?.id === user.id || user.is_superuser ) {
52
perm = "owner";
web/src/components/sidebars/LegendPanel.vue
@@ -26,12 +26,12 @@ function getColormapPreviews(layer: Layer) {
26
const vector = currentFrame?.vector
return currentStyleSpec.colors.map((colorConfig) => {
- let name = colorConfig.name
+ const name = colorConfig.name
let discrete = false;
let nColors = 1;
let colorBy = undefined;
let range: [number | undefined, number | undefined] = [undefined, undefined];
34
- let useFeatureProps = vector && colorConfig.use_feature_props;
+ const useFeatureProps = vector && colorConfig.use_feature_props;
35
let valueColors = undefined
36
let colormap = styleStore.colormaps.find((cmap) => cmap.id === colorConfig.colormap?.id)
37
if (colormap) {
web/src/components/sidebars/NodeAnimation.vue
@@ -67,7 +67,7 @@ function rewind() {
67
68
watch(currentTick, async () => {
69
if (nodeChanges.value) {
70
- let deactivated = nodeChanges.value[currentTick.value];
+ const deactivated = nodeChanges.value[currentTick.value];
71
if (props.network) networkStore.setNetworkDeactivatedNodes(props.network, deactivated || [], true);
72
if (props.additionalAnimationLayers) {
73
props.additionalAnimationLayers.forEach((layer) => {
web/src/store/map.ts
@@ -313,7 +313,7 @@ export const useMapStore = defineStore('map', () => {
313
314
// Must collect all source Ids so they can be removed after all layers
315
// have been removed, since multple layers may use the same source
316
- let sourceIdsToRemove = new Set<string>();
+ const sourceIdsToRemove = new Set<string>();
317
const updatedLayerIds: string[] = [];
318
layerIds.forEach((id) => {
319
// Rasters have implicit bounds layers that also need to be removed
@@ -519,7 +519,8 @@ export const useMapStore = defineStore('map', () => {
519
520
const bounds = raster.metadata.bounds;
521
const boundsSourceId = sourceId.replace('raster', 'bounds');
522
- let { xmin, xmax, ymin, ymax, srs } = bounds;
+ const { srs } = bounds;
523
+ let { xmin, xmax, ymin, ymax } = bounds;
524
525
526
map.addSource(boundsSourceId, {
web/src/store/network.ts
@@ -175,7 +175,7 @@ export const useNetworkStore = defineStore('network', () => {
175
async function isNodeActive(nodeId: number, dataset: Dataset) {
176
const network = await getNetwork(nodeId, dataset);
177
if (network) {
178
- let deactivated = Array.from(networkStates.value[network.id]?.deactivated?.nodes || []);
+ const deactivated = Array.from(networkStates.value[network.id]?.deactivated?.nodes || []);
179
return !deactivated.includes(nodeId)
180
181
web/src/store/style.ts
@@ -271,7 +271,7 @@ function getVectorSizePaintProperty(styleSpec: StyleSpec, groupName: string, pro
271
272
273
function getVectorVisibilityPaintProperty(styleSpec: StyleSpec, groupName: string) {
274
- let filters: any[] = []
+ const filters: any[] = []
275
const colorSpec = styleSpec.colors.find((c) => [groupName, 'all'].includes(c.name))
276
if (colorSpec && !colorSpec.visible) {
277
return 0
0 commit comments