fix: correct cli lint coverage and store eslint issues#7154
fix: correct cli lint coverage and store eslint issues#7154isaacroldan wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
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/cliNx lint commands to run ESLint againstsrcandbindirectories 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) => { |
There was a problem hiding this comment.
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.
| onListening().catch((error: unknown) => { | |
| Promise.resolve(onListening()).catch((error: unknown) => { |
Co-authored-by: Claude Code <claude-code@anthropic.com>
9bdec6c to
7f2b445
Compare
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |

WHY are these changes introduced?
packages/cliwas missing real lint coverage for many files. In particular, VSCode was reporting ESLint errors in nested store command files thatpnpm lintdid 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?
packages/clilint target to run ESLint againstsrcandbindirectlyHow to test your changes?
From the repo root:
Optional spot checks:
Measuring impact
How do we know this change was effective? Please choose one:
Checklist