-
- new OpenJosm(state.osmConnection, state.mapProperties.bounds).SetClass("w-full")}
- />
+
diff --git a/src/UI/Wikipedia/WikipediaArticle.svelte b/src/UI/Wikipedia/WikipediaArticle.svelte
index 9ffba16e4..ab37314ef 100644
--- a/src/UI/Wikipedia/WikipediaArticle.svelte
+++ b/src/UI/Wikipedia/WikipediaArticle.svelte
@@ -9,6 +9,7 @@
import WikidataPreviewBox from "./WikidataPreviewBox"
import Tr from "../Base/Tr.svelte"
import Translations from "../i18n/Translations"
+ import Wikipedia from "../../assets/svg/Wikipedia.svelte";
/**
* Shows a wikipedia-article + wikidata preview for the given item
@@ -18,7 +19,7 @@
{#if $wikipediaDetails.articleUrl}
-
+
{/if}
diff --git a/src/assets/svg/No_checkmark.svelte b/src/assets/svg/No_checkmark.svelte
deleted file mode 100644
index a0721c478..000000000
--- a/src/assets/svg/No_checkmark.svelte
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
\ No newline at end of file
diff --git a/src/assets/svg/None.svelte b/src/assets/svg/None.svelte
deleted file mode 100644
index d9222c9c8..000000000
--- a/src/assets/svg/None.svelte
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
\ No newline at end of file
diff --git a/src/assets/svg/Star_outline_half.svelte b/src/assets/svg/Star_outline_half.svelte
deleted file mode 100644
index 1c209b5e5..000000000
--- a/src/assets/svg/Star_outline_half.svelte
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/assets/svg/Wikipedia.svelte b/src/assets/svg/Wikipedia.svelte
index fa9d45da1..6164f2f83 100644
--- a/src/assets/svg/Wikipedia.svelte
+++ b/src/assets/svg/Wikipedia.svelte
@@ -1,4 +1,4 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/test/CodeQuality.spec.ts b/test/CodeQuality.spec.ts
index dcf5d27eb..513fcaafb 100644
--- a/test/CodeQuality.spec.ts
+++ b/test/CodeQuality.spec.ts
@@ -4,14 +4,16 @@ import { describe, it } from "vitest"
import { parse as parse_html } from "node-html-parser"
import { readFileSync } from "fs"
import ScriptUtils from "../scripts/ScriptUtils"
-
+function detectInCode(forbidden: string, reason: string) {
+ return wrap(detectInCodeUnwrapped(forbidden, reason))
+}
/**
*
* @param forbidden: a GREP-regex. This means that '.' is a wildcard and should be escaped to match a literal dot
* @param reason
* @private
*/
-function detectInCode(forbidden: string, reason: string): Promise
{
+function detectInCodeUnwrapped(forbidden: string, reason: string): Promise {
return new Promise((done) => {
const excludedDirs = [
".git",
@@ -24,37 +26,35 @@ function detectInCode(forbidden: string, reason: string): Promise {
".idea/",
]
- exec(
+ const command =
'grep -n "' +
- forbidden +
- '" -r . ' +
- excludedDirs.map((d) => "--exclude-dir=" + d).join(" "),
- (error, stdout, stderr) => {
- if (error?.message?.startsWith("Command failed: grep")) {
- console.warn("Command failed!", error)
- return
- }
- if (error !== null) {
- throw error
- }
- if (stderr !== "") {
- throw stderr
- }
-
- const found = stdout
- .split("\n")
- .filter((s) => s !== "")
- .filter((s) => !s.startsWith("./test/"))
- if (found.length > 0) {
- const msg = `Found a '${forbidden}' at \n ${found.join(
- "\n "
- )}.\n ${reason}`
- console.error(msg)
- console.error(found.length, "issues found")
- throw msg
- }
+ forbidden +
+ '" -r . ' +
+ excludedDirs.map((d) => "--exclude-dir=" + d).join(" ")
+ console.log(command)
+ exec(command, (error, stdout, stderr) => {
+ if (error?.message?.startsWith("Command failed: grep")) {
+ console.warn("Command failed!", error)
+ throw error
}
- )
+ if (error !== null) {
+ throw error
+ }
+ if (stderr !== "") {
+ throw stderr
+ }
+
+ const found = stdout
+ .split("\n")
+ .filter((s) => s !== "")
+ .filter((s) => !s.startsWith("./test/"))
+ if (found.length > 0) {
+ const msg = `Found a '${forbidden}' at \n ${found.join("\n ")}.\n ${reason}`
+ console.error(msg)
+ console.error(found.length, "issues found")
+ throw msg
+ }
+ })
})
}
@@ -64,10 +64,6 @@ function wrap(promise: Promise): (done: () => void) => void {
}
}
-function itAsync(name: string, promise: Promise) {
- it(name, wrap(promise))
-}
-
function validateScriptIntegrityOf(path: string) {
const htmlContents = readFileSync(path, "utf8")
const doc = parse_html(htmlContents)
@@ -95,7 +91,7 @@ function validateScriptIntegrityOf(path: string) {
}
describe("Code quality", () => {
- itAsync(
+ it(
"should not contain reverse",
detectInCode(
"reverse()",
@@ -103,12 +99,12 @@ describe("Code quality", () => {
)
)
- itAsync(
+ it(
"should not contain 'constructor.name'",
detectInCode("constructor\\.name", "This is not allowed, as minification does erase names.")
)
- itAsync(
+ it(
"should not contain 'innerText'",
detectInCode(
"innerText",