From 408b4e6d9b9a617ef4a1fc465e407e4711886b24 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 29 Oct 2024 21:18:07 +0100 Subject: [PATCH] build: fix linter errors MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/types/JsonType.ts | 1 + src/utils/Utils.ts | 6 ++++-- ui/web/src/composables/Utils.ts | 3 ++- ui/web/src/types/JsonType.ts | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) 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[] -- 2.34.1