diff --git a/webui2/package.json b/webui2/package.json index 8a02e60af0c8f86886c11b5e2f2ee61ea41eefa6..fdb605630f49816459bf05be8ba7b6041ae86fa7 100644 --- a/webui2/package.json +++ b/webui2/package.json @@ -46,6 +46,8 @@ "@tailwindcss/typography": "^0.5.19", "@tailwindcss/vite": "^4.2.2", "@tanstack/router-plugin": "^1.167.9", + "@tsconfig/strictest": "^2.0.8", + "@tsconfig/vite-react": "^7.0.2", "@types/react": "^19.1.0", "@types/react-dom": "^19.1.0", "@vitejs/plugin-react": "^6.0.1", diff --git a/webui2/pnpm-lock.yaml b/webui2/pnpm-lock.yaml index 824b80831acc2d73067aa7008756917565bb5e1e..a7b94f501b64c7f8b9d6af411e58d63324052767 100644 --- a/webui2/pnpm-lock.yaml +++ b/webui2/pnpm-lock.yaml @@ -96,6 +96,12 @@ importers: '@tanstack/router-plugin': specifier: ^1.167.9 version: 1.167.9(@tanstack/react-router@1.168.8(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(esbuild@0.27.4)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.3)) + '@tsconfig/strictest': + specifier: ^2.0.8 + version: 2.0.8 + '@tsconfig/vite-react': + specifier: ^7.0.2 + version: 7.0.2 '@types/react': specifier: ^19.1.0 version: 19.2.14 @@ -2078,6 +2084,12 @@ packages: engines: {node: '>=20.19'} hasBin: true + '@tsconfig/strictest@2.0.8': + resolution: {integrity: sha512-XnQ7vNz5HRN0r88GYf1J9JJjqtZPiHt2woGJOo2dYqyHGGcd6OLGqSlBB6p1j9mpzja6Oe5BoPqWmeDx6X9rLw==} + + '@tsconfig/vite-react@7.0.2': + resolution: {integrity: sha512-lEj4y5SPRcH+bjw0tyuxrEnPqQUwfQzBKgd1YamD9xyet9zLwh2gwy5F8w/Nxg5DjdgYVjjKo5aLJUf0BTDz4w==} + '@tybys/wasm-util@0.10.1': resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} @@ -5657,6 +5669,10 @@ snapshots: '@tanstack/virtual-file-routes@1.161.7': {} + '@tsconfig/strictest@2.0.8': {} + + '@tsconfig/vite-react@7.0.2': {} + '@tybys/wasm-util@0.10.1': dependencies: tslib: 2.8.1 diff --git a/webui2/src/components/bugs/QueryInput.tsx b/webui2/src/components/bugs/QueryInput.tsx index 05b1f67f030dc61e71cab1738200fb215c7f61b7..5a029569c20c786128172f538720007be98eb294 100644 --- a/webui2/src/components/bugs/QueryInput.tsx +++ b/webui2/src/components/bugs/QueryInput.tsx @@ -256,7 +256,8 @@ export function QueryInput({ value, onChange, onSubmit, placeholder, className } setAcIndex((i) => (i - 1 + suggestions.length) % suggestions.length); } else if (e.key === "Enter" || e.key === "Tab") { e.preventDefault(); - applySuggestion(suggestions[acIndex]); + const suggestion = suggestions[acIndex]; + if (suggestion) applySuggestion(suggestion); } else if (e.key === "Escape") { setCompletion(null); } diff --git a/webui2/src/routes/index.tsx b/webui2/src/routes/index.tsx index ca8844a23e33dec49fb04005d00773d8abf5f80b..6d11dad28a78dff46336a388732fc278c877f7de 100644 --- a/webui2/src/routes/index.tsx +++ b/webui2/src/routes/index.tsx @@ -34,7 +34,7 @@ function RouteComponent() { if (data?.repositories.nodes.length === 1) { void navigate({ to: "/$repo", - params: { repo: repoSlug(data.repositories.nodes[0].name) }, + params: { repo: repoSlug(data.repositories.nodes[0]?.name) }, search: { ref: "", path: "", type: "tree" as const }, replace: true, }); diff --git a/webui2/tsconfig.app.json b/webui2/tsconfig.app.json index b785101fc1743b79cba3a47d2c2fb7fd091025bb..678a196a6a828f4749d49feefc00fdd5ff27f56a 100644 --- a/webui2/tsconfig.app.json +++ b/webui2/tsconfig.app.json @@ -1,17 +1,8 @@ { + "extends": ["@tsconfig/strictest/tsconfig.json", "@tsconfig/vite-react/tsconfig.json"], "compilerOptions": { - "target": "ES2022", - "lib": ["ES2022", "DOM"], - "skipLibCheck": true, - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "isolatedModules": true, - "moduleDetection": "force", - "noEmit": true, - "jsx": "react-jsx", - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, + "exactOptionalPropertyTypes": false, + "noPropertyAccessFromIndexSignature": false, "paths": { "@/*": ["./src/*"] } diff --git a/webui2/tsconfig.node.json b/webui2/tsconfig.node.json index 841f18d542a6d8b434941c899911d91266d6f758..25df140ab9f33187a4c19aec34433c8e67dfb872 100644 --- a/webui2/tsconfig.node.json +++ b/webui2/tsconfig.node.json @@ -1,17 +1,15 @@ { + "extends": "@tsconfig/strictest/tsconfig.json", "compilerOptions": { "target": "ES2022", "lib": ["ES2023"], "types": ["node"], "moduleResolution": "bundler", "allowImportingTsExtensions": true, - "isolatedModules": true, "moduleDetection": "force", "noEmit": true, - "skipLibCheck": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true + "verbatimModuleSyntax": true, + "noPropertyAccessFromIndexSignature": false }, "include": ["vite.config.ts", "codegen.ts"] }