Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix top level await #1

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ export function matchUnions<
U extends { [K in T["type"]]: (value: Extract<T, { type: K }>) => unknown },
>(value: T, cases: U): ReturnType<T["type"] extends keyof U ? U[T["type"]] : never> {
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;
}
2 changes: 0 additions & 2 deletions src/views/NewSavedQueryView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
4 changes: 1 addition & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2020",
"target": "ES2022",
"useDefineForClassFields": true,
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"module": "ESNext",
Expand All @@ -17,8 +17,6 @@
/* Linting */
"strict": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"paths": {
Expand Down
6 changes: 6 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
//
Expand Down