chore: automatic fix some linting errors, update lint config

This commit is contained in:
Pieter Vander Vennet 2025-06-18 21:52:03 +02:00
parent 04c8ccb0d2
commit 804280511b
26 changed files with 47 additions and 45 deletions

View file

@ -156,7 +156,7 @@ export default class Hotkeys {
}
const contents: string[][] = this.prepareDocumentation(docs).map(
([key, doc, alsoTriggeredBy]) => {
let keyEl: string = [key, ...(alsoTriggeredBy ?? [])]
const keyEl: string = [key, ...(alsoTriggeredBy ?? [])]
.map((k) => "`" + t(k) + "`")
.join(" ")
return [keyEl, t(doc)]

View file

@ -10,7 +10,7 @@
* Show the button, even though we are logged in
*/
export let forceShow: boolean = false
export let msg: String = undefined
export let msg: string = undefined
if (osmConnection === undefined) {
console.error("No osmConnection passed into loginButton")
}

View file

@ -24,7 +24,7 @@ export default abstract class BaseUIElement {
}
AttachTo(divId: string) {
let element = document.getElementById(divId)
const element = document.getElementById(divId)
if (element === null) {
if (Utils.runningFromConsole) {
this.ConstructElement()
@ -78,7 +78,7 @@ export default abstract class BaseUIElement {
public RemoveClass(classes: string): BaseUIElement {
const all = classes.split(" ").map((clsName) => clsName.trim())
for (let clss of all) {
for (const clss of all) {
if (this.clss.has(clss)) {
this.clss.delete(clss)
this._constructedHtmlElement?.classList.remove(clss)

View file

@ -14,7 +14,7 @@ export class ComparisonState {
externalProperties = { ...externalProperties }
delete externalProperties["@context"]
let externalKeys: string[] = Object.keys(externalProperties).sort()
const externalKeys: string[] = Object.keys(externalProperties).sort()
const imageKeyRegex = /image|image:[0-9]+/
@ -35,7 +35,7 @@ export class ComparisonState {
)
this.propertyKeysExternal = externalKeys.filter((k) => k.match(imageKeyRegex) === null)
let propertyKeysExternal = this.propertyKeysExternal
const propertyKeysExternal = this.propertyKeysExternal
this.missing = tags.map((osmProperties) =>
propertyKeysExternal.filter((k) => {
if (k.startsWith("_")) {

View file

@ -33,7 +33,7 @@ export class ShareLinkViz implements SpecialVisualizationSvelte {
const generateShareData = () => {
const title = state?.theme?.title?.txt ?? "MapComplete"
let matchingLayer: LayerConfig = state?.theme?.getMatchingLayer(tagSource?.data)
const matchingLayer: LayerConfig = state?.theme?.getMatchingLayer(tagSource?.data)
let name =
matchingLayer?.title?.GetRenderValue(tagSource.data)?.Subs(tagSource.data)?.txt ??
tagSource.data?.name ??

View file

@ -80,7 +80,7 @@ export default class TagApplyButton implements AutoAction, SpecialVisualization
const newTags: Tag[] = []
for (const [key, value] of tgsSpec) {
if (value.indexOf("$") >= 0) {
let parts = value.split("$")
const parts = value.split("$")
// The first item of the split won't start with a '$', so no substitution needed
let actualValue = parts[0]
parts.shift()