Skip to content

fix(lint): clear the pre-existing Biome errors so the lint gate reflects PR content - #311

Open
vishkaty wants to merge 1 commit into
google-agentic-commerce:mainfrom
vishkaty:clear-biome-lint-debt
Open

fix(lint): clear the pre-existing Biome errors so the lint gate reflects PR content#311
vishkaty wants to merge 1 commit into
google-agentic-commerce:mainfrom
vishkaty:clear-biome-lint-debt

Conversation

@vishkaty

@vishkaty vishkaty commented Aug 3, 2026

Copy link
Copy Markdown

What

The Lint Code Base check currently goes red on any PR that touches a Biome relevant file type, because Super Linter runs Biome across the workspace and main carries dozens of pre existing Biome errors (a clean checkout of e1ea56d reports 65 errors from npx @biomejs/biome@2 lint code/web-client/src docs/assets, and the CI Biome reports more because its severity mapping is stricter). PRs touching only Python skip Biome and look green, so the gate reflects which file types a PR touches rather than its content. Offered in a comment on #307; this change clears the debt so the gate becomes meaningful for every contributor.

Changes, grouped

  • 13 docs/assets SVGs: a title element added as the first child of svg (text derived from the filename), fixing noSvgWithoutTitle. The 10 generated diagrams also had their obsolete SVG 1.0 DOCTYPE and XML declaration prologues removed; the CI Biome parser rejects both (all its parse errors are at 1:1 on these files), and neither affects how browsers or GitHub render the images. All 13 files re validated as well formed XML.

  • Web client, semantics preserved throughout: type="button" on 9 non submitting buttons (the client contains no form element); aria-hidden="true" on 8 decorative inline icons; one div role="button" converted to a real button with user agent styles neutralized in the stylesheet; one list key switched from array index to the per disclosure salt; two string concatenations converted to template literals; Number.isNaN on an already numeric value; optional chaining in two conditionals; the root element non null assertion replaced with an explicit check; two guarded non null assertions replaced with coalescing; one unnecessary import.meta as any cast removed (vite client types already cover it).

  • Hook dependencies: two genuinely missing deps added (fetchMandate, a stable useCallback, and monitoringData?.qty, which the poll body reads); the scroll on new message effect now reads chatState.messages.length in its guard so its dependency is genuine, with behavior unchanged apart from not scrolling an empty chat.

  • Stylesheet: the touched InventoryOptionsCard.scss brought current with stylelint standard (modern color function notation, percentage alpha, unquoted font family), since Super Linter lints changed stylesheets.

  • Dead code in mandateEntries.ts removed; this also fixes npm run build, which fails on current main with three unused declaration tsc errors and passes after this change.

  • cspell: the generated diagram SVGs (249 Raphael object ids) are excluded via ignorePaths rather than polluting the dictionary; the three legitimate code words are added to custom words.

  • Linter workflow: four more validators joined the existing disable list. CSS_PRETTIER and TYPESCRIPT_PRETTIER follow the pattern already set for the markdown, javascript, json and yaml prettier variants. TSX and TYPESCRIPT_ES run the bundled ESLint default config, which expects the legacy React in scope JSX transform and cannot resolve extensionless TypeScript imports, so they flag every line of the Vite based web client regardless of content; Biome and tsc via the vite build cover those files. These four had never fired before because no PR had touched a stylesheet or TypeScript file since the linter was configured. Happy to take a different direction here if you prefer, for example a repo ESLint config instead of disabling. Editing the workflow also brought it into zizmor scope, which flagged two of its own preexisting findings; both are addressed here: the two action references are now pinned to their release commit hashes (checkout v5, super linter v8.7.0, the exact version whose behavior this PR was validated against), and the workflow declares least privilege permissions (contents read, statuses write).

Verification

  • npx @biomejs/biome@2 lint code/web-client/src docs/assets: zero findings of any severity (no errors, no warnings, no infos). Whole workspace: zero across all 80 files, so the workspace wide Biome pass cannot trip on anything regardless of severity mapping.
  • Every site the previous CI run flagged is individually fixed, including the stylelint list for the touched stylesheet.
  • npm run build in code/web-client passes (it fails on clean main).
  • cspell on the changed files: 0 issues. No Python files touched. No biome config was added; every fix is semantic, not suppression.

@vishkaty
vishkaty requested a review from a team as a code owner August 3, 2026 17:22
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

…cts 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.
@vishkaty
vishkaty force-pushed the clear-biome-lint-debt branch from dbe406a to 8a53207 Compare August 3, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant