From e9a597a9fe71bcfbebff57e4a203bd4ba0f4725d Mon Sep 17 00:00:00 2001 From: Mishig Davaadorj Date: Wed, 27 Sep 2023 22:34:08 +0200 Subject: [PATCH 1/3] npm run format:all --- js/src/lib/components/InferenceWidget/shared/helpers.ts | 6 +++--- js/src/lib/components/InferenceWidget/shared/types.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/js/src/lib/components/InferenceWidget/shared/helpers.ts b/js/src/lib/components/InferenceWidget/shared/helpers.ts index 9e04438e7..62e8824e5 100644 --- a/js/src/lib/components/InferenceWidget/shared/helpers.ts +++ b/js/src/lib/components/InferenceWidget/shared/helpers.ts @@ -185,11 +185,11 @@ export async function getModelLoadInfo( const output = await response.json(); if (response.ok && typeof output === "object" && output.loaded !== undefined) { // eslint-disable-next-line @typescript-eslint/naming-convention - const {state, compute_type} = output; - return {compute_type, state}; + const { state, compute_type } = output; + return { compute_type, state }; } else { console.warn(response.status, output.error); - return {state: "error" }; + return { state: "error" }; } } diff --git a/js/src/lib/components/InferenceWidget/shared/types.ts b/js/src/lib/components/InferenceWidget/shared/types.ts index 01aa6026f..c8ff2fe3f 100644 --- a/js/src/lib/components/InferenceWidget/shared/types.ts +++ b/js/src/lib/components/InferenceWidget/shared/types.ts @@ -11,7 +11,6 @@ export interface WidgetProps { isLoggedIn?: boolean; } - export type LoadState = "Loadable" | "Loaded" | "TooBig" | "error"; export type ComputeType = "cpu" | "gpu"; From 760f95db1a2a3812cc3c19a4236cf0b1fb17fb05 Mon Sep 17 00:00:00 2001 From: Mishig Davaadorj Date: Wed, 27 Sep 2023 23:05:43 +0200 Subject: [PATCH 2/3] add eslint `alphabetize` --- js/.eslintrc.cjs | 1 + 1 file changed, 1 insertion(+) diff --git a/js/.eslintrc.cjs b/js/.eslintrc.cjs index 47251b4b6..15dc8b692 100644 --- a/js/.eslintrc.cjs +++ b/js/.eslintrc.cjs @@ -50,6 +50,7 @@ module.exports = { "error", { "newlines-between": "always", + "alphabetize": { order: 'asc' }, "groups": ["type", "builtin", "external", "parent", "sibling", "index"], }, ], From ca1afd5fc15bd86a4da7f7c99767dba033b0b34a Mon Sep 17 00:00:00 2001 From: Mishig Davaadorj Date: Thu, 28 Sep 2023 16:59:41 +0200 Subject: [PATCH 3/3] Revert "add eslint `alphabetize`" This reverts commit 68c6c5ae044c6804c118013aebca19a7dc808fb4. --- js/.eslintrc.cjs | 1 - 1 file changed, 1 deletion(-) diff --git a/js/.eslintrc.cjs b/js/.eslintrc.cjs index 15dc8b692..47251b4b6 100644 --- a/js/.eslintrc.cjs +++ b/js/.eslintrc.cjs @@ -50,7 +50,6 @@ module.exports = { "error", { "newlines-between": "always", - "alphabetize": { order: 'asc' }, "groups": ["type", "builtin", "external", "parent", "sibling", "index"], }, ],