From c99176c157df5c9c97f821075b2f230eb6f697cb Mon Sep 17 00:00:00 2001 From: KokoMilev Date: Mon, 30 Mar 2026 16:04:28 +0200 Subject: [PATCH 1/4] chore(apollo-vertex): enable type-aware linting in oxlint [AGVSOL-1969] Add --type-aware flag to lint and lint:fix scripts so oxlint enforces type-checked rules that were fixed in PR #400. Add oxlint-tsgolint dependency required for type-aware mode. Fix deadlock in ensureValidToken by replacing await with void on invalidateQueries. --- apps/apollo-vertex/lib/auth.ts | 4 +- apps/apollo-vertex/package.json | 5 +- apps/apollo-vertex/registry/card/card.tsx | 1 + .../registry/shell/shell-auth-provider.tsx | 4 +- .../templates/AiChatLoginGate.tsx | 8 +- .../templates/AiChatTemplate.tsx | 4 +- package.json | 3 +- pnpm-lock.yaml | 86 ++++++++++++++++--- 8 files changed, 94 insertions(+), 21 deletions(-) diff --git a/apps/apollo-vertex/lib/auth.ts b/apps/apollo-vertex/lib/auth.ts index d29adb87b..5782db92b 100644 --- a/apps/apollo-vertex/lib/auth.ts +++ b/apps/apollo-vertex/lib/auth.ts @@ -212,7 +212,7 @@ export const ensureValidToken = async ( try { await handleOAuthCallback(clientId, baseUrl, redirectPath); } catch { - queryClient.resetQueries({ queryKey: TOKEN_QUERY_KEY }); + void queryClient.resetQueries({ queryKey: TOKEN_QUERY_KEY }); } } @@ -276,5 +276,5 @@ export const logout = ( sessionStorage.removeItem(STORAGE_KEYS.CODE_VERIFIER); sessionStorage.removeItem(STORAGE_KEYS.STATE); sessionStorage.removeItem(STORAGE_KEYS.AUTH_RETURN_TO); - queryClient.resetQueries({ queryKey: TOKEN_QUERY_KEY }); + void queryClient.resetQueries({ queryKey: TOKEN_QUERY_KEY }); }; diff --git a/apps/apollo-vertex/package.json b/apps/apollo-vertex/package.json index b5654236f..89ad1ef80 100644 --- a/apps/apollo-vertex/package.json +++ b/apps/apollo-vertex/package.json @@ -13,8 +13,8 @@ "postbuild": "pagefind --site .next/server/app --output-path public/_pagefind", "format": "biome format --write", "format:check": "biome format", - "lint": "oxlint", - "lint:fix": "oxlint --fix", + "lint": "oxlint --type-aware", + "lint:fix": "oxlint --fix --type-aware", "lint:deps": "depcruise registry --config .dependency-cruiser.js", "typecheck": "tsc --noEmit" }, @@ -104,6 +104,7 @@ "dependency-cruiser": "^17.3.6", "eslint-plugin-react": "^7.37.5", "oxlint": "^1.38.0", + "oxlint-tsgolint": "^0.18.1", "pagefind": "^1.4.0", "shadcn": "latest", "tw-animate-css": "^1.4.0" diff --git a/apps/apollo-vertex/registry/card/card.tsx b/apps/apollo-vertex/registry/card/card.tsx index d9d31dfa0..ae5d84394 100644 --- a/apps/apollo-vertex/registry/card/card.tsx +++ b/apps/apollo-vertex/registry/card/card.tsx @@ -78,6 +78,7 @@ function Card({ /> diff --git a/apps/apollo-vertex/templates/AiChatTemplate.tsx b/apps/apollo-vertex/templates/AiChatTemplate.tsx index 5803e6b3d..4488bafe2 100644 --- a/apps/apollo-vertex/templates/AiChatTemplate.tsx +++ b/apps/apollo-vertex/templates/AiChatTemplate.tsx @@ -52,7 +52,9 @@ function AiChatWithConnection({ sendMessage(text)} + onSendMessage={(text) => { + void sendMessage(text); + }} onStop={stop} onClearChat={clear} title={t("ai_assistant")} diff --git a/package.json b/package.json index 57b012d90..2dbd5227b 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,8 @@ "brace-expansion": ">=5.0.5", "flatted": ">=3.4.2", "happy-dom": ">=20.8.8", - "handlebars": ">=4.7.9" + "handlebars": ">=4.7.9", + "path-to-regexp": ">=8.4.0" } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bb68aba6a..b8613ac7e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,6 +18,7 @@ overrides: flatted: '>=3.4.2' happy-dom: '>=20.8.8' handlebars: '>=4.7.9' + path-to-regexp: '>=8.4.0' importers: @@ -335,7 +336,10 @@ importers: version: 7.37.5(eslint@9.39.3(jiti@2.6.1)) oxlint: specifier: ^1.38.0 - version: 1.50.0 + version: 1.50.0(oxlint-tsgolint@0.18.1) + oxlint-tsgolint: + specifier: ^0.18.1 + version: 0.18.1 pagefind: specifier: ^1.4.0 version: 1.4.0 @@ -3721,6 +3725,36 @@ packages: resolution: {integrity: sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==} engines: {node: '>=8.0.0'} + '@oxlint-tsgolint/darwin-arm64@0.18.1': + resolution: {integrity: sha512-CxSd15ZwHn70UJFTXVvy76bZ9zwI097cVyjvUFmYRJwvkQF3VnrTf2oe1gomUacErksvtqLgn9OKvZhLMYwvog==} + cpu: [arm64] + os: [darwin] + + '@oxlint-tsgolint/darwin-x64@0.18.1': + resolution: {integrity: sha512-LE7VW/T/VcKhl3Z1ev5BusrxdlQ3DWweSeOB+qpBeur2h8+vCWq+M7tCO29C7lveBDfx1+rNwj4aiUVlA+Qs+g==} + cpu: [x64] + os: [darwin] + + '@oxlint-tsgolint/linux-arm64@0.18.1': + resolution: {integrity: sha512-2AG8YIXVJJbnM0rcsJmzzWOjZXBu5REwowgUpbHZueF7OYM3wR7Xu8pXEpAojEHAtYYZ3X4rpPoetomkJx7kCw==} + cpu: [arm64] + os: [linux] + + '@oxlint-tsgolint/linux-x64@0.18.1': + resolution: {integrity: sha512-f8vDYPEdiwpA2JaDEkadTXfuqIgweQ8zcL4SX75EN2kkW2oAynjN7cd8m86uXDgB0JrcyOywbRtwnXdiIzXn2A==} + cpu: [x64] + os: [linux] + + '@oxlint-tsgolint/win32-arm64@0.18.1': + resolution: {integrity: sha512-fBdML05KMDAL9ebWeoHIzkyI86Eq6r9YH5UDRuXJ9vAIo1EnKo0ti7hLUxNdc2dy2FF/T4k98p5wkkXvLyXqfA==} + cpu: [arm64] + os: [win32] + + '@oxlint-tsgolint/win32-x64@0.18.1': + resolution: {integrity: sha512-cYZMhNrsq9ZZ3OUWHyawqiS+c8HfieYG0zuZP2LbEuWWPfdZM/22iAlo608J+27G1s9RXQhvgX6VekwWbXbD7A==} + cpu: [x64] + os: [win32] + '@oxlint/binding-android-arm-eabi@1.50.0': resolution: {integrity: sha512-G7MRGk/6NCe+L8ntonRdZP7IkBfEpiZ/he3buLK6JkLgMHgJShXZ+BeOwADmspXez7U7F7L1Anf4xLSkLHiGTg==} engines: {node: ^20.19.0 || >=22.12.0} @@ -6147,6 +6181,7 @@ packages: '@xmldom/xmldom@0.9.8': resolution: {integrity: sha512-p96FSY54r+WJ50FIOsCOjyj/wavs8921hG5+kVMmZgKcvIKxMXHTrjNJvRgWa/zuX3B6t2lijLNFaOyuxUH+2A==} engines: {node: '>=14.6'} + deprecated: this version has critical issues, please update to the latest version '@xtuc/ieee754@1.2.0': resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} @@ -9965,6 +10000,10 @@ packages: resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} engines: {node: '>= 0.4'} + oxlint-tsgolint@0.18.1: + resolution: {integrity: sha512-Hgb0wMfuXBYL0ddY+1hAG8IIfC40ADwPnBuUaC6ENAuCtTF4dHwsy7mCYtQ2e7LoGvfoSJRY0+kqQRiembJ/jQ==} + hasBin: true + oxlint@1.50.0: resolution: {integrity: sha512-iSJ4IZEICBma8cZX7kxIIz9PzsYLF2FaLAYN6RKu7VwRVKdu7RIgpP99bTZaGl//Yao7fsaGZLSEo5xBrI5ReQ==} engines: {node: ^20.19.0 || >=22.12.0} @@ -10168,11 +10207,8 @@ packages: resolution: {integrity: sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==} engines: {node: 18 || 20 || >=22} - path-to-regexp@6.3.0: - resolution: {integrity: sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==} - - path-to-regexp@8.3.0: - resolution: {integrity: sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==} + path-to-regexp@8.4.0: + resolution: {integrity: sha512-PuseHIvAnz3bjrM2rGJtSgo1zjgxapTLZ7x2pjhzWwlp4SJQgK3f3iZIQwkpEnBaKz6seKBADpM4B4ySkuYypg==} path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} @@ -15374,6 +15410,24 @@ snapshots: '@opentelemetry/api@1.9.0': optional: true + '@oxlint-tsgolint/darwin-arm64@0.18.1': + optional: true + + '@oxlint-tsgolint/darwin-x64@0.18.1': + optional: true + + '@oxlint-tsgolint/linux-arm64@0.18.1': + optional: true + + '@oxlint-tsgolint/linux-x64@0.18.1': + optional: true + + '@oxlint-tsgolint/win32-arm64@0.18.1': + optional: true + + '@oxlint-tsgolint/win32-x64@0.18.1': + optional: true + '@oxlint/binding-android-arm-eabi@1.50.0': optional: true @@ -22182,7 +22236,7 @@ snapshots: headers-polyfill: 4.0.3 is-node-process: 1.2.0 outvariant: 1.4.3 - path-to-regexp: 6.3.0 + path-to-regexp: 8.4.0 picocolors: 1.1.1 rettime: 0.7.0 statuses: 2.0.2 @@ -22541,7 +22595,16 @@ snapshots: object-keys: 1.1.1 safe-push-apply: 1.0.0 - oxlint@1.50.0: + oxlint-tsgolint@0.18.1: + optionalDependencies: + '@oxlint-tsgolint/darwin-arm64': 0.18.1 + '@oxlint-tsgolint/darwin-x64': 0.18.1 + '@oxlint-tsgolint/linux-arm64': 0.18.1 + '@oxlint-tsgolint/linux-x64': 0.18.1 + '@oxlint-tsgolint/win32-arm64': 0.18.1 + '@oxlint-tsgolint/win32-x64': 0.18.1 + + oxlint@1.50.0(oxlint-tsgolint@0.18.1): optionalDependencies: '@oxlint/binding-android-arm-eabi': 1.50.0 '@oxlint/binding-android-arm64': 1.50.0 @@ -22562,6 +22625,7 @@ snapshots: '@oxlint/binding-win32-arm64-msvc': 1.50.0 '@oxlint/binding-win32-ia32-msvc': 1.50.0 '@oxlint/binding-win32-x64-msvc': 1.50.0 + oxlint-tsgolint: 0.18.1 p-each-series@2.2.0: {} @@ -22738,9 +22802,7 @@ snapshots: lru-cache: 11.2.6 minipass: 7.1.3 - path-to-regexp@6.3.0: {} - - path-to-regexp@8.3.0: {} + path-to-regexp@8.4.0: {} path-type@4.0.0: {} @@ -23899,7 +23961,7 @@ snapshots: depd: 2.0.0 is-promise: 4.0.0 parseurl: 1.3.3 - path-to-regexp: 8.3.0 + path-to-regexp: 8.4.0 transitivePeerDependencies: - supports-color From 9fad13f2cfe0219551f8dd085de8fe90b1f83177 Mon Sep 17 00:00:00 2001 From: KokoMilev Date: Tue, 31 Mar 2026 10:21:26 +0200 Subject: [PATCH 2/4] fix(apollo-vertex): improve token parsing error handling in ensureValidToken --- apps/apollo-vertex/lib/auth.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/apollo-vertex/lib/auth.ts b/apps/apollo-vertex/lib/auth.ts index 5782db92b..3f8cfcc4e 100644 --- a/apps/apollo-vertex/lib/auth.ts +++ b/apps/apollo-vertex/lib/auth.ts @@ -221,9 +221,15 @@ export const ensureValidToken = async ( return null; } - const { data: tokenData, success } = TokenDataSchema.safeParse( - JSON.parse(tokenDataStr), - ); + let parsed: unknown; + try { + parsed = JSON.parse(tokenDataStr); + } catch { + clearTokenData(); + return null; + } + + const { data: tokenData, success } = TokenDataSchema.safeParse(parsed); if (!success) { clearTokenData(); From 67d4713b40ca0f38e02733d768bed40651c4727b Mon Sep 17 00:00:00 2001 From: KokoMilev Date: Tue, 31 Mar 2026 15:58:35 +0200 Subject: [PATCH 3/4] fix(apollo-vertex): resolve type-aware lint errors in data-table components - Type onGlobalFilterChange callback with Updater (no-unsafe-argument) - Narrow cell value with typeof checks instead of String() cast (no-base-to-string) - Suppress no-unsafe-assignment at tanstack getFilterValue() boundary --- .../registry/data-table/data-table-faceted-filter.tsx | 1 + .../registry/data-table/data-table-filters.tsx | 6 +++++- apps/apollo-vertex/registry/data-table/data-table.tsx | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/apollo-vertex/registry/data-table/data-table-faceted-filter.tsx b/apps/apollo-vertex/registry/data-table/data-table-faceted-filter.tsx index 6f559bf6d..8159bb1ca 100644 --- a/apps/apollo-vertex/registry/data-table/data-table-faceted-filter.tsx +++ b/apps/apollo-vertex/registry/data-table/data-table-faceted-filter.tsx @@ -36,6 +36,7 @@ function DataTableFacetedFilter({ if (!column) return null; const filterValue = column.getFilterValue(); + // oxlint-disable-next-line typescript-eslint(no-unsafe-assignment) -- tanstack getFilterValue() returns unknown; we know our faceted filters use string[] const selectedValues: string[] = Array.isArray(filterValue) ? filterValue : []; diff --git a/apps/apollo-vertex/registry/data-table/data-table-filters.tsx b/apps/apollo-vertex/registry/data-table/data-table-filters.tsx index 7acc21308..1721e5491 100644 --- a/apps/apollo-vertex/registry/data-table/data-table-filters.tsx +++ b/apps/apollo-vertex/registry/data-table/data-table-filters.tsx @@ -14,7 +14,11 @@ export const dataTableGlobalFilterFn = ( const meta = cell.column.columnDef.meta; const displayValue = meta?.getFilterValue ? meta.getFilterValue(value, row) - : String(value ?? ""); + : typeof value === "string" + ? value + : typeof value === "number" || typeof value === "boolean" + ? String(value) + : ""; return displayValue.toLowerCase().includes(searchStr); }); }; diff --git a/apps/apollo-vertex/registry/data-table/data-table.tsx b/apps/apollo-vertex/registry/data-table/data-table.tsx index 41a5c8716..e3110cee2 100644 --- a/apps/apollo-vertex/registry/data-table/data-table.tsx +++ b/apps/apollo-vertex/registry/data-table/data-table.tsx @@ -18,6 +18,7 @@ import { type RowSelectionState, type SortingState, type Table as TanstackTable, + type Updater, type VisibilityState, } from "@tanstack/react-table"; import * as React from "react"; @@ -141,7 +142,7 @@ function DataTable({ onColumnVisibilityChange, onColumnOrderChange, ...(isRowSelectionEnabled && { onRowSelectionChange }), - onGlobalFilterChange: (updater) => { + onGlobalFilterChange: (updater: Updater) => { onGlobalFilterChange(updater); resetPageIndex(); }, From 5d821e3c1e8ed4e6b4e63a26c7c3a0a628843842 Mon Sep 17 00:00:00 2001 From: KokoMilev Date: Tue, 31 Mar 2026 17:11:53 +0200 Subject: [PATCH 4/4] fix(apollo-vertex): refine unsafe type assertion handling in AiChatLoginGate and Card --- apps/apollo-vertex/registry/card/card.tsx | 2 +- apps/apollo-vertex/templates/AiChatLoginGate.tsx | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/apollo-vertex/registry/card/card.tsx b/apps/apollo-vertex/registry/card/card.tsx index ae5d84394..03434dbbb 100644 --- a/apps/apollo-vertex/registry/card/card.tsx +++ b/apps/apollo-vertex/registry/card/card.tsx @@ -78,7 +78,7 @@ function Card({ />