From b1e6b1b4d89850276015c5350fd79f1e1cb8d3a4 Mon Sep 17 00:00:00 2001 From: v-almonacid Date: Tue, 13 Feb 2024 15:31:50 -0300 Subject: [PATCH 1/2] chore: tslint 'fix' in tutorial --- packages/frontend/src/api/hooks/useTutorial.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/frontend/src/api/hooks/useTutorial.ts b/packages/frontend/src/api/hooks/useTutorial.ts index ee9855ca..107e0407 100644 --- a/packages/frontend/src/api/hooks/useTutorial.ts +++ b/packages/frontend/src/api/hooks/useTutorial.ts @@ -1,4 +1,3 @@ -// @ts-nocheck we'll fix this later: // TODO import { useCallback } from "react"; import { setCurrentTutorialTip, setStoreShowTutorial } from "src/api/store"; import { useAppSelector, useAppDispatch } from "src/api/store/hooks"; @@ -51,7 +50,9 @@ export const useTutorial: () => ITutorial = () => { .map((object) => object.id) .indexOf(currentTutorialTip.id); const next = - index !== undefined ? (index + 1) % allowedTutorials.length : 0; + typeof index === "number" + ? (index + 1) % allowedTutorials.length + : 0; dispatch( setCurrentTutorialTip({ tutorialTip: allowedTutorials[next] }) @@ -116,7 +117,8 @@ export const useTutorial: () => ITutorial = () => { // The last tip doesn't include a count tipCount: `${ currentTutorialTip - ? allowedTutorials.indexOf(currentTutorialTip) + 1 + ? (allowedTutorials.indexOf(currentTutorialTip) as number) + + 1 : 1 }/${tutorials.length - 1}`, }, From f9ee76eb74f7e5e304b359aff8890bcfa5afa3a8 Mon Sep 17 00:00:00 2001 From: v-almonacid Date: Tue, 13 Feb 2024 16:22:16 -0300 Subject: [PATCH 2/2] disable tseslint instead force cast --- packages/frontend/src/api/hooks/useTutorial.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/api/hooks/useTutorial.ts b/packages/frontend/src/api/hooks/useTutorial.ts index 107e0407..2163e533 100644 --- a/packages/frontend/src/api/hooks/useTutorial.ts +++ b/packages/frontend/src/api/hooks/useTutorial.ts @@ -117,8 +117,8 @@ export const useTutorial: () => ITutorial = () => { // The last tip doesn't include a count tipCount: `${ currentTutorialTip - ? (allowedTutorials.indexOf(currentTutorialTip) as number) + - 1 + ? // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + allowedTutorials.indexOf(currentTutorialTip) + 1 : 1 }/${tutorials.length - 1}`, },