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

@ -265,7 +265,7 @@ class ClosestNObjectFunc implements ExtraFunction {
features = [features]
}
let allFeatures: Feature[][] = []
const allFeatures: Feature[][] = []
for (const spec of features) {
if (typeof spec === "string") {
const name = spec
@ -284,7 +284,7 @@ class ClosestNObjectFunc implements ExtraFunction {
}
const selfCenter = GeoOperations.centerpointCoordinates(feature)
let closestFeatures: { feat: any; distance: number }[] = []
const closestFeatures: { feat: any; distance: number }[] = []
for (const feats of allFeatures ?? []) {
for (const otherFeature of feats) {

View file

@ -25,7 +25,7 @@ export default class FeatureSourceMerger<Src extends FeatureSource = FeatureSour
this.featuresById = this._featuresById
const self = this
sources = Utils.NoNull(sources)
for (let source of sources) {
for (const source of sources) {
source.features.addCallback(() => {
self.addDataFromSources(sources)
})

View file

@ -34,7 +34,7 @@ export class PolygonSourceMerger extends UpdatableDynamicTileSource<
const zooms: Map<string, number> = new Map()
for (const source of sources) {
let z = source.z
const z = source.z
for (const f of source.features.data) {
const id = f.properties.id
if (id.endsWith("146616907")) {

View file

@ -297,7 +297,7 @@ export class ImageUploadManager {
let absoluteUrl: string
try {
;({ key, value, absoluteUrl } = await this._uploader.uploadImage(
({ key, value, absoluteUrl } = await this._uploader.uploadImage(
blob,
location,
author,

View file

@ -110,11 +110,11 @@ export class TurnRestrictionRSH extends AbstractRelationSplitHandler {
// We have to keep only the way with a common point with the rest of the relation
// Let's figure out which member is neighbouring our way
let commonStartPoint: number = await this.targetNodeAt(members.indexOf(selfMember), true)
let commonEndPoint: number = await this.targetNodeAt(members.indexOf(selfMember), false)
const commonStartPoint: number = await this.targetNodeAt(members.indexOf(selfMember), true)
const commonEndPoint: number = await this.targetNodeAt(members.indexOf(selfMember), false)
// In normal circumstances, only one of those should be defined
let commonPoint = commonStartPoint ?? commonEndPoint
const commonPoint = commonStartPoint ?? commonEndPoint
// Let's select the way to keep
const idToKeep: { id: number } = this._input.allWaysNodesInOrder

View file

@ -120,7 +120,7 @@ export default class SplitAction extends OsmChangeAction {
const allWaysNodesInOrder: number[][] = []
// Lets create OsmWays based on them
for (const wayPart of wayParts) {
let isOriginal = wayPart === longest
const isOriginal = wayPart === longest
if (isOriginal) {
// We change the existing way
const nodeIds = wayPart.map((p) => p.originalIndex)
@ -140,7 +140,7 @@ export default class SplitAction extends OsmChangeAction {
allWayIdsInOrder.push(originalElement.id)
allWaysNodesInOrder.push(nodeIds)
} else {
let id = changes.getNewID()
const id = changes.getNewID()
// Copy the tags from the original object onto the new
const kv = []
for (const k in originalElement.tags) {
@ -219,7 +219,7 @@ export default class SplitAction extends OsmChangeAction {
// - `index`: closest point was found on nth line part,
// - `dist`: distance between pt and the closest point,
// `location`: distance along the line between start and the closest point.
let projected = GeoOperations.nearestPoint(wayGeoJson, c)
const projected = GeoOperations.nearestPoint(wayGeoJson, c)
// c is lon lat
return {
coordinates: c,
@ -232,8 +232,8 @@ export default class SplitAction extends OsmChangeAction {
// We have a bunch of coordinates here: [ [lon, lon], [lat, lon], ...] ...
// We project them onto the line (which should yield pretty much the same point and add them to allPoints
for (let i = 0; i < originalPoints.length; i++) {
let originalPoint = originalPoints[i]
let projected = GeoOperations.nearestPoint(wayGeoJson, originalPoint)
const originalPoint = originalPoints[i]
const projected = GeoOperations.nearestPoint(wayGeoJson, originalPoint)
allPoints.push({
coordinates: originalPoint,
isSplitPoint: false,

View file

@ -24,7 +24,7 @@ export default class AspectedRouting {
let functionName /*: string*/ = undefined
let functionArguments /*: any */ = undefined
let otherValues = {}
const otherValues = {}
// @ts-ignore
Object.entries(program).forEach((tag) => {
const [key, value] = tag
@ -135,9 +135,9 @@ export default class AspectedRouting {
private static getFirstMatchScore(tags, order: any) {
/*Order should be a list of arguments after evaluation*/
order = <string[]>AspectedRouting.interpret(order, tags)
for (let key of order) {
for (const key of order) {
// @ts-ignore
for (let entry of Object.entries(JSON.parse(tags))) {
for (const entry of Object.entries(JSON.parse(tags))) {
const [tagKey, value] = entry
if (key === tagKey) {
// We have a match... let's evaluate the subprogram

View file

@ -247,7 +247,7 @@ export default class LinkedDataLoader {
return await LinkedDataLoader.compact(data, options)
}
let htmlContent = await Utils.download(url)
const htmlContent = await Utils.download(url)
const div = document.createElement("div")
div.innerHTML = htmlContent
const script = Array.from(div.getElementsByTagName("script")).find(

View file

@ -234,7 +234,7 @@ export default class Wikidata {
}[]
> {
const maxCount = options?.maxCount ?? 20
let pageCount = Math.min(maxCount, 50)
const pageCount = Math.min(maxCount, 50)
const start = page * pageCount - pageCount
const lang = options?.lang ?? "en"
const url =