From: Jérôme Benoit Date: Tue, 29 Oct 2024 20:18:07 +0000 (+0100) Subject: build: fix linter errors X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=408b4e6d9b9a617ef4a1fc465e407e4711886b24;p=e-mobility-charging-stations-simulator.git build: fix linter errors Signed-off-by: Jérôme Benoit --- diff --git a/src/types/JsonType.ts b/src/types/JsonType.ts index 78142b77..bca5d958 100644 --- a/src/types/JsonType.ts +++ b/src/types/JsonType.ts @@ -1,5 +1,6 @@ type JsonPrimitive = boolean | Date | null | number | string +// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style export type JsonObject = { [key in string]?: JsonType } diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 5ebe17ea..cc26fcc4 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -116,7 +116,8 @@ export const convertToInt = (value: unknown): number => { changedValue = Number.parseInt(value) } if (isNaN(changedValue)) { - throw new Error(`Cannot convert to integer: '${String(value)}'`) + // eslint-disable-next-line @typescript-eslint/no-base-to-string + throw new Error(`Cannot convert to integer: '${value.toString()}'`) } return changedValue } @@ -130,7 +131,8 @@ export const convertToFloat = (value: unknown): number => { changedValue = Number.parseFloat(value) } if (isNaN(changedValue)) { - throw new Error(`Cannot convert to float: '${String(value)}'`) + // eslint-disable-next-line @typescript-eslint/no-base-to-string + throw new Error(`Cannot convert to float: '${value.toString()}'`) } return changedValue } diff --git a/ui/web/src/composables/Utils.ts b/ui/web/src/composables/Utils.ts index 93001486..5fcc4093 100644 --- a/ui/web/src/composables/Utils.ts +++ b/ui/web/src/composables/Utils.ts @@ -30,7 +30,8 @@ export const convertToInt = (value: unknown): number => { changedValue = Number.parseInt(value) } if (isNaN(changedValue)) { - throw new Error(`Cannot convert to integer: '${String(value)}'`) + // eslint-disable-next-line @typescript-eslint/no-base-to-string + throw new Error(`Cannot convert to integer: '${value.toString()}'`) } return changedValue } diff --git a/ui/web/src/types/JsonType.ts b/ui/web/src/types/JsonType.ts index db6192a5..163bb955 100644 --- a/ui/web/src/types/JsonType.ts +++ b/ui/web/src/types/JsonType.ts @@ -1,3 +1,4 @@ type JsonPrimitive = boolean | Date | null | number | string +// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style export type JsonObject = { [key in string]?: JsonType } export type JsonType = JsonObject | JsonPrimitive | JsonType[]