= ({ identity }) => {
title: "Confirm delete",
children: (
- This will permanently delete identity {identity.traits?.email}.
+ This will permanently delete identity{" "}
+ {identity.traits?.email}.
),
confirmButtonLabel: "Delete identity",
diff --git a/ui/src/util/useLocalStorage.ts b/ui/src/util/useLocalStorage.ts
index 6b365112a..0d790e162 100644
--- a/ui/src/util/useLocalStorage.ts
+++ b/ui/src/util/useLocalStorage.ts
@@ -9,7 +9,7 @@ function useLocalStorage(
const [storedValue, setStoredValue] = useState(() => {
try {
const item = window.localStorage.getItem(key);
- return item ? JSON.parse(item) : initialValue;
+ return item ? (JSON.parse(item) as V) : initialValue;
} catch (error) {
// Not shown in UI. Logged for debugging purposes.
console.error("Unable to parse local storage:", error);
diff --git a/ui/tsconfig.json b/ui/tsconfig.json
index 4af39aaae..4c1d03207 100644
--- a/ui/tsconfig.json
+++ b/ui/tsconfig.json
@@ -1,14 +1,7 @@
{
"compilerOptions": {
"outDir": "./public/js/dist",
- "baseUrl": ".",
- "paths": {
- "api/*": ["src/api/*"],
- "components/*": ["src/components/*"],
- "pages/*": ["src/pages/*"],
- "types/*": ["src/types/*"],
- "util/*": ["src/util/*"]
- },
+ "baseUrl": "src",
"target": "ES2020",
"module": "esnext",
"jsx": "react-jsx",
diff --git a/ui/vitest.config.ts b/ui/vitest.config.ts
index c62b78712..5e6b4da04 100644
--- a/ui/vitest.config.ts
+++ b/ui/vitest.config.ts
@@ -1,13 +1,15 @@
import { mergeConfig, defineConfig } from "vitest/config";
import viteConfig from "./vite.config";
-export default mergeConfig(
- viteConfig({ mode: "development" }),
- defineConfig({
- test: {
- environment: "jsdom",
- globals: true,
- include: ["./src/**/*.spec.{ts,tsx}"],
- },
- }),
+export default defineConfig((configEnv) =>
+ mergeConfig(
+ viteConfig({ ...configEnv, mode: "development" }),
+ defineConfig({
+ test: {
+ environment: "jsdom",
+ globals: true,
+ include: ["./src/**/*.{test,spec}.{ts,tsx}"],
+ },
+ }),
+ ),
);