fix: lint warnings and format issues across template + docs#318
Merged
Conversation
- 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>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3 tasks
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes everything
pnpm lintcomplained 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.).oxfmton 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.)no-underscore-dangleoverrides so we stop warning about names we don't control:__typename(Shopify GraphQL),__dirname(Node builtin),__registerFileInput(vendored AI Elements).components/agent/agent-panel.tsx— includeonOpenChangeandtriggerRefin the outside-click effect's deps.hooks/use-scroll-contain.ts— includerefin deps (refs are stable; replaced a staleoxlint-disablecomment that used the wrong rule path and no longer matched where oxlint reports the warning).components/cart/context.tsx—oxlint-disablecomments on the unmount cleanup that intentionally readsref.currentat teardown time.After this PR, the only remaining warnings are 2 in vendored
components/ai-elements/message.tsxfiles, intentionally left alone.Test plan
pnpm lintpasses (exit 0).pnpm buildsucceeds.🤖 Generated with Claude Code