Skip to content

Clear the type-import and unused-variable lint findings - #2736

Draft
bramvanderholst wants to merge 4 commits into
canaryfrom
chore/eslint-fixes
Draft

bramvanderholst wants to merge 4 commits into
canaryfrom
chore/eslint-fixes

Conversation

@bramvanderholst

Copy link
Copy Markdown
Contributor

Written by 🤖:

Change

One commit for each kind of change:

  1. import type for each import that only imports types: 288 findings of @typescript-eslint/consistent-type-imports in 163 files. The commit has only the fixes of eslint --fix for this rule.
  2. @typescript-eslint/no-unused-vars in @graphcommerce/eslint-config-pwa gets ignoreRestSiblings: true and argsIgnorePattern: '^_'. Components take props such as uid out of ...rest before they give the rest to ActionCard. Test mocks keep parameters such as _options for their types.
  3. Unused imports, variables, destructured props and parameters are removed: 183 findings. An unused parameter of an exported function or of a type guard gets a _ prefix, so callers and plugins keep the same signature. next-config and cli include their rebuilt dist.
  4. @graphcommerce/image makes the sx array itself, because @graphcommerce/next-ui depends on @graphcommerce/image. config.ts reads __NEXT_IMAGE_OPTS one time, and imageUrl() uses that value.

For #2715

The Oxlint config of #2715 has 'no-unused-vars': 'error'. Add ignoreRestSiblings: true and argsIgnorePattern: '^_' there too. 14 files of commit 1 are also in #2715. #2715 changes no import line in these files.

Not in this PR

  • examples/magento-storyblok/.storyblok/types/storyblok.d.ts has an unused import. storyblok types generates this file.
  • The other ESLint findings: dependency declarations, React Compiler rules, display-name, no-console and others.

Test plan

  1. tsgo --noEmit -p . passes in examples/magento-graphcms and examples/magento-open-source.
  2. With @graphcommerce/algolia-products, algolia-categories, magento-payment-adyen, magento-payment-braintree, magento-payment-paypal and magento-search-overlay active in magento-graphcms, tsgo reports 36 errors in these packages. None of them is on a changed line.
  3. yarn workspace @graphcommerce/magento-graphcms dev. Open /, /men/photography and /p/ages-at-fashion-gc-442-sock. The pages render with their images.

Only the fixes of eslint --fix for this rule, formatted with Prettier. The build output stays the same, because TypeScript and SWC already drop imports that are only types.
Components such as ConfigurableOptionValueImage and WishlistItemActionCard take props like uid and selectedOptions out of ...rest, so ActionCard does not receive them. Test mocks keep parameters such as _options for their types. no-unused-vars reported both.
Unused imports, variables and destructured props are gone. An unused parameter of an exported function or a type guard gets a _ prefix, so callers and plugins keep the same signature. next-config and cli include their rebuilt dist.
Image imported sxx from next-ui, and next-ui depends on image. config.ts reads __NEXT_IMAGE_OPTS once, and imageUrl() uses that value.
@vercel

vercel Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
graphcommerce-246 Ready Ready Preview Nov 30, 2026 3:23pm UTC
graphcommerce-247 Ready Ready Preview Nov 30, 2026 3:23pm UTC
graphcommerce-hygraph-dynamic-rows-ui Ready Ready Preview Nov 30, 2026 3:23pm UTC
graphcommerce-open-source Ready Ready Preview Nov 30, 2026 3:23pm UTC
graphcommerce-storyblok Ready Ready Preview Nov 30, 2026 3:23pm UTC

Request Review

@bramvanderholst
bramvanderholst marked this pull request as draft November 30, 2026 15:18
@changeset-bot

changeset-bot Bot commented Nov 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9a9c5fb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 87 packages
Name Type
@graphcommerce/eslint-config-pwa Patch
@graphcommerce/image Patch
@graphcommerce/misc Patch
@graphcommerce/hygraph-dynamic-rows-ui Patch
@graphcommerce/framer-next-pages-example Patch
@graphcommerce/framer-scroller-example Patch
@graphcommerce/image-example Patch
@graphcommerce/magento-graphcms Patch
@graphcommerce/magento-open-source Patch
@graphcommerce/magento-storyblok Patch
@graphcommerce/docs Patch
@graphcommerce/browserslist-config-pwa Patch
@graphcommerce/changeset-changelog Patch
@graphcommerce/graphql-codegen-markdown-docs Patch
@graphcommerce/graphql-codegen-near-operation-file Patch
@graphcommerce/graphql-codegen-relay-optimizer-plugin Patch
@graphcommerce/next-config Patch
@graphcommerce/prettier-config-pwa Patch
@graphcommerce/typescript-config-pwa Patch
@graphcommerce/address-autocomplete Patch
@graphcommerce/address-fields-nl Patch
@graphcommerce/algolia-categories Patch
@graphcommerce/algolia-insights Patch
@graphcommerce/algolia-personalization Patch
@graphcommerce/algolia-products Patch
@graphcommerce/algolia-recommend Patch
@graphcommerce/algolia-search Patch
@graphcommerce/cli Patch
@graphcommerce/demo-magento-graphcommerce Patch
@graphcommerce/ecommerce-ui Patch
@graphcommerce/framer-next-pages Patch
@graphcommerce/framer-scroller Patch
@graphcommerce/framer-utils Patch
@graphcommerce/google-datalayer Patch
@graphcommerce/google-playstore Patch
@graphcommerce/googleanalytics Patch
@graphcommerce/googlerecaptcha Patch
@graphcommerce/googletagmanager Patch
@graphcommerce/graphcms-ui Patch
@graphcommerce/graphql-mesh Patch
@graphcommerce/graphql Patch
@graphcommerce/hygraph-cli Patch
@graphcommerce/hygraph-dynamic-rows Patch
@graphcommerce/hygraph-ui Patch
@graphcommerce/lingui-next Patch
@graphcommerce/magento-cart-checkout Patch
@graphcommerce/magento-cart-coupon Patch
@graphcommerce/magento-cart-email Patch
@graphcommerce/magento-cart-items Patch
@graphcommerce/magento-cart-payment-method Patch
@graphcommerce/magento-cart-pickup Patch
@graphcommerce/magento-cart-shipping-address Patch
@graphcommerce/magento-cart-shipping-method Patch
@graphcommerce/magento-cart Patch
@graphcommerce/magento-category Patch
@graphcommerce/magento-cms Patch
@graphcommerce/magento-compare Patch
@graphcommerce/magento-customer Patch
@graphcommerce/magento-graphql-rest Patch
@graphcommerce/magento-graphql Patch
@graphcommerce/magento-newsletter Patch
@graphcommerce/magento-payment-adyen Patch
@graphcommerce/magento-payment-afterpay Patch
@graphcommerce/magento-payment-braintree Patch
@graphcommerce/magento-payment-included Patch
@graphcommerce/magento-payment-klarna Patch
@graphcommerce/magento-payment-multisafepay Patch
@graphcommerce/magento-payment-paypal Patch
@graphcommerce/magento-payment-tokens Patch
@graphcommerce/magento-product-bundle Patch
@graphcommerce/magento-product-configurable Patch
@graphcommerce/magento-product-downloadable Patch
@graphcommerce/magento-product-grouped Patch
@graphcommerce/magento-product-simple Patch
@graphcommerce/magento-product-virtual Patch
@graphcommerce/magento-product Patch
@graphcommerce/magento-recently-viewed-products Patch
@graphcommerce/magento-review Patch
@graphcommerce/magento-search-overlay Patch
@graphcommerce/magento-search Patch
@graphcommerce/magento-store Patch
@graphcommerce/magento-wishlist Patch
@graphcommerce/mollie-magento-payment Patch
@graphcommerce/next-ui Patch
@graphcommerce/react-hook-form Patch
@graphcommerce/service-worker Patch
@graphcommerce/storyblok-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This branch was successfully deployed

5 active deployments
Preview – graphcommerce-246 — 9a9c5fb9 Deployed Nov 30, 2026 by vercel[bot]
Preview – graphcommerce-open-source — 9a9c5fb9 Deployed Nov 30, 2026 by vercel[bot]
Preview – graphcommerce-247 — 9a9c5fb9 Deployed Nov 30, 2026 by vercel[bot]
Preview – graphcommerce-storyblok — 9a9c5fb9 Deployed Nov 30, 2026 by vercel[bot]
Preview – graphcommerce-hygraph-dynamic-rows-ui — 9a9c5fb9 Deployed Nov 30, 2026 by vercel[bot]
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