Chore: lint code

This commit is contained in:
Pieter Vander Vennet 2024-10-19 14:48:48 +02:00
parent 40e894df8b
commit 8173fb15b9
7 changed files with 29 additions and 38 deletions

12
package-lock.json generated
View file

@ -7980,9 +7980,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001668",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001668.tgz",
"integrity": "sha512-nWLrdxqCdblixUO+27JtGJJE/txpJlyUy5YN1u53wLZkP0emYCo5zgS6QYft7VUYR42LGgi/S5hdLZTrnyIddw==",
"version": "1.0.30001669",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz",
"integrity": "sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w==",
"dev": true,
"funding": [
{
@ -26810,9 +26810,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30001668",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001668.tgz",
"integrity": "sha512-nWLrdxqCdblixUO+27JtGJJE/txpJlyUy5YN1u53wLZkP0emYCo5zgS6QYft7VUYR42LGgi/S5hdLZTrnyIddw==",
"version": "1.0.30001669",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz",
"integrity": "sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w==",
"dev": true
},
"canonicalize": {

View file

@ -45,10 +45,7 @@ class LuaSnippets {
})
const features = or.map((t) => t.asHumanString(false, false, {}))
features.sort()
console.log(
"Polygon features are:",
features
)
console.log("Polygon features are:", features)
return { blacklist: new Or(blacklisted), whitelisted: new Or(or) }
}

View file

@ -167,13 +167,10 @@ describe("ImageProviders", () => {
id: "196804715753265",
captured_at: 1627748022000,
"compass_angle": 0,
"geometry": {
"type": "Point",
"coordinates": [
3.2153751999722,
51.215653199972
]
compass_angle: 0,
geometry: {
type: "Point",
coordinates: [3.2153751999722, 51.215653199972],
},
creator: {
username: "filipc",

View file

@ -1,6 +1,9 @@
import { Utils } from "../../../../src/Utils"
import { OsmRelation } from "../../../../src/Logic/Osm/OsmObject"
import { InPlaceReplacedmentRTSH, TurnRestrictionRSH } from "../../../../src/Logic/Osm/Actions/RelationSplitHandler"
import {
InPlaceReplacedmentRTSH,
TurnRestrictionRSH,
} from "../../../../src/Logic/Osm/Actions/RelationSplitHandler"
import { Changes } from "../../../../src/Logic/Osm/Changes"
import { describe, expect, it } from "vitest"
import OsmObjectDownloader from "../../../../src/Logic/Osm/OsmObjectDownloader"

View file

@ -8,7 +8,6 @@ import { Changes } from "../../../../src/Logic/Osm/Changes"
import FullNodeDatabaseSource from "../../../../src/Logic/FeatureSource/TiledFeatureSource/FullNodeDatabaseSource"
describe("ReplaceGeometryAction", () => {
const coordinates = <[number, number][]>[
[3.216690793633461, 51.21474084112525],
[3.2167256623506546, 51.214696737309964],

View file

@ -2748,9 +2748,7 @@ describe("SplitAction", () => {
const splitAction = new SplitAction("way/941079939", [splitPointAroundP3], {
theme: "test",
})
const changes = await splitAction.Perform(
Changes.createTestObject()
)
const changes = await splitAction.Perform(Changes.createTestObject())
console.log(changes)
// 8715440368 is the expected point of the split
@ -2788,9 +2786,7 @@ describe("SplitAction", () => {
{ theme: "test" },
1
)
const changes = await splitAction.Perform(
Changes.createTestObject()
)
const changes = await splitAction.Perform(Changes.createTestObject())
// THe first change is the creation of the new node
expect(changes[0].type).toEqual("node")

View file

@ -7,8 +7,7 @@ import { describe, expect, it } from "vitest"
function elstorage() {
return {
addAlias: (_, __) => {
},
addAlias: (_, __) => {},
}
}
@ -19,7 +18,7 @@ function createChangesetHandler(): ChangesetHandler {
new OsmConnection({}),
elstorage(),
changes,
e => console.error(e),
(e) => console.error(e)
)
}
@ -63,13 +62,13 @@ describe("ChangesetHanlder", () => {
},
],
new Map<string, string>(),
oldChangesetMeta,
oldChangesetMeta
)
const d = Utils.asDict(rewritten)
expect(d.size).toEqual(10)
expect(d.get("answer")).toEqual("5")
expect(d.get("comment")).toEqual(
"Adding data with #MapComplete for theme #toerisme_vlaanderen",
"Adding data with #MapComplete for theme #toerisme_vlaanderen"
)
expect(d.get("created_by")).toEqual("MapComplete 0.16.6")
expect(d.get("host")).toEqual("https://mapcomplete.org/toerisme_vlaanderen.html")
@ -116,14 +115,14 @@ describe("ChangesetHanlder", () => {
},
],
new Map<string, string>(),
oldChangesetMeta,
oldChangesetMeta
)
const d = Utils.asDict(rewritten)
expect(d.size).toEqual(9)
expect(d.get("answer")).toEqual("42")
expect(d.get("comment")).toEqual(
"Adding data with #MapComplete for theme #toerisme_vlaanderen",
"Adding data with #MapComplete for theme #toerisme_vlaanderen"
)
expect(d.get("created_by")).toEqual("MapComplete 0.16.6")
expect(d.get("host")).toEqual("https://mapcomplete.org/toerisme_vlaanderen.html")
@ -163,14 +162,14 @@ describe("ChangesetHanlder", () => {
const rewritten = changesetHandler.RewriteTagsOf(
[],
new Map<string, string>([["node/-1", "node/42"]]),
oldChangesetMeta,
oldChangesetMeta
)
const d = Utils.asDict(rewritten)
expect(d.size).toEqual(9)
expect(d.get("answer")).toEqual("5")
expect(d.get("comment")).toEqual(
"Adding data with #MapComplete for theme #toerisme_vlaanderen",
"Adding data with #MapComplete for theme #toerisme_vlaanderen"
)
expect(d.get("created_by")).toEqual("MapComplete 0.16.6")
expect(d.get("host")).toEqual("https://mapcomplete.org/toerisme_vlaanderen.html")
@ -196,7 +195,7 @@ describe("ChangesetHanlder", () => {
const changes = new Map<string, string>([["node/-1", "node/42"]])
const hasSpecialMotivationChanges = ChangesetHandler.rewriteMetaTags(
extraMetaTags,
changes,
changes
)
// "Special rewrite did not trigger"
expect(hasSpecialMotivationChanges).toBe(true)