From b9d38c958c55f8b23676fcef125a7e9661d64678 Mon Sep 17 00:00:00 2001
From: Robin van der Linde <robin.vanderlinde@gmail.com>
Date: Thu, 27 Jul 2023 14:48:17 +0200
Subject: [PATCH] Change environment, fix some linting errors

---
 .eslintrc.cjs                            | 4 ++++
 src/UI/BigComponents/OpenJosm.ts         | 4 ++--
 src/UI/BigComponents/ShareScreen.ts      | 1 +
 src/UI/DownloadFlow/DownloadPanel.svelte | 2 +-
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 226bfcb0f..ff3f3e8f9 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -20,4 +20,8 @@ module.exports = {
   ],
   plugins: ["@typescript-eslint"],
   root: true,
+  env: {
+    browser: true,
+    node: true,
+  },
 }
diff --git a/src/UI/BigComponents/OpenJosm.ts b/src/UI/BigComponents/OpenJosm.ts
index 352082a7c..8f86f6d98 100644
--- a/src/UI/BigComponents/OpenJosm.ts
+++ b/src/UI/BigComponents/OpenJosm.ts
@@ -16,7 +16,7 @@ export class OpenJosm extends Combine {
 
         const josmState = new UIEventSource<string>(undefined)
         // Reset after 15s
-        josmState.stabilized(15000).addCallbackD((_) => josmState.setData(undefined))
+        josmState.stabilized(15000).addCallbackD(() => josmState.setData(undefined))
 
         const stateIndication = new VariableUiElement(
             josmState.map((state) => {
@@ -45,7 +45,7 @@ export class OpenJosm extends Combine {
                     const josmLink = `http://127.0.0.1:8111/load_and_zoom?left=${left}&right=${right}&top=${top}&bottom=${bottom}`
                     Utils.download(josmLink)
                         .then((answer) => josmState.setData(answer.replace(/\n/g, "").trim()))
-                        .catch((_) => josmState.setData("ERROR"))
+                        .catch(() => josmState.setData("ERROR"))
                 })
                 .SetClass("w-full"),
             undefined,
diff --git a/src/UI/BigComponents/ShareScreen.ts b/src/UI/BigComponents/ShareScreen.ts
index f1956c197..14b828e6d 100644
--- a/src/UI/BigComponents/ShareScreen.ts
+++ b/src/UI/BigComponents/ShareScreen.ts
@@ -1,3 +1,4 @@
+/* eslint-disable prefer-const */
 import { VariableUiElement } from "../Base/VariableUIElement"
 import { Translation } from "../i18n/Translation"
 import Svg from "../../Svg"
diff --git a/src/UI/DownloadFlow/DownloadPanel.svelte b/src/UI/DownloadFlow/DownloadPanel.svelte
index c9b912958..220f94c3d 100644
--- a/src/UI/DownloadFlow/DownloadPanel.svelte
+++ b/src/UI/DownloadFlow/DownloadPanel.svelte
@@ -81,7 +81,7 @@
     mimetype="image/png"
     mainText={t.downloadAsPng}
     helperText={t.downloadAsPngHelper}
-    construct={(_) => state.mapProperties.exportAsPng(4)}
+    construct={() => state.mapProperties.exportAsPng(4)}
   />
 
   <div class="flex flex-col">