Skip to content

fix: lint warnings and format issues across template + docs#318

Merged
laugharn merged 2 commits into
release-2026-06-07from
fix/lint-warnings
Jun 7, 2026
Merged

fix: lint warnings and format issues across template + docs#318
laugharn merged 2 commits into
release-2026-06-07from
fix/lint-warnings

Conversation

@laugharn
Copy link
Copy Markdown
Collaborator

@laugharn laugharn commented Jun 6, 2026

Summary

Fixes everything pnpm lint complained about that was within our control. The branch was previously blocked by 6 oxfmt format violations and surfaced 12 oxlint warnings, most of which were spurious (Shopify's __typename, Node's __dirname, etc.).

  • Format: ran oxfmt on 6 template files and 2 docs MDX files. (The MDX issues only surfaced once template stopped failing — turbo had been killing the docs job mid-check.)
  • Allow lists: added no-underscore-dangle overrides so we stop warning about names we don't control: __typename (Shopify GraphQL), __dirname (Node builtin), __registerFileInput (vendored AI Elements).
  • Real hook-deps fixes in template-owned code:
    • components/agent/agent-panel.tsx — include onOpenChange and triggerRef in the outside-click effect's deps.
    • hooks/use-scroll-contain.ts — include ref in deps (refs are stable; replaced a stale oxlint-disable comment that used the wrong rule path and no longer matched where oxlint reports the warning).
    • components/cart/context.tsxoxlint-disable comments on the unmount cleanup that intentionally reads ref.current at teardown time.

After this PR, the only remaining warnings are 2 in vendored components/ai-elements/message.tsx files, intentionally left alone.

Test plan

  • pnpm lint passes (exit 0).
  • pnpm build succeeds.
  • Agent panel still closes on outside click / Escape.
  • Cart adjustments + debounced timers still cancel cleanly on navigation.
  • Scroll containment still blocks page scroll when the agent panel is open.

🤖 Generated with Claude Code

- Run oxfmt on previously-unformatted files in apps/template
  and 2 mdx files in apps/docs (caught by oxfmt --check).
- Add `no-underscore-dangle` allow lists to both .oxlintrc.json
  files for names we don't control: __typename (Shopify GraphQL),
  __dirname (Node builtin), __registerFileInput (vendored
  AI Elements).
- Fix react-hooks/exhaustive-deps warnings in template-owned code:
  - agent-panel.tsx: include onOpenChange and triggerRef in the
    outside-click effect's deps.
  - use-scroll-contain.ts: include ref in deps (refs are stable;
    replaces a no-longer-effective oxlint-disable comment).
  - cart/context.tsx: add oxlint-disable comments on the unmount
    cleanup that intentionally reads ref.current at teardown.

The only remaining warnings are in vendored components/ai-elements
code, left alone by design.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Jun 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
shop-docs Ready Ready Preview, Comment Jun 7, 2026 11:59am
shop-template Ready Ready Preview, Comment, Open in v0 Jun 7, 2026 11:59am

* chore: expand alphabetization rule and apply it across shopify operations

The Ordering rule in apps/template/AGENTS.md previously named only four
things to alphabetize: export specifiers, i18n JSON keys, string union
type members, and config object keys. That left object destructuring
patterns and interface/type properties undefined — and `operations/`
had drifted accordingly.

Update the rule wording to include both, then bring `operations/products.ts`
and `operations/cart.ts` into compliance:

- products.ts: alphabetize all parameter types, destructuring patterns,
  and return-shape literals across `buildCatalogQuery`, `fetchCatalogProducts`,
  `getSearchFacets`, `searchIndexProducts`, and `getCollectionProducts`.
- cart.ts: alphabetize the `addCartDeliveryAddress`/`updateCartDeliveryAddress`
  address parameter types and the `CartShippingOption` type (and the matching
  GraphQL response shape + the `.map()` literal that builds it).

Out of scope: GraphQL `variables: { ... }` payloads (they mirror query
variable order) and lib/types.ts type declarations (a separate sweep).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: alphabetize properties in lib/types.ts

Brings the domain-type contract module in line with the alphabetization
rule. Pure interface property reordering (plus FilterType string union)
— no runtime effect; TypeScript doesn't require literal field order to
match type declaration order, so consumers are unaffected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@laugharn laugharn changed the base branch from main to release-2026-06-07 June 7, 2026 12:10
@laugharn laugharn merged commit 42dbfe8 into release-2026-06-07 Jun 7, 2026
6 checks passed
@laugharn laugharn deleted the fix/lint-warnings branch June 7, 2026 12:12
@laugharn laugharn mentioned this pull request Jun 7, 2026
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