From 47ae4cb456e29ad4c5fe2ccb75129c9cc29e30b1 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 2 Jun 2023 08:42:08 +0200 Subject: [PATCH] Chore: fix warnings --- Logic/Actors/BackgroundLayerResetter.ts | 10 +++------- Logic/FeatureSource/Actors/FeaturePropertiesStore.ts | 4 ++-- Logic/FeatureSource/FeatureSource.ts | 1 - Logic/ImageProviders/WikidataImageProvider.ts | 6 +++--- Logic/ImageProviders/WikimediaImageProvider.ts | 1 - Logic/Osm/Actions/ChangeLocationAction.ts | 1 - Logic/Osm/Actions/ChangeTagAction.ts | 1 - Logic/Osm/Actions/CreateNewWayAction.ts | 10 +++++----- Logic/Osm/Actions/SplitAction.ts | 10 +++++----- Logic/Osm/OsmConnection.ts | 1 - Logic/SimpleMetaTagger.ts | 1 - Logic/UIEventSource.ts | 8 +++----- Models/ThemeConfig/Conversion/Validation.ts | 4 ++-- Models/ThemeConfig/DeleteConfig.ts | 2 -- UI/Base/DragInvitation.svelte | 2 -- UI/Base/LoginToggle.svelte | 1 - UI/Base/SubtleLink.svelte | 2 +- UI/BigComponents/BackgroundSwitcher.svelte | 2 -- UI/BigComponents/NoThemeResultButton.svelte | 1 - UI/BigComponents/TagRenderingChart.ts | 2 +- UI/InputElement/Validator.ts | 8 +++----- UI/InputElement/Validators/WikidataValidator.ts | 3 --- UI/Popup/AddNewPoint/PresetList.svelte | 1 - UI/Popup/AllTagsPanel.svelte | 8 ++++---- UI/Popup/ExportAsGpxViz.ts | 12 ++++++------ UI/Popup/ImportButtons/WayImportButtonViz.ts | 2 +- UI/Popup/MoveWizard.ts | 1 - UI/Popup/TagApplyButton.ts | 2 +- UI/Popup/TagRendering/FreeformInput.svelte | 1 - UI/Popup/UploadToOsmViz.ts | 8 ++------ UI/SpecialVisualizations.ts | 3 +-- UI/ThemeViewGUI.svelte | 2 -- UI/Wikipedia/WikipediaBoxOptions.ts | 2 -- UI/Wikipedia/WikipediaTitle.svelte | 1 - scripts/CycleHighwayFix.ts | 1 - scripts/generateCache.ts | 4 ++-- scripts/generateIncludedImages.ts | 1 - test/Logic/Actors/Actors.spec.ts | 9 ++++----- 38 files changed, 49 insertions(+), 90 deletions(-) diff --git a/Logic/Actors/BackgroundLayerResetter.ts b/Logic/Actors/BackgroundLayerResetter.ts index 3fe254208a..6d599827bb 100644 --- a/Logic/Actors/BackgroundLayerResetter.ts +++ b/Logic/Actors/BackgroundLayerResetter.ts @@ -1,10 +1,6 @@ -import { Store, UIEventSource } from "../UIEventSource" -import { Utils } from "../../Utils" -import { - AvailableRasterLayers, - RasterLayerPolygon, - RasterLayerUtils, -} from "../../Models/RasterLayers" +import {Store, UIEventSource} from "../UIEventSource" +import {Utils} from "../../Utils" +import {RasterLayerPolygon, RasterLayerUtils,} from "../../Models/RasterLayers" /** * When a user pans around on the map, they might pan out of the range of the current background raster layer. diff --git a/Logic/FeatureSource/Actors/FeaturePropertiesStore.ts b/Logic/FeatureSource/Actors/FeaturePropertiesStore.ts index 96f70e4f53..3ff9dd6e09 100644 --- a/Logic/FeatureSource/Actors/FeaturePropertiesStore.ts +++ b/Logic/FeatureSource/Actors/FeaturePropertiesStore.ts @@ -1,5 +1,5 @@ -import { FeatureSource, IndexedFeatureSource } from "../FeatureSource" -import { UIEventSource } from "../../UIEventSource" +import {FeatureSource} from "../FeatureSource" +import {UIEventSource} from "../../UIEventSource" /** * Constructs a UIEventStore for the properties of every Feature, indexed by id diff --git a/Logic/FeatureSource/FeatureSource.ts b/Logic/FeatureSource/FeatureSource.ts index 2788a4b628..3b9798dbba 100644 --- a/Logic/FeatureSource/FeatureSource.ts +++ b/Logic/FeatureSource/FeatureSource.ts @@ -1,6 +1,5 @@ import { Store, UIEventSource } from "../UIEventSource" import FilteredLayer from "../../Models/FilteredLayer" -import { BBox } from "../BBox" import { Feature } from "geojson" export interface FeatureSource { diff --git a/Logic/ImageProviders/WikidataImageProvider.ts b/Logic/ImageProviders/WikidataImageProvider.ts index 093153ab51..043fee4b74 100644 --- a/Logic/ImageProviders/WikidataImageProvider.ts +++ b/Logic/ImageProviders/WikidataImageProvider.ts @@ -12,8 +12,8 @@ export class WikidataImageProvider extends ImageProvider { super() } - public SourceIcon(backlinkSource?: string): BaseUIElement { - throw Svg.wikidata_svg() + public SourceIcon(_?: string): BaseUIElement { + return Svg.wikidata_svg() } public async ExtractUrls(key: string, value: string): Promise[]> { @@ -48,7 +48,7 @@ export class WikidataImageProvider extends ImageProvider { return allImages } - public DownloadAttribution(url: string): Promise { + public DownloadAttribution(_: string): Promise { throw new Error("Method not implemented; shouldn't be needed!") } } diff --git a/Logic/ImageProviders/WikimediaImageProvider.ts b/Logic/ImageProviders/WikimediaImageProvider.ts index 0b75982fd8..f9f40261db 100644 --- a/Logic/ImageProviders/WikimediaImageProvider.ts +++ b/Logic/ImageProviders/WikimediaImageProvider.ts @@ -80,7 +80,6 @@ export class WikimediaImageProvider extends ImageProvider { } public PrepUrl(value: string): ProvidedImage { - const hasCommonsPrefix = WikimediaImageProvider.startsWithCommonsPrefix(value) value = WikimediaImageProvider.removeCommonsPrefix(value) if (value.startsWith("File:")) { diff --git a/Logic/Osm/Actions/ChangeLocationAction.ts b/Logic/Osm/Actions/ChangeLocationAction.ts index a0bcf97dbf..e5d2b8486d 100644 --- a/Logic/Osm/Actions/ChangeLocationAction.ts +++ b/Logic/Osm/Actions/ChangeLocationAction.ts @@ -1,6 +1,5 @@ import { ChangeDescription } from "./ChangeDescription" import OsmChangeAction from "./OsmChangeAction" -import { Changes } from "../Changes" export default class ChangeLocationAction extends OsmChangeAction { private readonly _id: number diff --git a/Logic/Osm/Actions/ChangeTagAction.ts b/Logic/Osm/Actions/ChangeTagAction.ts index 2e28a788b8..1abfb67989 100644 --- a/Logic/Osm/Actions/ChangeTagAction.ts +++ b/Logic/Osm/Actions/ChangeTagAction.ts @@ -1,5 +1,4 @@ import OsmChangeAction from "./OsmChangeAction" -import { Changes } from "../Changes" import { ChangeDescription } from "./ChangeDescription" import { TagsFilter } from "../../Tags/TagsFilter" import { OsmTags } from "../../../Models/OsmFeature" diff --git a/Logic/Osm/Actions/CreateNewWayAction.ts b/Logic/Osm/Actions/CreateNewWayAction.ts index 2cf638bc6e..50e2628a61 100644 --- a/Logic/Osm/Actions/CreateNewWayAction.ts +++ b/Logic/Osm/Actions/CreateNewWayAction.ts @@ -1,9 +1,9 @@ -import { ChangeDescription } from "./ChangeDescription" -import {OsmCreateAction, PreviewableAction} from "./OsmChangeAction" -import { Changes } from "../Changes" -import { Tag } from "../../Tags/Tag" +import {ChangeDescription} from "./ChangeDescription" +import {OsmCreateAction} from "./OsmChangeAction" +import {Changes} from "../Changes" +import {Tag} from "../../Tags/Tag" import CreateNewNodeAction from "./CreateNewNodeAction" -import { And } from "../../Tags/And" +import {And} from "../../Tags/And" export default class CreateNewWayAction extends OsmCreateAction { public newElementId: string = undefined diff --git a/Logic/Osm/Actions/SplitAction.ts b/Logic/Osm/Actions/SplitAction.ts index 7b15b57eec..b4a8a93a35 100644 --- a/Logic/Osm/Actions/SplitAction.ts +++ b/Logic/Osm/Actions/SplitAction.ts @@ -1,10 +1,10 @@ -import { OsmObject, OsmWay } from "../OsmObject" -import { Changes } from "../Changes" -import { GeoOperations } from "../../GeoOperations" +import {OsmWay} from "../OsmObject" +import {Changes} from "../Changes" +import {GeoOperations} from "../../GeoOperations" import OsmChangeAction from "./OsmChangeAction" -import { ChangeDescription } from "./ChangeDescription" +import {ChangeDescription} from "./ChangeDescription" import RelationSplitHandler from "./RelationSplitHandler" -import { Feature, LineString } from "geojson" +import {Feature, LineString} from "geojson" import OsmObjectDownloader from "../OsmObjectDownloader" interface SplitInfo { diff --git a/Logic/Osm/OsmConnection.ts b/Logic/Osm/OsmConnection.ts index ee9f3510c0..a14d308497 100644 --- a/Logic/Osm/OsmConnection.ts +++ b/Logic/Osm/OsmConnection.ts @@ -2,7 +2,6 @@ import osmAuth from "osm-auth" import { Store, Stores, UIEventSource } from "../UIEventSource" import { OsmPreferences } from "./OsmPreferences" import { Utils } from "../../Utils" -import { OsmObject } from "./OsmObject" export default class UserDetails { public loggedIn = false diff --git a/Logic/SimpleMetaTagger.ts b/Logic/SimpleMetaTagger.ts index cd3e9b3974..c3e34653e2 100644 --- a/Logic/SimpleMetaTagger.ts +++ b/Logic/SimpleMetaTagger.ts @@ -10,7 +10,6 @@ import { CountryCoder } from "latlon2country" import Constants from "../Models/Constants" import { TagUtils } from "./Tags/TagUtils" import { Feature, LineString } from "geojson" -import { OsmObject } from "./Osm/OsmObject" import { OsmTags } from "../Models/OsmFeature" import { UIEventSource } from "./UIEventSource" import LayoutConfig from "../Models/ThemeConfig/LayoutConfig" diff --git a/Logic/UIEventSource.ts b/Logic/UIEventSource.ts index e0aa166229..c9b70de78e 100644 --- a/Logic/UIEventSource.ts +++ b/Logic/UIEventSource.ts @@ -264,10 +264,8 @@ export abstract class Store implements Readable { /** * Same as 'addCallbackAndRun', added to be compatible with Svelte - * @param run - * @param invalidate */ - public subscribe(run: Subscriber & ((value: T) => void), invalidate?): Unsubscriber { + public subscribe(run: Subscriber & ((value: T) => void), _?): Unsubscriber { // We don't need to do anything with 'invalidate', see // https://github.com/sveltejs/svelte/issues/3859 @@ -288,7 +286,7 @@ export class ImmutableStore extends Store { this.data = data } - addCallback(callback: (data: T) => void): () => void { + addCallback(_: (data: T) => void): () => void { // pass: data will never change return ImmutableStore.pass } @@ -307,7 +305,7 @@ export class ImmutableStore extends Store { return ImmutableStore.pass } - addCallbackD(callback: (data: T) => void): () => void { + addCallbackD(_: (data: T) => void): () => void { // pass: data will never change return ImmutableStore.pass } diff --git a/Models/ThemeConfig/Conversion/Validation.ts b/Models/ThemeConfig/Conversion/Validation.ts index 1a14d735dd..c61f06e454 100644 --- a/Models/ThemeConfig/Conversion/Validation.ts +++ b/Models/ThemeConfig/Conversion/Validation.ts @@ -302,7 +302,7 @@ class OverrideShadowingCheck extends DesugaringStep { convert( json: LayoutConfigJson, - context: string + _: string ): { result: LayoutConfigJson; errors?: string[]; warnings?: string[] } { const overrideAll = json.overrideAll if (overrideAll === undefined) { @@ -973,7 +973,7 @@ export class DetectDuplicateFilters extends DesugaringStep<{ convert( json: { layers: LayerConfigJson[]; themes: LayoutConfigJson[] }, - context: string + __: string ): { result: { layers: LayerConfigJson[]; themes: LayoutConfigJson[] } errors?: string[] diff --git a/Models/ThemeConfig/DeleteConfig.ts b/Models/ThemeConfig/DeleteConfig.ts index 9a9d0f4a4c..f5b2db0361 100644 --- a/Models/ThemeConfig/DeleteConfig.ts +++ b/Models/ThemeConfig/DeleteConfig.ts @@ -3,11 +3,9 @@ import { TagsFilter } from "../../Logic/Tags/TagsFilter" import { DeleteConfigJson } from "./Json/DeleteConfigJson" import Translations from "../../UI/i18n/Translations" import { TagUtils } from "../../Logic/Tags/TagUtils" -import TagRenderingEditable from "../../UI/Popup/TagRendering/TagRenderingEditable.svelte"; import TagRenderingConfig from "./TagRenderingConfig"; import {QuestionableTagRenderingConfigJson} from "./Json/QuestionableTagRenderingConfigJson"; import {TagConfigJson} from "./Json/TagConfigJson"; -import {del} from "idb-keyval"; export default class DeleteConfig { public static readonly deleteReasonKey = "_delete_reason" diff --git a/UI/Base/DragInvitation.svelte b/UI/Base/DragInvitation.svelte index 333588e538..93b1265c4a 100644 --- a/UI/Base/DragInvitation.svelte +++ b/UI/Base/DragInvitation.svelte @@ -3,8 +3,6 @@ * This overlay element will regularly show a hand that swipes over the underlying element. * This element will hide as soon as the Store 'hideSignal' receives a change (which is not undefined) */ - import ToSvelte from "./ToSvelte.svelte"; - import Svg from "../../Svg"; import { Store } from "../../Logic/UIEventSource"; import { onDestroy } from "svelte"; diff --git a/UI/Base/LoginToggle.svelte b/UI/Base/LoginToggle.svelte index 6f848e9cf9..3f3ab19e58 100644 --- a/UI/Base/LoginToggle.svelte +++ b/UI/Base/LoginToggle.svelte @@ -1,6 +1,5 @@