Skip to content

fix: correct cli lint coverage and store eslint issues#7154

Open
isaacroldan wants to merge 1 commit intomainfrom
fix-cli-lint-worktree
Open

fix: correct cli lint coverage and store eslint issues#7154
isaacroldan wants to merge 1 commit intomainfrom
fix-cli-lint-worktree

Conversation

@isaacroldan
Copy link
Copy Markdown
Contributor

@isaacroldan isaacroldan commented Apr 2, 2026

WHY are these changes introduced?

packages/cli was missing real lint coverage for many files. In particular, VSCode was reporting ESLint errors in nested store command files that pnpm lint did not surface because the Nx lint target used glob arguments that only hit a subset of files in this repo setup.

WHAT is this pull request doing?

  • updates the packages/cli lint target to run ESLint against src and bin directly
  • fixes the newly surfaced ESLint issues across the store command/store service files
  • cleans up a few adjacent lint violations in existing CLI files (for example nullish coalescing, import order, test mock cleanup, and small formatting/banner issues)

How to test your changes?

From the repo root:

pnpm --filter @shopify/cli lint

Optional spot checks:

pnpm exec eslint packages/cli/src/cli/services/store/admin-graphql-context.ts
pnpm exec eslint packages/cli/src/cli/services/store/auth.ts

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Copy Markdown
Contributor Author

isaacroldan commented Apr 2, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@isaacroldan isaacroldan marked this pull request as ready for review April 2, 2026 13:41
@isaacroldan isaacroldan requested a review from a team as a code owner April 2, 2026 13:41
Copilot AI review requested due to automatic review settings April 2, 2026 13:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the @shopify/cli Nx lint targets to lint the full src and bin trees (fixing previously missed ESLint coverage) and applies the newly surfaced lint fixes across the store command/service implementation and related tests.

Changes:

  • Update packages/cli Nx lint commands to run ESLint against src and bin directories directly.
  • Fix/import-order/formatting ESLint violations across store auth/session/GraphQL execution services and command wrappers.
  • Simplify test setup by removing redundant mock-clearing hooks (consistent with repo Vitest config).

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/cli/src/cli/services/store/session.ts Import order + formatting cleanup.
packages/cli/src/cli/services/store/session.test.ts Import order adjusted to satisfy lint rules.
packages/cli/src/cli/services/store/graphql-targets.ts Import order adjusted.
packages/cli/src/cli/services/store/graphql-targets.test.ts Remove redundant per-test mock clearing + formatting.
packages/cli/src/cli/services/store/execute.ts Import order adjusted.
packages/cli/src/cli/services/store/execute.test.ts Formatting + remove redundant mock clearing.
packages/cli/src/cli/services/store/execute-result.test.ts Import order + remove redundant mock clearing.
packages/cli/src/cli/services/store/execute-request.ts Trailing whitespace cleanup.
packages/cli/src/cli/services/store/execute-request.test.ts Import order + remove redundant mock clearing.
packages/cli/src/cli/services/store/auth.ts Formatting changes + refactors around callback server and token exchange flow.
packages/cli/src/cli/services/store/auth.test.ts Import/formatting cleanup and minor test refactors.
packages/cli/src/cli/services/store/admin-graphql-transport.ts Import order + minor boolean coercion cleanup.
packages/cli/src/cli/services/store/admin-graphql-transport.test.ts Import order + remove redundant mock clearing.
packages/cli/src/cli/services/store/admin-graphql-context.ts Import order cleanup.
packages/cli/src/cli/services/store/admin-graphql-context.test.ts Import order + remove redundant mock clearing.
packages/cli/src/cli/services/kitchen-sink/static.ts Minor string punctuation tweak.
packages/cli/src/cli/commands/store/execute.ts Import order cleanup.
packages/cli/src/cli/commands/store/execute.test.ts Remove redundant mock clearing.
packages/cli/src/cli/commands/store/auth.ts Import order + examples formatting.
packages/cli/src/cli/commands/store/auth.test.ts Remove redundant mock clearing.
packages/cli/src/cli/commands/docs/generate.ts Replace `
packages/cli/project.json Update lint / lint:fix commands to lint src and bin directories.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

try {
await onListening()
} catch (error) {
onListening().catch((error: unknown) => {
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onListening is typed as () => void | Promise<void>, but the new onListening().catch(...) assumes it always returns a Promise. If an implementation returns void (allowed by the type), this will throw TypeError: Cannot read properties of undefined (reading 'catch') and prevent the auth flow from completing. Wrap the call with Promise.resolve(onListening()) (or void (async () => onListening())().catch(...)) so both sync and async callbacks are handled safely.

Suggested change
onListening().catch((error: unknown) => {
Promise.resolve(onListening()).catch((error: unknown) => {

Copilot uses AI. Check for mistakes.
Co-authored-by: Claude Code <claude-code@anthropic.com>
@isaacroldan isaacroldan force-pushed the fix-cli-lint-worktree branch from 9bdec6c to 7f2b445 Compare April 2, 2026 14:07
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

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.

3 participants