From 4b64d38d68446d46b851e6268a8c89f5e101c196 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Wed, 16 Aug 2023 18:29:47 -0300 Subject: [PATCH] fix(inputComponent): fix TypeScript error by adding non-null assertion to className variable fix(authContext): fix TypeScript error by setting initial value of userData to null fix(tsconfig.json): enable strict mode in TypeScript compiler for better type checking and error detection --- src/frontend/src/components/inputComponent/index.tsx | 4 ++-- src/frontend/src/contexts/authContext.tsx | 2 +- src/frontend/tsconfig.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/components/inputComponent/index.tsx b/src/frontend/src/components/inputComponent/index.tsx index c71264935..47e04811b 100644 --- a/src/frontend/src/components/inputComponent/index.tsx +++ b/src/frontend/src/components/inputComponent/index.tsx @@ -39,7 +39,7 @@ export default function InputComponent({ editNode ? " input-edit-node " : "", password && editNode ? "pr-8" : "", password && !editNode ? "pr-10" : "", - className + className! )} placeholder={password && editNode ? "Key" : placeholder} onChange={(e) => { @@ -59,7 +59,7 @@ export default function InputComponent({ editNode ? " input-edit-node " : "", password && editNode ? "pr-8" : "", password && !editNode ? "pr-10" : "", - className + className! )} placeholder={password && editNode ? "Key" : placeholder} onChange={(e) => { diff --git a/src/frontend/src/contexts/authContext.tsx b/src/frontend/src/contexts/authContext.tsx index dc4ca52c9..691ba90de 100644 --- a/src/frontend/src/contexts/authContext.tsx +++ b/src/frontend/src/contexts/authContext.tsx @@ -15,7 +15,7 @@ const AuthContext = createContext(initialValue); export function AuthProvider({ children }): React.ReactElement { const [accessToken, setAccessToken] = useState(null); - const [userData, setUserData] = useState(null); + const [userData, setUserData] = useState(null); useEffect(() => { const storedAccessToken = localStorage.getItem("access_token"); diff --git a/src/frontend/tsconfig.json b/src/frontend/tsconfig.json index c411ff4e7..1879137c5 100644 --- a/src/frontend/tsconfig.json +++ b/src/frontend/tsconfig.json @@ -6,7 +6,7 @@ "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, - "strict": false, + "strict": true, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, "module": "esnext",