From edb48ae0781a47206be87d542a3014b6080c1456 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Thu, 2 Jan 2025 14:42:59 +0000 Subject: [PATCH 01/14] update dev dependencies --- .eslintrc.cjs | 4 - apps/docs/package.json | 16 ++-- eslint.config.mjs | 80 ++++++++++++++++++++ package.json | 16 ++-- packages/charts/.eslintignore | 13 ---- packages/charts/.eslintrc.cjs | 35 --------- packages/charts/eslint.config.mjs | 80 ++++++++++++++++++++ packages/charts/package.json | 10 +-- packages/eslint-config-custom/package.json | 8 +- packages/maps/.eslintignore | 13 ---- packages/maps/.eslintrc.cjs | 35 --------- packages/maps/eslint.config.mjs | 85 ++++++++++++++++++++++ packages/maps/package.json | 10 +-- packages/tables/.eslintignore | 13 ---- packages/tables/.eslintrc.cjs | 39 ---------- packages/tables/eslint.config.mjs | 82 +++++++++++++++++++++ packages/tables/package.json | 10 +-- packages/themes/package.json | 2 +- packages/ui/.eslintignore | 13 ---- packages/ui/.eslintrc.cjs | 39 ---------- packages/ui/eslint.config.mjs | 82 +++++++++++++++++++++ packages/ui/package.json | 5 +- packages/utils/package.json | 4 +- turbo.json | 2 +- 24 files changed, 452 insertions(+), 244 deletions(-) delete mode 100644 .eslintrc.cjs create mode 100644 eslint.config.mjs delete mode 100644 packages/charts/.eslintignore delete mode 100644 packages/charts/.eslintrc.cjs create mode 100644 packages/charts/eslint.config.mjs delete mode 100644 packages/maps/.eslintignore delete mode 100644 packages/maps/.eslintrc.cjs create mode 100644 packages/maps/eslint.config.mjs delete mode 100644 packages/tables/.eslintignore delete mode 100644 packages/tables/.eslintrc.cjs create mode 100644 packages/tables/eslint.config.mjs delete mode 100644 packages/ui/.eslintignore delete mode 100644 packages/ui/.eslintrc.cjs create mode 100644 packages/ui/eslint.config.mjs diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index b11dd896..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - root: true, - extends: ['@ldn-viz/eslint-config-custom'] -}; diff --git a/apps/docs/package.json b/apps/docs/package.json index ea5c3d37..996b58b2 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -18,7 +18,7 @@ "build-storybook": "storybook build" }, "devDependencies": { - "@chromatic-com/storybook": "^1.2.18", + "@chromatic-com/storybook": "^3.2.3", "@playwright/test": "^1.28.1", "@storybook/addon-a11y": "^8.0.0", "@storybook/addon-essentials": "^8.0.0", @@ -27,19 +27,19 @@ "@storybook/addon-svelte-csf": "^4.1.2", "@storybook/addon-themes": "^8.0.0", "@storybook/blocks": "^8.0.0", - "@storybook/svelte": "^8.0.0", + "@storybook/svelte": "^8.4.7", "@storybook/sveltekit": "^8.0.0", "@storybook/test": "^8.0.0", "@sveltejs/adapter-auto": "^3.0.0", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", - "@types/eslint": "^8.56.0", - "@typescript-eslint/eslint-plugin": "^7.0.0", - "@typescript-eslint/parser": "^7.0.0", - "eslint": "^8.56.0", + "@types/eslint": "^9.6.1", + "@typescript-eslint/eslint-plugin": "^8.19.0", + "@typescript-eslint/parser": "^8.19.0", + "eslint": "^9.17.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-storybook": "^0.8.0", - "eslint-plugin-svelte": "^2.35.1", + "eslint-plugin-storybook": "^0.11.2", + "eslint-plugin-svelte": "^2.46.1", "prettier": "^3.1.1", "prettier-plugin-svelte": "^3.1.2", "storybook": "^8.0.0", diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..f2362dbe --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,80 @@ +import svelte from 'eslint-plugin-svelte'; +import typescriptEslint from '@typescript-eslint/eslint-plugin'; +import globals from 'globals'; +import tsParser from '@typescript-eslint/parser'; +import parser from 'svelte-eslint-parser'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import js from '@eslint/js'; +import { FlatCompat } from '@eslint/eslintrc'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [ + { + ignores: [ + '**/*.cjs', + '**/.DS_Store', + '**/node_modules', + 'build', + '.svelte-kit', + 'package', + '**/.env', + '**/.env.*', + '!**/.env.example', + '**/pnpm-lock.yaml', + '**/package-lock.json', + '**/yarn.lock' + ] + }, + ...compat.extends('eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'), + { + plugins: { + svelte, + '@typescript-eslint': typescriptEslint + }, + + languageOptions: { + globals: { + ...globals.browser, + ...globals.node + }, + + parser: tsParser, + ecmaVersion: 2020, + sourceType: 'module' + }, + + settings: {}, + + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_' + } + ] + } + }, + { + files: ['**/*.svelte'], + + languageOptions: { + parser: parser, + ecmaVersion: 5, + sourceType: 'script', + + parserOptions: { + parser: '@typescript-eslint/parser' + } + } + } +]; diff --git a/package.json b/package.json index 97eabe53..9185ce27 100644 --- a/package.json +++ b/package.json @@ -19,17 +19,21 @@ "html2canvas": "^1.4.1" }, "devDependencies": { + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "^9.17.0", "@ldn-viz/eslint-config-custom": "*", - "eslint": "^8.57.0", + "eslint": "^9.17.0", "eslint-plugin-turbo": "^1.12.5", + "globals": "^15.14.0", "prettier": "^3.2.5", "prettier-plugin-packagejson": "^2.5.1", "prettier-plugin-svelte": "^3.2.2", - "turbo": "^1.12.5", + "turbo": "^2.3.3", "vitest": "^2.1.8" }, - "overrides": { - "esbuild": "0.24.0" - }, - "packageManager": "npm@9.5.0" + "packageManager": "npm@9.5.0", + "overrides": { + "esbuild": "0.24.0", + "eslint": "^9.17.0" + } } diff --git a/packages/charts/.eslintignore b/packages/charts/.eslintignore deleted file mode 100644 index 38972655..00000000 --- a/packages/charts/.eslintignore +++ /dev/null @@ -1,13 +0,0 @@ -.DS_Store -node_modules -/build -/.svelte-kit -/package -.env -.env.* -!.env.example - -# Ignore files for PNPM, NPM and YARN -pnpm-lock.yaml -package-lock.json -yarn.lock diff --git a/packages/charts/.eslintrc.cjs b/packages/charts/.eslintrc.cjs deleted file mode 100644 index 663a9930..00000000 --- a/packages/charts/.eslintrc.cjs +++ /dev/null @@ -1,35 +0,0 @@ -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'prettier', - '@ldn-viz/eslint-config-custom' - ], - rules: { - '@typescript-eslint/no-explicit-any': 'off' - }, - plugins: ['svelte', '@typescript-eslint'], - ignorePatterns: ['*.cjs'], - overrides: [ - { - files: ['*.svelte'], - parser: 'svelte-eslint-parser', - // Parse the ` diff --git a/packages/tables/src/lib/core/aggregateRenderers/BoxPlot.svelte b/packages/tables/src/lib/core/aggregateRenderers/BoxPlot.svelte index 22be24cd..e033cb51 100644 --- a/packages/tables/src/lib/core/aggregateRenderers/BoxPlot.svelte +++ b/packages/tables/src/lib/core/aggregateRenderers/BoxPlot.svelte @@ -136,6 +136,7 @@ $: drawCanvas(box, showAllPoints, canvasRef); // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/aggregateRenderers/Dots.svelte b/packages/tables/src/lib/core/aggregateRenderers/Dots.svelte index 066fd290..2dce51c7 100644 --- a/packages/tables/src/lib/core/aggregateRenderers/Dots.svelte +++ b/packages/tables/src/lib/core/aggregateRenderers/Dots.svelte @@ -69,6 +69,7 @@ $: drawCanvas(dodgedValues, canvasRef); // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/aggregateRenderers/Histogram.svelte b/packages/tables/src/lib/core/aggregateRenderers/Histogram.svelte index d1d9c4a9..f864cc5d 100644 --- a/packages/tables/src/lib/core/aggregateRenderers/Histogram.svelte +++ b/packages/tables/src/lib/core/aggregateRenderers/Histogram.svelte @@ -57,6 +57,7 @@ $: update(values); // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/aggregateRenderers/Mean.svelte b/packages/tables/src/lib/core/aggregateRenderers/Mean.svelte index c9ddd8fb..eb1a0d85 100644 --- a/packages/tables/src/lib/core/aggregateRenderers/Mean.svelte +++ b/packages/tables/src/lib/core/aggregateRenderers/Mean.svelte @@ -20,6 +20,7 @@ $: f = format(formatString); // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/aggregateRenderers/StackedBar.svelte b/packages/tables/src/lib/core/aggregateRenderers/StackedBar.svelte index ab4bac8c..cbd29836 100644 --- a/packages/tables/src/lib/core/aggregateRenderers/StackedBar.svelte +++ b/packages/tables/src/lib/core/aggregateRenderers/StackedBar.svelte @@ -55,6 +55,7 @@ $: update(values); // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/aggregateRenderers/Summary.svelte b/packages/tables/src/lib/core/aggregateRenderers/Summary.svelte index 687b6f21..398881c1 100644 --- a/packages/tables/src/lib/core/aggregateRenderers/Summary.svelte +++ b/packages/tables/src/lib/core/aggregateRenderers/Summary.svelte @@ -16,6 +16,7 @@ $: f2 = (val: number | undefined) => (val === undefined ? 'undefined' : f(val)); // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/aggregateRenderers/ViolinPlot.svelte b/packages/tables/src/lib/core/aggregateRenderers/ViolinPlot.svelte index 59e684b3..63e820ef 100644 --- a/packages/tables/src/lib/core/aggregateRenderers/ViolinPlot.svelte +++ b/packages/tables/src/lib/core/aggregateRenderers/ViolinPlot.svelte @@ -79,6 +79,7 @@ $: update(values); // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/renderers/BarDivergingAxis.svelte b/packages/tables/src/lib/core/renderers/BarDivergingAxis.svelte index 15e45b74..6d6b3480 100644 --- a/packages/tables/src/lib/core/renderers/BarDivergingAxis.svelte +++ b/packages/tables/src/lib/core/renderers/BarDivergingAxis.svelte @@ -36,6 +36,7 @@ const topPadding = height; // padding above the horizontal rule // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/renderers/BarDivergingCell.svelte b/packages/tables/src/lib/core/renderers/BarDivergingCell.svelte index de9a8742..85ed5972 100644 --- a/packages/tables/src/lib/core/renderers/BarDivergingCell.svelte +++ b/packages/tables/src/lib/core/renderers/BarDivergingCell.svelte @@ -54,6 +54,7 @@ const textPadding = 2; // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/renderers/DateCell.svelte b/packages/tables/src/lib/core/renderers/DateCell.svelte index b6f4f23f..4ff05edd 100644 --- a/packages/tables/src/lib/core/renderers/DateCell.svelte +++ b/packages/tables/src/lib/core/renderers/DateCell.svelte @@ -33,6 +33,7 @@ $: alignmentClass = alignmentClasses[alignText ?? 'left']; // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/renderers/Dot.svelte b/packages/tables/src/lib/core/renderers/Dot.svelte index 3e45e3f5..ecd8453a 100644 --- a/packages/tables/src/lib/core/renderers/Dot.svelte +++ b/packages/tables/src/lib/core/renderers/Dot.svelte @@ -38,6 +38,7 @@ const fPercentage = format('0.0%'); // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/renderers/GoodOrBad.svelte b/packages/tables/src/lib/core/renderers/GoodOrBad.svelte index 8240338b..4552754f 100644 --- a/packages/tables/src/lib/core/renderers/GoodOrBad.svelte +++ b/packages/tables/src/lib/core/renderers/GoodOrBad.svelte @@ -46,7 +46,7 @@ $: f = format(formatString); - $: if (true && typeof value === 'number') { + $: if (typeof value === 'number') { compared = compareToBenchmark(value, benchmarkValue, goodIs); } @@ -92,6 +92,7 @@ }; // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/renderers/Header.svelte b/packages/tables/src/lib/core/renderers/Header.svelte index dbbd894c..9bc90d27 100644 --- a/packages/tables/src/lib/core/renderers/Header.svelte +++ b/packages/tables/src/lib/core/renderers/Header.svelte @@ -48,6 +48,7 @@ }; // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/renderers/PairArrowAxis.svelte b/packages/tables/src/lib/core/renderers/PairArrowAxis.svelte index f0c3bb2e..9bf2fab7 100644 --- a/packages/tables/src/lib/core/renderers/PairArrowAxis.svelte +++ b/packages/tables/src/lib/core/renderers/PairArrowAxis.svelte @@ -40,6 +40,7 @@ const topPadding = height; // padding above the horizontal rule // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/renderers/PairArrowCell.svelte b/packages/tables/src/lib/core/renderers/PairArrowCell.svelte index 20cb5c86..68f75a3a 100644 --- a/packages/tables/src/lib/core/renderers/PairArrowCell.svelte +++ b/packages/tables/src/lib/core/renderers/PairArrowCell.svelte @@ -41,6 +41,7 @@ .range([barEndPadding, width - barEndPadding]); // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/renderers/ProportionalSymbol.svelte b/packages/tables/src/lib/core/renderers/ProportionalSymbol.svelte index 80a8cc52..80d1b589 100644 --- a/packages/tables/src/lib/core/renderers/ProportionalSymbol.svelte +++ b/packages/tables/src/lib/core/renderers/ProportionalSymbol.svelte @@ -39,6 +39,7 @@ // See the MDN docs on radial gradients: https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/radial-gradient // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/renderers/TextCell.svelte b/packages/tables/src/lib/core/renderers/TextCell.svelte index 8bdd34dd..84de31fb 100644 --- a/packages/tables/src/lib/core/renderers/TextCell.svelte +++ b/packages/tables/src/lib/core/renderers/TextCell.svelte @@ -21,6 +21,7 @@ $: alignmentClass = alignmentClasses[alignText ?? 'left']; // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/renderers/TextCellWithUncertainty.svelte b/packages/tables/src/lib/core/renderers/TextCellWithUncertainty.svelte index 3399e731..9196355b 100644 --- a/packages/tables/src/lib/core/renderers/TextCellWithUncertainty.svelte +++ b/packages/tables/src/lib/core/renderers/TextCellWithUncertainty.svelte @@ -29,6 +29,7 @@ : 'text-color-text-primary'; // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/core/renderers/Tick.svelte b/packages/tables/src/lib/core/renderers/Tick.svelte index e1b59365..4bf0cd97 100644 --- a/packages/tables/src/lib/core/renderers/Tick.svelte +++ b/packages/tables/src/lib/core/renderers/Tick.svelte @@ -37,6 +37,7 @@ const fPercentage = format('0.0%'); // This suppresses warnings due to the RowRenderer providing props that aren't used. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $$restProps; diff --git a/packages/tables/src/lib/table/menus/EncodingType.svelte b/packages/tables/src/lib/table/menus/EncodingType.svelte index dc9c88be..a597b760 100644 --- a/packages/tables/src/lib/table/menus/EncodingType.svelte +++ b/packages/tables/src/lib/table/menus/EncodingType.svelte @@ -122,6 +122,8 @@ } col.column.renderer = aggregatedRenderer[selectedColumnEncoding]; }; + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $: selectedColumnEncoding && setColumnEncoding(); From b5b339955060dbda9228781e8b865a8cf6da4a7f Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Thu, 2 Jan 2025 15:24:01 +0000 Subject: [PATCH 06/14] fix linitng of maps --- packages/maps/src/lib/map/Map.svelte | 2 ++ .../src/lib/mapControlFullscreen/MapControlFullscreen.svelte | 1 + .../lib/mapControlLocationSearch/MapControlGeocoder.svelte | 2 ++ .../lib/mapControlLocationSearch/MapControlGeolocator.svelte | 2 ++ packages/maps/src/lib/mapDeckOverlay/MapDeckOverlay.svelte | 2 ++ packages/maps/src/lib/mapLayerSource/MapLayerSource.svelte | 4 ++++ .../geojsonMapLayerSource/GeoJSONMapLayerSource.svelte | 2 ++ packages/maps/src/lib/mapLayerView/MapLayerView.svelte | 4 ++++ 8 files changed, 19 insertions(+) diff --git a/packages/maps/src/lib/map/Map.svelte b/packages/maps/src/lib/map/Map.svelte index 80e80ac9..24bd9318 100644 --- a/packages/maps/src/lib/map/Map.svelte +++ b/packages/maps/src/lib/map/Map.svelte @@ -142,6 +142,8 @@ // client width and height because on:resize won't always trigger refresh. let clientWidth = 0; let clientHeight = 0; + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $: clientWidth && clientHeight && $mapStore?.resize(); diff --git a/packages/maps/src/lib/mapControlFullscreen/MapControlFullscreen.svelte b/packages/maps/src/lib/mapControlFullscreen/MapControlFullscreen.svelte index cb00617f..b6e838d2 100644 --- a/packages/maps/src/lib/mapControlFullscreen/MapControlFullscreen.svelte +++ b/packages/maps/src/lib/mapControlFullscreen/MapControlFullscreen.svelte @@ -69,6 +69,7 @@ return; } + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $isFullscreen ? mode.exitFullscreen() : mode.enterFullscreen(); if (event.detail > 0) { diff --git a/packages/maps/src/lib/mapControlLocationSearch/MapControlGeocoder.svelte b/packages/maps/src/lib/mapControlLocationSearch/MapControlGeocoder.svelte index b54adad1..f9c9e81c 100644 --- a/packages/maps/src/lib/mapControlLocationSearch/MapControlGeocoder.svelte +++ b/packages/maps/src/lib/mapControlLocationSearch/MapControlGeocoder.svelte @@ -76,6 +76,8 @@ }; let showClearButton = false; + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $: !showClearButton && clearFeature('geocoder', $mapStore); diff --git a/packages/maps/src/lib/mapControlLocationSearch/MapControlGeolocator.svelte b/packages/maps/src/lib/mapControlLocationSearch/MapControlGeolocator.svelte index 7df853c9..30cc1205 100644 --- a/packages/maps/src/lib/mapControlLocationSearch/MapControlGeolocator.svelte +++ b/packages/maps/src/lib/mapControlLocationSearch/MapControlGeolocator.svelte @@ -43,6 +43,8 @@ }; let showClearButton = false; + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $: !showClearButton && clearFeature('geolocator', $mapStore); diff --git a/packages/maps/src/lib/mapDeckOverlay/MapDeckOverlay.svelte b/packages/maps/src/lib/mapDeckOverlay/MapDeckOverlay.svelte index e56133f4..2d866813 100644 --- a/packages/maps/src/lib/mapDeckOverlay/MapDeckOverlay.svelte +++ b/packages/maps/src/lib/mapDeckOverlay/MapDeckOverlay.svelte @@ -26,6 +26,7 @@ let deckOverlay; const removeOverlay = () => { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions deckOverlay && $mapStore.removeControl(deckOverlay); }; @@ -49,6 +50,7 @@ }; const updateLayers = (newLayers) => { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions deckOverlay && deckOverlay.setProps({ layers: newLayers }); }; diff --git a/packages/maps/src/lib/mapLayerSource/MapLayerSource.svelte b/packages/maps/src/lib/mapLayerSource/MapLayerSource.svelte index d9e06bad..7e56080f 100644 --- a/packages/maps/src/lib/mapLayerSource/MapLayerSource.svelte +++ b/packages/maps/src/lib/mapLayerSource/MapLayerSource.svelte @@ -61,12 +61,16 @@ $mapStore.addSource(id, safeSpec); loaded.set(true); + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions onLoad && onLoad({ id, spec: safeSpec }); }; const doUnload = () => { loaded.set(false); removeSource(); + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions onUnload && onUnload({ id, spec: safeSpec }); }; diff --git a/packages/maps/src/lib/mapLayerSource/adaptations/geojsonMapLayerSource/GeoJSONMapLayerSource.svelte b/packages/maps/src/lib/mapLayerSource/adaptations/geojsonMapLayerSource/GeoJSONMapLayerSource.svelte index 0baddc05..9d01ed25 100644 --- a/packages/maps/src/lib/mapLayerSource/adaptations/geojsonMapLayerSource/GeoJSONMapLayerSource.svelte +++ b/packages/maps/src/lib/mapLayerSource/adaptations/geojsonMapLayerSource/GeoJSONMapLayerSource.svelte @@ -80,6 +80,7 @@ loaded = true; if (!url) { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions onLoad && onLoad({ ...ctx, geojson: initialData }); return; } @@ -100,6 +101,7 @@ return geojson; }) .then((geojson) => { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions onLoad && onLoad({ ...ctx, geojson }); return geojson; }) diff --git a/packages/maps/src/lib/mapLayerView/MapLayerView.svelte b/packages/maps/src/lib/mapLayerView/MapLayerView.svelte index 439381f1..7588a8a0 100644 --- a/packages/maps/src/lib/mapLayerView/MapLayerView.svelte +++ b/packages/maps/src/lib/mapLayerView/MapLayerView.svelte @@ -81,12 +81,16 @@ $mapStore.addLayer(safeSpec, beforeId); loaded.set(true); + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions onLoad && onLoad({ id, spec: safeSpec }); }; const doUnload = () => { loaded.set(false); removeLayer(); + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions onUnload && onUnload({ id, spec: safeSpec }); }; From ccf607c42af9f686ebc672320e9a352d6be72ec0 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Thu, 2 Jan 2025 15:31:44 +0000 Subject: [PATCH 07/14] fix dependency version inconsistency --- packages/ui/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/package.json b/packages/ui/package.json index c5aaf45f..da3d370e 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -58,8 +58,8 @@ "@sveltejs/package": "^2.3.0", "@sveltejs/vite-plugin-svelte": "^3.0.2", "@types/d3": "^7.4.3", - "@typescript-eslint/eslint-plugin": "^7.2.0", - "@typescript-eslint/parser": "^7.2.0", + "@typescript-eslint/eslint-plugin": "^8.19.0", + "@typescript-eslint/parser": "^8.19.0", "autoprefixer": "^10.4.18", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", From 3b8379ba9a71f06438549964814f14b69d61846e Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Thu, 2 Jan 2025 15:41:35 +0000 Subject: [PATCH 08/14] fix linting in ui package --- packages/ui/eslint.config.mjs | 3 ++- packages/ui/src/lib/analytics/CookieControlSettings.svelte | 2 +- packages/ui/src/lib/geolocation/Geocoder.svelte | 4 ++++ packages/ui/src/lib/themeSwitcher/Theme.svelte | 3 +++ packages/ui/src/lib/tooltip/Tooltip.svelte | 2 ++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/ui/eslint.config.mjs b/packages/ui/eslint.config.mjs index 53e09c3a..879142e0 100644 --- a/packages/ui/eslint.config.mjs +++ b/packages/ui/eslint.config.mjs @@ -61,7 +61,8 @@ export default [ 'warn', { argsIgnorePattern: '^_', - varsIgnorePattern: '^_' + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_' } ] } diff --git a/packages/ui/src/lib/analytics/CookieControlSettings.svelte b/packages/ui/src/lib/analytics/CookieControlSettings.svelte index 8d9d92f7..2fd29019 100644 --- a/packages/ui/src/lib/analytics/CookieControlSettings.svelte +++ b/packages/ui/src/lib/analytics/CookieControlSettings.svelte @@ -16,7 +16,7 @@ } return false; - } catch (err) { + } catch (_err) { return false; } }; diff --git a/packages/ui/src/lib/geolocation/Geocoder.svelte b/packages/ui/src/lib/geolocation/Geocoder.svelte index d243baff..bd21bbda 100644 --- a/packages/ui/src/lib/geolocation/Geocoder.svelte +++ b/packages/ui/src/lib/geolocation/Geocoder.svelte @@ -106,6 +106,8 @@ .then((res) => res || []) .catch((err: unknown) => { console.error('[Location Search] Search suggestions could not be retrieved.'); + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions onSearchError && onSearchError(err as GeolocationSearchError); return []; }); @@ -136,6 +138,7 @@ silentQueryTextUpdate = true; } + // eslint-disable-next-line @typescript-eslint/no-unused-expressions onLocationSelected && onLocationSelected(suggestion); }; @@ -275,6 +278,7 @@ }; $: { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions query; if (!silentQueryTextUpdate) { scheduleUpdate(); diff --git a/packages/ui/src/lib/themeSwitcher/Theme.svelte b/packages/ui/src/lib/themeSwitcher/Theme.svelte index cd43885a..ef7e4bed 100644 --- a/packages/ui/src/lib/themeSwitcher/Theme.svelte +++ b/packages/ui/src/lib/themeSwitcher/Theme.svelte @@ -5,7 +5,10 @@ import { prefersDarkMode } from '../userPreference/mediaQueryStore'; import { currentThemeMode, userThemeSelectionStore } from './themeStore'; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $: $prefersDarkMode, applyTheme(); + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $: $userThemeSelectionStore, applyTheme(); const applyTheme = () => { diff --git a/packages/ui/src/lib/tooltip/Tooltip.svelte b/packages/ui/src/lib/tooltip/Tooltip.svelte index 8bc9fcba..b68fbdd7 100644 --- a/packages/ui/src/lib/tooltip/Tooltip.svelte +++ b/packages/ui/src/lib/tooltip/Tooltip.svelte @@ -45,6 +45,8 @@ bottom: 'top', left: 'right' }[placement.split('-')[0]]; + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions $arrowRef && Object.assign($arrowRef.style, { left: x != null ? `${x}px` : '', From caa9fe99be725624761419eb1b45d41f03b722e2 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Thu, 2 Jan 2025 15:45:39 +0000 Subject: [PATCH 09/14] try to overrid verison of @typescript-eslint/eslint-plugin in melt-ui --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9185ce27..57e4e312 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "html2canvas": "^1.4.1" }, "devDependencies": { + "@typescript-eslint/eslint-plugin": "^8.19.0", "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.17.0", "@ldn-viz/eslint-config-custom": "*", @@ -34,6 +35,7 @@ "packageManager": "npm@9.5.0", "overrides": { "esbuild": "0.24.0", - "eslint": "^9.17.0" + "eslint": "^9.17.0", + "@typescript-eslint/eslint-plugin": "^8.19.0" } } From 7d3d81bb63f76be757ab8b20f01b400d0a667ba1 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Thu, 2 Jan 2025 15:54:57 +0000 Subject: [PATCH 10/14] fix inconsistent eslint versions --- packages/ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/package.json b/packages/ui/package.json index da3d370e..eab21ca0 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -61,7 +61,7 @@ "@typescript-eslint/eslint-plugin": "^8.19.0", "@typescript-eslint/parser": "^8.19.0", "autoprefixer": "^10.4.18", - "eslint": "^8.57.0", + "eslint": "^9.17.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.35.1", "postcss": "^8.4.35", From 6c6601fd733cc7ba1dd6195837abbfd3487bda81 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Thu, 2 Jan 2025 15:56:47 +0000 Subject: [PATCH 11/14] try removing an override --- packages/eslint-config-custom/index.js | 36 -------------------------- 1 file changed, 36 deletions(-) delete mode 100644 packages/eslint-config-custom/index.js diff --git a/packages/eslint-config-custom/index.js b/packages/eslint-config-custom/index.js deleted file mode 100644 index baa8ceda..00000000 --- a/packages/eslint-config-custom/index.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = { - parser: '@typescript-eslint/parser', - extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'turbo', 'prettier'], - plugins: ['svelte', '@typescript-eslint'], - ignorePatterns: ['*.cjs'], - overrides: [ - { - files: ['*.svelte'], - parser: 'svelte-eslint-parser', - // Parse the `