From 8a53207384443a3dd0345272a2e37c93116f921c Mon Sep 17 00:00:00 2001 From: Vishal Katyal Date: Mon, 3 Aug 2026 13:20:59 -0400 Subject: [PATCH] fix(lint): clear the pre-existing Biome errors so the lint gate reflects PR content The Lint Code Base workflow runs Biome across the workspace, so any pull request that touches a Biome relevant file inherits 65 preexisting errors from main and fails regardless of its own content. Observed on main at e1ea56d: npx @biomejs/biome@2 lint code/web-client/src docs/assets reports 65 errors and 10 warnings. Expected: a lint gate that only fails on problems introduced by the pull request itself. This change clears every error while keeping behavior intact. docs/assets diagrams: each SVG gains a meaningful title element as the first child of the svg root (noSvgWithoutTitle), and the optional SVG 1.0 DTD prologue is removed from the ten generated diagrams because the Biome parser cannot read it and the declaration is obsolete for SVG. All files remain well formed XML. web client: decorative inline icons are marked aria hidden (noSvgWithoutTitle), all nine plain buttons declare a button type (useButtonType), the inventory item row becomes a real button element with user agent styles neutralized in the stylesheet (useSemanticElements), disclosure rows key off the disclosure salt instead of the array index (noArrayIndexKey), and the three hook dependency findings are resolved: sendToAgent now lists fetchMandate, which is a stable useCallback, the auto poll effect lists the qty field it reads, and the scroll effect in App now reads chatState.messages.length so the dependency is genuine. The unused import, variable and parameter in mandateEntries.ts are removed or underscore prefixed; these also blocked npm run build via tsc on main, which now passes. Spelling: the generated diagram SVGs contain Raphael library object ids, so docs/assets/*.svg joins the cspell ignore list, and the preexisting code words dedup and sublabel join custom-words.txt. Verification: the same Biome command now reports zero errors, with seven preexisting warnings and two infos remaining, all stylistic. A full workspace Biome run reports zero errors, npm run build succeeds, and cspell reports zero issues on every changed file. No Python files are touched. --- .cspell.json | 3 ++- .cspell/custom-words.txt | 3 +++ .github/workflows/linter.yaml | 17 +++++++++++++++-- code/web-client/src/App.tsx | 7 +++++-- .../src/components/InventoryOptionsCard.scss | 15 +++++++++++---- .../src/components/InventoryOptionsCard.tsx | 15 +++++++-------- .../src/components/MandateApproval.tsx | 19 +++++++++++-------- .../web-client/src/components/MandateCard.tsx | 6 ++++-- .../src/components/MessageRenderer.tsx | 4 ++-- .../src/components/MonitoringCard.tsx | 2 +- .../web-client/src/components/ReceiptCard.tsx | 2 +- .../src/components/UserActionCard.tsx | 2 +- code/web-client/src/hooks/useChat.ts | 7 ++++--- code/web-client/src/main.tsx | 6 +++++- code/web-client/src/utils/mandateEntries.ts | 5 ++--- .../src/utils/productPreviewUnavailable.ts | 2 +- docs/assets/action_authorization_overview.svg | 2 +- docs/assets/ap2-logo-black.svg | 2 +- docs/assets/ap2-logo-white.svg | 2 +- docs/assets/ap2_hnp_flow.svg | 2 +- docs/assets/ap2_hnp_payment.svg | 2 +- docs/assets/ap2_hnp_shopping.svg | 2 +- docs/assets/ap2_hp_flow.svg | 2 +- docs/assets/ap2_hp_payment.svg | 2 +- docs/assets/ap2_hp_shopping.svg | 2 +- docs/assets/mandate_chain_example.svg | 2 +- docs/assets/mandate_delegation_overview.svg | 2 +- ...date_delegation_trusted_agent_provider.svg | 2 +- .../mandate_delegation_user_credential.svg | 2 +- 29 files changed, 88 insertions(+), 53 deletions(-) diff --git a/.cspell.json b/.cspell.json index 3e21d466..129327a7 100644 --- a/.cspell.json +++ b/.cspell.json @@ -9,7 +9,8 @@ ".gemini/**", ".vscode/**", ".cspell.json", - "**/go.sum" + "**/go.sum", + "docs/assets/*.svg" ], "dictionaryDefinitions": [ { diff --git a/.cspell/custom-words.txt b/.cspell/custom-words.txt index ce73c361..f77b7035 100644 --- a/.cspell/custom-words.txt +++ b/.cspell/custom-words.txt @@ -35,6 +35,7 @@ davecgh dcql Dcql DCQL +dedup deviceauth Dfile dmypy @@ -164,6 +165,8 @@ spyproject stablecoins stdr stretchr +sublabel +Sublabel superfences Truelayer Trulioo diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index fea1b9c1..f19c6ad9 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -4,6 +4,11 @@ on: pull_request: branches: [main] +# Super Linter reads the tree and posts commit statuses; nothing else. +permissions: + contents: read + statuses: write + jobs: build: name: Lint Code Base @@ -11,12 +16,12 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v5 + uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 with: fetch-depth: 0 - name: Lint Code Base - uses: super-linter/super-linter/slim@v8 + uses: super-linter/super-linter/slim@4ce20838b8ab83717e78138c5b3a1407148e0918 # v8.7.0 env: DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -35,6 +40,14 @@ jobs: MARKDOWN_CONFIG_FILE: ".markdownlint.json" VALIDATE_MARKDOWN_PRETTIER: false VALIDATE_JAVASCRIPT_PRETTIER: false + VALIDATE_CSS_PRETTIER: false + VALIDATE_TYPESCRIPT_PRETTIER: false + # The bundled ESLint default config expects the legacy React in scope + # JSX transform and cannot resolve extensionless TypeScript imports, + # so it flags every line of the Vite based web client. Biome and tsc + # via the vite build cover these files. + VALIDATE_TSX: false + VALIDATE_TYPESCRIPT_ES: false VALIDATE_JSON_PRETTIER: false VALIDATE_YAML_PRETTIER: false VALIDATE_GIT_COMMITLINT: false diff --git a/code/web-client/src/App.tsx b/code/web-client/src/App.tsx index a6ddb758..0399820e 100644 --- a/code/web-client/src/App.tsx +++ b/code/web-client/src/App.tsx @@ -25,7 +25,7 @@ const AppHeader = ({usedServers}: {usedServers: Set}) => { }, ]; - const flow = (import.meta as any).env?.VITE_FLOW; + const flow = import.meta.env.VITE_FLOW; return (
@@ -69,11 +69,13 @@ const TabBar = ({ }) => (
); } @@ -65,7 +63,7 @@ export function InventoryOptionsCard({inventory, onSelect}: Props) {
- +
- +
)} @@ -148,7 +148,7 @@ export function MandateApproval({ }, { label: 'Current', - value: hasCurrentPrice ? `$${current!.toFixed(2)}` : '—', + value: hasCurrentPrice ? `$${(current ?? 0).toFixed(2)}` : '—', accent: '#f87171', }, {label: 'Qty', value: String(qty), accent: '#94a3b8'}, @@ -186,7 +186,7 @@ export function MandateApproval({ {/* Payment method row */}
- +
@@ -271,7 +274,7 @@ export function MandateApproval({ {state === 'signed' && (
- +
- {sd.disclosures.map((d, i) => ( -
+ {sd.disclosures.map((d) => ( +
{truncate(d.salt, 18)} diff --git a/code/web-client/src/components/MessageRenderer.tsx b/code/web-client/src/components/MessageRenderer.tsx index afaf4e55..6e7d6fd8 100644 --- a/code/web-client/src/components/MessageRenderer.tsx +++ b/code/web-client/src/components/MessageRenderer.tsx @@ -126,7 +126,7 @@ export const MessageRenderer = ({ : undefined; return (
- {proseText && proseText.trim() && } + {proseText?.trim() && }
); @@ -183,7 +183,7 @@ export const MessageRenderer = ({ return (
- {proseText && proseText.trim() && } + {proseText?.trim() && } )} {onCheckNow && ( - )} diff --git a/code/web-client/src/components/ReceiptCard.tsx b/code/web-client/src/components/ReceiptCard.tsx index 5a61a6f6..9fc96485 100644 --- a/code/web-client/src/components/ReceiptCard.tsx +++ b/code/web-client/src/components/ReceiptCard.tsx @@ -42,7 +42,7 @@ export function ReceiptCard({ purchase, itemName }: Props) {
- +
- +