diff --git a/src/lib/utils.ts b/src/lib/utils.ts index ce23a26..3ddcae5 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -75,5 +75,5 @@ export function matchUnions< U extends { [K in T["type"]]: (value: Extract) => unknown }, >(value: T, cases: U): ReturnType { assertKeyOfObject(cases, value.type); - return cases[value.type as keyof U](value as any); + return cases[value.type as keyof U](value as any) as any; } diff --git a/src/views/NewSavedQueryView.tsx b/src/views/NewSavedQueryView.tsx index e9e6639..b25e9e3 100644 --- a/src/views/NewSavedQueryView.tsx +++ b/src/views/NewSavedQueryView.tsx @@ -11,8 +11,6 @@ export interface NewSavedQueryViewProps { } export const NewSavedQueryView = observer((props: NewSavedQueryViewProps) => { - const { connection } = props; - const [name, setName] = useState(""); const [query, setQuery] = useState("SELECT * FROM table WHERE id = $::value"); diff --git a/tsconfig.json b/tsconfig.json index 696fbfc..8670b3b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES2020", + "target": "ES2022", "useDefineForClassFields": true, "lib": ["ES2022", "DOM", "DOM.Iterable"], "module": "ESNext", @@ -17,8 +17,6 @@ /* Linting */ "strict": true, "noUncheckedIndexedAccess": true, - "noUnusedLocals": true, - "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "paths": { diff --git a/vite.config.ts b/vite.config.ts index aa0aea5..4abe53a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,6 +6,12 @@ import tsconfigPaths from "vite-tsconfig-paths"; // https://vitejs.dev/config/ export default defineConfig(async () => ({ plugins: [TanStackRouterVite(), react(), tsconfigPaths()], + esbuild: { + target: "ES2022", + supported: { + "top-level-await": true, + }, + }, // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` //