From 6e827f312d18eb511d21652704fc030679f39977 Mon Sep 17 00:00:00 2001 From: thomasgross Date: Fri, 3 Jan 2025 12:51:09 +0100 Subject: [PATCH] fix: build errors and warnings --- package.json | 2 +- src/apps/dashboard/util/helpers.ts | 4 ++-- src/apps/fee-list/stackable-fees/fee-details-content.tsx | 2 +- src/apps/fee-list/stackable-fees/fee-status.tsx | 2 +- src/core/configuration/api-strings.json | 4 ---- src/core/configuration/api-strings.ts | 9 +++++++++ src/core/configuration/date-format.json | 5 ----- src/core/configuration/date-format.ts | 8 ++++++++ src/core/configuration/identifier-lengths.json | 4 ---- src/core/configuration/identifier-lengths.ts | 7 +++++++ src/core/utils/useReservations.tsx | 2 +- 11 files changed, 30 insertions(+), 19 deletions(-) delete mode 100644 src/core/configuration/api-strings.json create mode 100644 src/core/configuration/api-strings.ts delete mode 100644 src/core/configuration/date-format.json create mode 100644 src/core/configuration/date-format.ts delete mode 100644 src/core/configuration/identifier-lengths.json create mode 100644 src/core/configuration/identifier-lengths.ts diff --git a/package.json b/package.json index 82860ec24f..699c3710fc 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "scripts": { "fmt": "prettier --config ./.prettierrc --write \"src/**/*.{js,jsx,ts,tsx}\"", "lint:js": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --max-warnings 0 --cache --cache-location \".cache/eslint/\"", - "lint:js:fix": "eslint --ext .js --ext .jsx --ext .ts --ext .tsx --fix ./src", + "lint:js:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\"", "lint:markdown": "markdownlint-cli2", "lint:markdown:fix": "markdownlint-cli2-fix", "lint:scss": "stylelint \"./src/**/*.scss\"", diff --git a/src/apps/dashboard/util/helpers.ts b/src/apps/dashboard/util/helpers.ts index 0046d5f99d..9478e9e5b4 100644 --- a/src/apps/dashboard/util/helpers.ts +++ b/src/apps/dashboard/util/helpers.ts @@ -1,9 +1,9 @@ import dayjs from "dayjs"; -import { dateFormatDayjs } from "../../../core/configuration/date-format.json"; +import { dateFormatDayjs } from "../../../core/configuration/date-format"; import { faustIdentifierLength, digitalMaterialIdentifierLength -} from "../../../core/configuration/identifier-lengths.json"; +} from "../../../core/configuration/identifier-lengths"; export const yesterday = dayjs().subtract(1, "day").format(dateFormatDayjs); export const soon = dayjs().add(7, "days").format(dateFormatDayjs); diff --git a/src/apps/fee-list/stackable-fees/fee-details-content.tsx b/src/apps/fee-list/stackable-fees/fee-details-content.tsx index b90e0ef315..fbe91ca8bd 100644 --- a/src/apps/fee-list/stackable-fees/fee-details-content.tsx +++ b/src/apps/fee-list/stackable-fees/fee-details-content.tsx @@ -3,7 +3,7 @@ import * as React from "react"; import { FC } from "react"; import { FeeV2 } from "../../../core/fbs/model"; import { useText } from "../../../core/utils/text"; -import { dateFormatCustom } from "../../../core/configuration/date-format.json"; +import { dateFormatCustom } from "../../../core/configuration/date-format"; import StackableFeesList from "./stackable-fees-list"; import GroupModalContent from "../../../components/GroupModal/GroupModalContent"; import { formatCurrency } from "../../../core/utils/helpers/currency"; diff --git a/src/apps/fee-list/stackable-fees/fee-status.tsx b/src/apps/fee-list/stackable-fees/fee-status.tsx index c23b432d00..0cc2216769 100644 --- a/src/apps/fee-list/stackable-fees/fee-status.tsx +++ b/src/apps/fee-list/stackable-fees/fee-status.tsx @@ -1,6 +1,6 @@ import dayjs from "dayjs"; import React, { FC } from "react"; -import { dateFormatDefault } from "../../../core/configuration/date-format.json"; +import { dateFormatDefault } from "../../../core/configuration/date-format"; import { useText } from "../../../core/utils/text"; interface FeeStatusProps { diff --git a/src/core/configuration/api-strings.json b/src/core/configuration/api-strings.json deleted file mode 100644 index b7e25b21c2..0000000000 --- a/src/core/configuration/api-strings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "dashboardReadyForPickupApiValueText": "readyForPickup", - "dashboardReservedApiValueText": "reserved" -} diff --git a/src/core/configuration/api-strings.ts b/src/core/configuration/api-strings.ts new file mode 100644 index 0000000000..4d424684f5 --- /dev/null +++ b/src/core/configuration/api-strings.ts @@ -0,0 +1,9 @@ +const apiStrings = { + dashboardReadyForPickupApiValueText: "readyForPickup", + dashboardReservedApiValueText: "reserved" +}; + +export const { + dashboardReadyForPickupApiValueText, + dashboardReservedApiValueText +} = apiStrings; diff --git a/src/core/configuration/date-format.json b/src/core/configuration/date-format.json deleted file mode 100644 index fa6ba787dd..0000000000 --- a/src/core/configuration/date-format.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dateFormatDefault": "DD. MM. YYYY", - "dateFormatCustom": "D. MMMM YYYY", - "dateFormatDayjs": "YYYY-MM-DD" -} diff --git a/src/core/configuration/date-format.ts b/src/core/configuration/date-format.ts new file mode 100644 index 0000000000..64474f32fc --- /dev/null +++ b/src/core/configuration/date-format.ts @@ -0,0 +1,8 @@ +const dateFormats = { + dateFormatDefault: "DD. MM. YYYY", + dateFormatCustom: "D. MMMM YYYY", + dateFormatDayjs: "YYYY-MM-DD" +}; + +export const { dateFormatCustom, dateFormatDayjs, dateFormatDefault } = + dateFormats; diff --git a/src/core/configuration/identifier-lengths.json b/src/core/configuration/identifier-lengths.json deleted file mode 100644 index 4177869ac3..0000000000 --- a/src/core/configuration/identifier-lengths.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "faustIdentifierLength": 8, - "digitalMaterialIdentifierLength": 13 -} diff --git a/src/core/configuration/identifier-lengths.ts b/src/core/configuration/identifier-lengths.ts new file mode 100644 index 0000000000..7641c64627 --- /dev/null +++ b/src/core/configuration/identifier-lengths.ts @@ -0,0 +1,7 @@ +const identifierLengths = { + faustIdentifierLength: 8, + digitalMaterialIdentifierLength: 13 +}; + +export const { faustIdentifierLength, digitalMaterialIdentifierLength } = + identifierLengths; diff --git a/src/core/utils/useReservations.tsx b/src/core/utils/useReservations.tsx index e6a2f15b42..9701839cc7 100644 --- a/src/core/utils/useReservations.tsx +++ b/src/core/utils/useReservations.tsx @@ -5,7 +5,7 @@ import { } from "./helpers/list-mapper"; import { getReadyForPickup } from "../../apps/reservation-list/utils/helpers"; import { ReservationType } from "./types/reservation-type"; -import { dashboardReservedApiValueText } from "../configuration/api-strings.json"; +import { dashboardReservedApiValueText } from "../configuration/api-strings"; import useGetReservationGroups from "./useGetReservationGroups"; const getQueuedReservations = (list: ReservationType[]) => {