Skip to content

Commit

Permalink
Upgrade biome
Browse files Browse the repository at this point in the history
  • Loading branch information
starsep committed Mar 17, 2024
1 parent 6adb75e commit 9d77e93
Show file tree
Hide file tree
Showing 28 changed files with 134 additions and 144 deletions.
Binary file modified bun.lockb
Binary file not shown.
108 changes: 54 additions & 54 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
2 changes: 1 addition & 1 deletion scripts/updateStoreBadges.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/3rdparty/reactStoreBadges.test.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/3rdparty/reactStoreBadges.tsx
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
6 changes: 3 additions & 3 deletions src/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
8 changes: 4 additions & 4 deletions src/appContext.tsx
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/backend.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/components/downloadCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/components/logInButton.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
9 changes: 6 additions & 3 deletions src/components/map.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions src/components/map_style.ts
Original file line number Diff line number Diff line change
@@ -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}`;
Expand Down
2 changes: 1 addition & 1 deletion src/components/modal.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/components/navbar.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/components/partnersModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from "react";
import React, { type FC } from "react";
import { useTranslation } from "react-i18next";

interface Partner {
Expand Down
6 changes: 3 additions & 3 deletions src/components/sidebar-left.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
3 changes: 2 additions & 1 deletion src/components/sidebar/buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
6 changes: 3 additions & 3 deletions src/components/sidebar/defibrillatorDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
7 changes: 4 additions & 3 deletions src/components/sidebar/defibrillatorEditor.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/detailTextRow.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from "react";
import React, { type FC } from "react";
import { useTranslation } from "react-i18next";
import SpanNoData from "./spanNoData";

Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/openingHours.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
5 changes: 3 additions & 2 deletions src/components/sidebar/photoReporter.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
5 changes: 3 additions & 2 deletions src/components/sidebar/photoUploader.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/verificationDate.tsx
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
6 changes: 3 additions & 3 deletions src/osm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
DefibrillatorData,
NewDefibrillatorData,
} from "./model/defibrillatorData";
Expand All @@ -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);
}

Expand Down
Loading

0 comments on commit 9d77e93

Please sign in to comment.