From 9d77e931da48d706fcb4843b532b65b9194dc273 Mon Sep 17 00:00:00 2001 From: Filip Czaplicki Date: Sun, 17 Mar 2024 13:52:34 +0100 Subject: [PATCH] Upgrade biome --- bun.lockb | Bin 149589 -> 149589 bytes package.json | 108 +++++++++--------- scripts/updateStoreBadges.ts | 2 +- src/3rdparty/reactStoreBadges.test.ts | 2 +- src/3rdparty/reactStoreBadges.tsx | 2 +- src/Main.tsx | 6 +- src/appContext.tsx | 8 +- src/backend.ts | 4 +- src/components/downloadCard.tsx | 2 +- src/components/footer.tsx | 2 +- src/components/logInButton.tsx | 2 +- src/components/map.tsx | 9 +- src/components/map_style.ts | 4 +- src/components/modal.tsx | 2 +- src/components/navbar.tsx | 2 +- src/components/partnersModal.tsx | 2 +- src/components/sidebar-left.tsx | 6 +- src/components/sidebar/buttons.tsx | 3 +- .../sidebar/defibrillatorDetails.tsx | 6 +- .../sidebar/defibrillatorEditor.tsx | 7 +- src/components/sidebar/detailTextRow.tsx | 2 +- src/components/sidebar/openingHours.tsx | 2 +- src/components/sidebar/photoReporter.tsx | 5 +- src/components/sidebar/photoUploader.tsx | 5 +- src/components/sidebar/verificationDate.tsx | 2 +- src/osm.ts | 6 +- tsconfig.json | 72 +++++------- vite.config.js | 5 +- 28 files changed, 134 insertions(+), 144 deletions(-) diff --git a/bun.lockb b/bun.lockb index 0ffe7d2a3962c1cadda351d3f5ca0984060ab5f4..b859c2464614dbfc40d406da95ba1dbf55abef7b 100755 GIT binary patch delta 1472 zcmcaQf%EDF&Ix)7Df0~FW4o%C?NxFP;o!+!Wo)mfU=rA&d0+0`?f1VM+c)}s;kmV0%NmVg0c!OD~ zKvp1_wGGJf1+$o|Vd{c_ERZ_m$rB`4Hn&v#oKf%5bYTzgq>JUVtX^-;(|-T*i<(j2 zXTx9Ljx9K1{$%s}Q*Jp-Gv{P3xcG8SoQc>1F?-j@y%Rnxh=0~5G%eD%t>--h0|O%i z3xfcVu3!WbP{5LSler;$PDxS1n@@!d$7U+&ghnJ(dEGOT_h*z{!FTbaqREXJ9}jTV z3r3mEJoEWWN;<2!I?@z3YHsJ`|+CVy`9}t zyGGJ%Ppw{lsJR|=&H`vZ+0gs4SW z#J&5l|Frf_hHN*BIsC>R-_|p-Jebt?Oh&ga2g$+J$PQ+0Fs`cf5igOQ$8lDiKOjW( zl*FBTm8Uj{R~7KF*0TwHwYHd*e*I@rm{aJ{=C>g!zGWu1)hp{aA5PYKkQx0g@FCR2 zEI_&j*EC3(EG_Siw&Zlv zxmB*tm+U8PWcye;Sts9zzpW%_6Ubbk|2aSg*CHF-^N;1D=`F{)xO>$XRdo*jS}`YW zy9bZfV|Q<%{D51$HWe!0+@Get`Xd>Qm5HwS0XVs2fy9ly}M7$7jU1 zPu^$9@lD;iZr<0fIo~&HTw1}u4Qwz22gu-hWP_iYO6D6B%rQE8WUHINZ;drKc2(%M zZGZE_^2J`KUt5g-$vpnKIQ?D&8;{iD-#$nGNwV#Kby{~u*~hv@w)(*0H%=EOH%f?a zpCZEepn};<&v1KrFXLewLr^A%!33me3x+nG-@=2yxB9ivy0UgeOKnV*}Q zRji+!lc`&tnP+UITVZB0o!^y7b^3f4CUFqKKE2n4Noe{x7bdppA6=NlrtfiKl96?J8sh^mXK|(^)S>2cvU_2cdLuh)G8f^^KYSbgK5^T! zS28e&F)%c|uV7%10Mb{0v^0?32c$vb3xTvOknRN15e~ZRxhv4h14>#JZ{c>{3q-Bh1F6u8OEvM#s9BX1=U|?im z;AjBS6+i|Iu+*Hs?bSU~fMv?NH2056oF2^1vnQ|GWT6{c86C8ypz>a${qA+LB5UgJ z-)mUSQT8)R?BgHdW%D-Wv}$l)%swNlasp@)BLfRV1CXvnHdtP4Z9?7q`k&(8st*5} zaARj|oASk}9~?7Y9zQj4g+t|$cPX1cu2=kcHBnyeM&{GUIl}&1zN#FXu!yTq>-?qX zw^G37GH?h0=_*EsdLRV>EP;-Xm@1uD?Va&wSN z*E78@cV((^%qUQf<0`^+I0#N2<4W6DyHx%I#x1{qw7Y;e&lN2k9!Cb526 z3*wJ&WR5tpMw=y@)h)iaY=eKdRm;*UhF!atyBJ5sWdA$xEN3yd<)RDQc_%cz|NZ8E z_Uz|>-M|iJ;9vpLb;#!KQFriKrao=f{>_Zq@*ACBRUJKF?`|x1X~*Or-A%UkKO<*` zSuC#zeo*y!_D`+9`)ze6JI*g<-gR-yO67gV!G~@6!3MJcoy@>ck8H3~s`V^c_a;H+ zQ;XA%xH&F3{Q9F#+$6WW#M5@ony02*-RHw}Ve@W-2`))2JK4TmDbWrn|DQeeT=b2_ zY^<+mh3;ve+$bTweToRI-J>%`=y^M!#>Lr1h8I}`S7!CD+GC+%A*&LQv5i+oX z0G68(GO(fomfsOFu)+jZA|Pb0NCC?cP&_c)Elulj!t0 zE=&^B6&#pUr`x+T2~A(%&LqZYI_(^z;`9Y>OuQgz?&)FfOrpqwKtt8g_?*+T-I#>Y h1VJ`~ZI#C=A?Jo{tjKg$cP4R!LVdVzHp(#0005B$0;K=| diff --git a/package.json b/package.json index 435fc75..6fb9f1c 100644 --- a/package.json +++ b/package.json @@ -1,56 +1,56 @@ { - "$schema": "https://json.schemastore.org/package.json", - "name": "openaedmap-frontend", - "version": "0.1.0", - "private": true, - "homepage": "/", - "type": "module", - "dependencies": { - "@maplibre/maplibre-gl-geocoder": "^1.5.0", - "@mdi/js": "^7.4.47", - "@mdi/react": "^1.6.1", - "@sentry/react": "^7.102.0", - "bulma": "^0.9.4", - "bulma-checkradio": "^2.1.3", - "events": "^3.3.0", - "i18next": "^23.9.0", - "i18next-browser-languagedetector": "^7.2.0", - "i18next-http-backend": "^2.4.3", - "maplibre-gl": "^4.0.2", - "opening_hours": "^3.8.0", - "osm-auth": "^2.4.0", - "react": "^18.2.0", - "react-bulma-components": "^4.1.0", - "react-dom": "^18.2.0", - "react-i18next": "^14.0.5", - "react-image-gallery": "^1.3.0", - "react-select": "^5.8.0", - "typescript": "^5.3.3" - }, - "engines": { - "node": ">=20.0.0" - }, - "scripts": { - "start": "bunx --bun vite", - "build": "vite build", - "typecheck": "tsc -p ./tsconfig.json --noEmit", - "lint-fix": "biome check . --apply", - "check": "biome ci .", - "test": "bun test", - "css-build": "sass sass/mystyles.scss src/mystyles.css" - }, - "devDependencies": { - "@biomejs/biome": "1.5.3", - "@sentry/vite-plugin": "^2.14.1", - "@types/bun": "^1.0.6", - "@types/node": "^20.11.19", - "@types/react": "^18.2.57", - "@types/react-dom": "^18.2.19", - "@types/react-image-gallery": "^1.2.4", - "@vitejs/plugin-react": "^4.2.1", - "bun-types": "^1.0.28", - "sass": "^1.71.0", - "vite": "^5.1.3", - "vite-plugin-sitemap": "^0.5.3" - } + "$schema": "https://json.schemastore.org/package.json", + "name": "openaedmap-frontend", + "version": "0.1.0", + "private": true, + "homepage": "/", + "type": "module", + "dependencies": { + "@maplibre/maplibre-gl-geocoder": "^1.5.0", + "@mdi/js": "^7.4.47", + "@mdi/react": "^1.6.1", + "@sentry/react": "^7.102.0", + "bulma": "^0.9.4", + "bulma-checkradio": "^2.1.3", + "events": "^3.3.0", + "i18next": "^23.9.0", + "i18next-browser-languagedetector": "^7.2.0", + "i18next-http-backend": "^2.4.3", + "maplibre-gl": "^4.0.2", + "opening_hours": "^3.8.0", + "osm-auth": "^2.4.0", + "react": "^18.2.0", + "react-bulma-components": "^4.1.0", + "react-dom": "^18.2.0", + "react-i18next": "^14.0.5", + "react-image-gallery": "^1.3.0", + "react-select": "^5.8.0", + "typescript": "^5.3.3" + }, + "engines": { + "node": ">=20.0.0" + }, + "scripts": { + "start": "bunx --bun vite", + "build": "vite build", + "typecheck": "tsc -p ./tsconfig.json --noEmit", + "lint-fix": "biome check . --apply", + "check": "biome ci .", + "test": "bun test", + "css-build": "sass sass/mystyles.scss src/mystyles.css" + }, + "devDependencies": { + "@biomejs/biome": "1.6.1", + "@sentry/vite-plugin": "^2.14.1", + "@types/bun": "^1.0.6", + "@types/node": "^20.11.19", + "@types/react": "^18.2.57", + "@types/react-dom": "^18.2.19", + "@types/react-image-gallery": "^1.2.4", + "@vitejs/plugin-react": "^4.2.1", + "bun-types": "^1.0.28", + "sass": "^1.71.0", + "vite": "^5.1.3", + "vite-plugin-sitemap": "^0.5.3" + } } diff --git a/scripts/updateStoreBadges.ts b/scripts/updateStoreBadges.ts index 886f4c5..34f21ec 100755 --- a/scripts/updateStoreBadges.ts +++ b/scripts/updateStoreBadges.ts @@ -1,5 +1,5 @@ #!/usr/bin/env bun -import * as fs from "fs"; +import * as fs from "node:fs"; import { appStorePath } from "../src/3rdparty/reactStoreBadges"; import languages from "../src/languages"; diff --git a/src/3rdparty/reactStoreBadges.test.ts b/src/3rdparty/reactStoreBadges.test.ts index ab2ba60..fb87334 100644 --- a/src/3rdparty/reactStoreBadges.test.ts +++ b/src/3rdparty/reactStoreBadges.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import * as fs from "fs"; +import * as fs from "node:fs"; import { appStorePath, googlePlayPath } from "~/3rdparty/reactStoreBadges"; import languages from "~/languages"; diff --git a/src/3rdparty/reactStoreBadges.tsx b/src/3rdparty/reactStoreBadges.tsx index 9235bb7..bb04857 100644 --- a/src/3rdparty/reactStoreBadges.tsx +++ b/src/3rdparty/reactStoreBadges.tsx @@ -1,6 +1,6 @@ // Based on https://github.com/yjb94/react-store-badges -import React, { FC, useLayoutEffect, useState } from "react"; +import React, { type FC, useLayoutEffect, useState } from "react"; const HEIGHT_RATIO = 3.375; diff --git a/src/Main.tsx b/src/Main.tsx index 3c094d0..a711db0 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -3,9 +3,9 @@ import React, { Suspense, useEffect, useMemo, useState } from "react"; import { AppContext } from "~/appContext"; import { fixOsmAuthLocalStorageTokens } from "~/auth"; import CustomModal from "~/components/modal"; -import { AuthState } from "~/model/auth"; -import { Country } from "~/model/country"; -import { DefibrillatorData } from "~/model/defibrillatorData"; +import type { AuthState } from "~/model/auth"; +import type { Country } from "~/model/country"; +import type { DefibrillatorData } from "~/model/defibrillatorData"; import { ModalType, initialModalState } from "~/model/modal"; import SidebarAction from "~/model/sidebarAction"; import { updateOsmUsernameState } from "~/osm"; diff --git a/src/appContext.tsx b/src/appContext.tsx index 57d51c2..0af6337 100644 --- a/src/appContext.tsx +++ b/src/appContext.tsx @@ -1,9 +1,9 @@ import * as React from "react"; import { useContext } from "react"; -import { AuthState, initialAuthState } from "~/model/auth"; -import { Country } from "~/model/country"; -import { DefibrillatorData } from "~/model/defibrillatorData"; -import { ModalState, initialModalState } from "~/model/modal"; +import { type AuthState, initialAuthState } from "~/model/auth"; +import type { Country } from "~/model/country"; +import type { DefibrillatorData } from "~/model/defibrillatorData"; +import { type ModalState, initialModalState } from "~/model/modal"; import SidebarAction from "./model/sidebarAction"; interface AppContextType { diff --git a/src/backend.ts b/src/backend.ts index 4a6de21..d421f89 100644 --- a/src/backend.ts +++ b/src/backend.ts @@ -1,5 +1,5 @@ -import { Country } from "./model/country"; -import { DefibrillatorData } from "./model/defibrillatorData"; +import type { Country } from "./model/country"; +import type { DefibrillatorData } from "./model/defibrillatorData"; import { fetchNodeData } from "./osm"; export const backendBaseUrl = import.meta.env.VITE_BACKEND_API_URL; diff --git a/src/components/downloadCard.tsx b/src/components/downloadCard.tsx index 2da0736..6e60f23 100644 --- a/src/components/downloadCard.tsx +++ b/src/components/downloadCard.tsx @@ -5,7 +5,7 @@ import { useTranslation } from "react-i18next"; import { useAppContext } from "~/appContext"; import { backendBaseUrl } from "~/backend"; import { useLanguage } from "~/i18n"; -import { Country } from "~/model/country"; +import type { Country } from "~/model/country"; const worldCountryCode = "WORLD"; diff --git a/src/components/footer.tsx b/src/components/footer.tsx index 6856e61..068e762 100644 --- a/src/components/footer.tsx +++ b/src/components/footer.tsx @@ -5,7 +5,7 @@ import { mdiMapMarkerPlus, } from "@mdi/js"; import Icon from "@mdi/react"; -import React, { FC } from "react"; +import React, { type FC } from "react"; import { Button, Footer } from "react-bulma-components"; import { useTranslation } from "react-i18next"; import { useAppContext } from "~/appContext"; diff --git a/src/components/logInButton.tsx b/src/components/logInButton.tsx index bbfb7e2..4d5d90e 100644 --- a/src/components/logInButton.tsx +++ b/src/components/logInButton.tsx @@ -1,6 +1,6 @@ import { mdiAccount, mdiLogoutVariant } from "@mdi/js"; import Icon from "@mdi/react"; -import React, { FC } from "react"; +import React, { type FC } from "react"; import { Button, Navbar } from "react-bulma-components"; import { useTranslation } from "react-i18next"; import { useAppContext } from "~/appContext"; diff --git a/src/components/map.tsx b/src/components/map.tsx index bef7fed..e4f2176 100644 --- a/src/components/map.tsx +++ b/src/components/map.tsx @@ -1,9 +1,12 @@ // @ts-ignore import MaplibreGeocoder from "@maplibre/maplibre-gl-geocoder"; import "@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css"; -import maplibregl, { MapGeoJSONFeature, MapMouseEvent } from "maplibre-gl"; +import maplibregl, { + type MapGeoJSONFeature, + type MapMouseEvent, +} from "maplibre-gl"; import "maplibre-gl/dist/maplibre-gl.css"; -import React, { FC, useEffect, useRef, useState } from "react"; +import React, { type FC, useEffect, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; import { useAppContext } from "~/appContext"; import { fetchCountriesData, fetchNodeDataFromBackend } from "~/backend"; @@ -18,7 +21,7 @@ import { saveLocationToLocalStorage, } from "~/location"; import ButtonsType from "~/model/buttonsType"; -import { DefibrillatorData } from "~/model/defibrillatorData"; +import type { DefibrillatorData } from "~/model/defibrillatorData"; import { ModalType, initialModalState } from "~/model/modal"; import SidebarAction from "~/model/sidebarAction"; import FooterDiv from "./footer"; diff --git a/src/components/map_style.ts b/src/components/map_style.ts index 0550d79..0cf9798 100644 --- a/src/components/map_style.ts +++ b/src/components/map_style.ts @@ -1,6 +1,6 @@ -import { StyleSpecification } from "maplibre-gl"; +import type { StyleSpecification } from "maplibre-gl"; import { backendBaseUrl } from "~/backend"; -import { Country } from "~/model/country"; +import type { Country } from "~/model/country"; const getUrl = window.location; const baseUrl = `${getUrl.protocol}//${getUrl.host}${getUrl.pathname}`; diff --git a/src/components/modal.tsx b/src/components/modal.tsx index edd6eac..136afbc 100644 --- a/src/components/modal.tsx +++ b/src/components/modal.tsx @@ -1,6 +1,6 @@ import { mdiGithub, mdiInformationOutline } from "@mdi/js"; import Icon from "@mdi/react"; -import React, { FC } from "react"; +import React, { type FC } from "react"; import { Button, Modal } from "react-bulma-components"; import { useTranslation } from "react-i18next"; import { useAppContext } from "~/appContext"; diff --git a/src/components/navbar.tsx b/src/components/navbar.tsx index a5f3cea..52963d1 100644 --- a/src/components/navbar.tsx +++ b/src/components/navbar.tsx @@ -1,6 +1,6 @@ import { mdiMapLegend } from "@mdi/js"; import Icon from "@mdi/react"; -import React, { FC } from "react"; +import React, { type FC } from "react"; import { Button, Navbar } from "react-bulma-components"; import { useTranslation } from "react-i18next"; import ReactStoreBadges from "~/3rdparty/reactStoreBadges"; diff --git a/src/components/partnersModal.tsx b/src/components/partnersModal.tsx index 3f7120d..4de7aae 100644 --- a/src/components/partnersModal.tsx +++ b/src/components/partnersModal.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import React, { type FC } from "react"; import { useTranslation } from "react-i18next"; interface Partner { diff --git a/src/components/sidebar-left.tsx b/src/components/sidebar-left.tsx index 20d2e9f..4ae9b8c 100644 --- a/src/components/sidebar-left.tsx +++ b/src/components/sidebar-left.tsx @@ -1,6 +1,6 @@ -import { Marker } from "maplibre-gl"; -import React, { FC } from "react"; -import { DefibrillatorData } from "~/model/defibrillatorData"; +import type { Marker } from "maplibre-gl"; +import React, { type FC } from "react"; +import type { DefibrillatorData } from "~/model/defibrillatorData"; import SidebarAction from "~/model/sidebarAction"; import "./sidebar.css"; import DefibrillatorDetails from "./sidebar/defibrillatorDetails"; diff --git a/src/components/sidebar/buttons.tsx b/src/components/sidebar/buttons.tsx index 28fe3e0..3ba53a3 100644 --- a/src/components/sidebar/buttons.tsx +++ b/src/components/sidebar/buttons.tsx @@ -7,7 +7,8 @@ import { mdiPencil, } from "@mdi/js"; import Icon from "@mdi/react"; -import React, { FC } from "react"; +import type React from "react"; +import type { FC } from "react"; import { Button } from "react-bulma-components"; import { useTranslation } from "react-i18next"; import { useAppContext } from "~/appContext"; diff --git a/src/components/sidebar/defibrillatorDetails.tsx b/src/components/sidebar/defibrillatorDetails.tsx index 3ab1ebe..fc4adc8 100644 --- a/src/components/sidebar/defibrillatorDetails.tsx +++ b/src/components/sidebar/defibrillatorDetails.tsx @@ -8,15 +8,15 @@ import { mdiPhoneOutline, } from "@mdi/js"; import Icon from "@mdi/react"; -import React, { FC, Suspense, useState } from "react"; +import React, { type FC, Suspense, useState } from "react"; import { Button, Card, Columns, Image } from "react-bulma-components"; import { useTranslation } from "react-i18next"; -import ImageGallery, { ReactImageGalleryItem } from "react-image-gallery"; +import ImageGallery, { type ReactImageGalleryItem } from "react-image-gallery"; import "react-image-gallery/styles/css/image-gallery.css"; import { useAppContext } from "~/appContext"; import { backendBaseUrl } from "~/backend"; import { useLanguage } from "~/i18n"; -import { DefibrillatorData } from "~/model/defibrillatorData"; +import type { DefibrillatorData } from "~/model/defibrillatorData"; import { ModalType, initialModalState } from "~/model/modal"; import SidebarAction from "~/model/sidebarAction"; import { accessColourClass } from "./access"; diff --git a/src/components/sidebar/defibrillatorEditor.tsx b/src/components/sidebar/defibrillatorEditor.tsx index 4df29d4..c98d461 100644 --- a/src/components/sidebar/defibrillatorEditor.tsx +++ b/src/components/sidebar/defibrillatorEditor.tsx @@ -1,10 +1,11 @@ -import { Marker } from "maplibre-gl"; -import React, { FC, useState } from "react"; +import type { Marker } from "maplibre-gl"; +import type React from "react"; +import { type FC, useState } from "react"; import { Card, Image } from "react-bulma-components"; import { useTranslation } from "react-i18next"; import { useAppContext } from "~/appContext"; import { useLanguage } from "~/i18n"; -import { DefibrillatorData } from "~/model/defibrillatorData"; +import type { DefibrillatorData } from "~/model/defibrillatorData"; import { ModalType, initialModalState } from "~/model/modal"; import { addDefibrillatorToOSM, diff --git a/src/components/sidebar/detailTextRow.tsx b/src/components/sidebar/detailTextRow.tsx index 6fff48b..1c76249 100644 --- a/src/components/sidebar/detailTextRow.tsx +++ b/src/components/sidebar/detailTextRow.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import React, { type FC } from "react"; import { useTranslation } from "react-i18next"; import SpanNoData from "./spanNoData"; diff --git a/src/components/sidebar/openingHours.tsx b/src/components/sidebar/openingHours.tsx index 1bb911b..d912c27 100644 --- a/src/components/sidebar/openingHours.tsx +++ b/src/components/sidebar/openingHours.tsx @@ -1,6 +1,6 @@ import OpeningHours from "opening_hours"; import type { argument_hash } from "opening_hours"; -import React, { FC } from "react"; +import React, { type FC } from "react"; import { useTranslation } from "react-i18next"; import { useLanguage } from "~/i18n"; diff --git a/src/components/sidebar/photoReporter.tsx b/src/components/sidebar/photoReporter.tsx index d46c954..3a8c387 100644 --- a/src/components/sidebar/photoReporter.tsx +++ b/src/components/sidebar/photoReporter.tsx @@ -1,11 +1,12 @@ import { mdiArrowLeftBold, mdiSend } from "@mdi/js"; import Icon from "@mdi/react"; -import React, { FC } from "react"; +import type React from "react"; +import type { FC } from "react"; import { Button, Card, Image } from "react-bulma-components"; import { useTranslation } from "react-i18next"; import { useAppContext } from "~/appContext"; import { backendBaseUrl } from "~/backend"; -import { DefibrillatorData } from "~/model/defibrillatorData"; +import type { DefibrillatorData } from "~/model/defibrillatorData"; import { ModalType, initialModalState } from "~/model/modal"; import SidebarAction from "~/model/sidebarAction"; import { accessColourClass } from "./access"; diff --git a/src/components/sidebar/photoUploader.tsx b/src/components/sidebar/photoUploader.tsx index 089facd..6056ed4 100644 --- a/src/components/sidebar/photoUploader.tsx +++ b/src/components/sidebar/photoUploader.tsx @@ -1,11 +1,12 @@ import { mdiArrowLeftBold, mdiFileDocumentRemove, mdiFileSend } from "@mdi/js"; import Icon from "@mdi/react"; -import React, { FC, useState } from "react"; +import type React from "react"; +import { type FC, useState } from "react"; import { Button, Card, Image } from "react-bulma-components"; import { useTranslation } from "react-i18next"; import { useAppContext } from "~/appContext"; import { backendBaseUrl } from "~/backend"; -import { DefibrillatorData } from "~/model/defibrillatorData"; +import type { DefibrillatorData } from "~/model/defibrillatorData"; import { ModalType, initialModalState } from "~/model/modal"; import SidebarAction from "~/model/sidebarAction"; import { accessColourClass } from "./access"; diff --git a/src/components/sidebar/verificationDate.tsx b/src/components/sidebar/verificationDate.tsx index 1f56256..7d9633b 100644 --- a/src/components/sidebar/verificationDate.tsx +++ b/src/components/sidebar/verificationDate.tsx @@ -1,6 +1,6 @@ import { mdiCalendar } from "@mdi/js"; import Icon from "@mdi/react"; -import React, { FC } from "react"; +import React, { type FC } from "react"; import { useTranslation } from "react-i18next"; import SpanNoData from "./spanNoData"; diff --git a/src/osm.ts b/src/osm.ts index 44cb06b..51e610f 100644 --- a/src/osm.ts +++ b/src/osm.ts @@ -1,4 +1,4 @@ -import { +import type { DefibrillatorData, NewDefibrillatorData, } from "./model/defibrillatorData"; @@ -7,8 +7,8 @@ import { function parseTimezoneOffset(timezoneOffset: string | undefined): number { if (timezoneOffset === undefined) return 0; const sign = timezoneOffset[3] === "+" ? 1 : -1; - const hours = parseInt(timezoneOffset.slice(4, 6), 10); - const minutes = parseInt(timezoneOffset.slice(7, 9), 10); + const hours = Number.parseInt(timezoneOffset.slice(4, 6), 10); + const minutes = Number.parseInt(timezoneOffset.slice(7, 9), 10); return sign * (hours * 60 + minutes); } diff --git a/tsconfig.json b/tsconfig.json index dcb44cc..9ad08b3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,46 +1,30 @@ { - "$schema": "https://json.schemastore.org/tsconfig.json", - "compilerOptions": { - "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx", - "strictNullChecks": true, - "noImplicitAny": true, - "typeRoots": [ - "./types/", - "./node_modules/@types", - "./node_modules" - ], - "types": [ - "vite/client", - "bun-types" - ], - "baseUrl": ".", - "paths": { - "~/*": ["./src/*"] - } - }, - "include": [ - "src", - "types/custom.d.ts" - ], - "exclude": [ - "node_modules" - ] + "$schema": "https://json.schemastore.org/tsconfig.json", + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "strictNullChecks": true, + "noImplicitAny": true, + "typeRoots": ["./types/", "./node_modules/@types", "./node_modules"], + "types": ["vite/client", "bun-types"], + "baseUrl": ".", + "paths": { + "~/*": ["./src/*"] + } + }, + "include": ["src", "types/custom.d.ts"], + "exclude": ["node_modules"] } diff --git a/vite.config.js b/vite.config.js index bd3f6dd..13b9828 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,6 +1,5 @@ -import * as fs from "fs"; -import path from "path"; -import { resolve } from "path"; +import * as fs from "node:fs"; +import path, { resolve } from "node:path"; import { sentryVitePlugin } from "@sentry/vite-plugin"; import react from "@vitejs/plugin-react"; import { defineConfig, loadEnv } from "vite";