Skip to content

Handle spread flags in command flags lint rule#7853

Open
alfonso-noriega wants to merge 1 commit into
mainfrom
fix-command-flags-spread
Open

Handle spread flags in command flags lint rule#7853
alfonso-noriega wants to merge 1 commit into
mainfrom
fix-command-flags-spread

Conversation

@alfonso-noriega

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

The custom @shopify/cli/command-flags-with-env ESLint rule can crash while linting command classes that include spread flag definitions or shared flag objects.

Recent CI failures showed:

  • TypeError: Cannot read properties of undefined (reading 'map')
  • Rule: "@shopify/cli/command-flags-with-env"

WHAT is this pull request doing?

Updates the rule to skip flag entries that do not have inline option object properties, such as spread elements or shared flag references, instead of assuming every entry is a direct Flags.*({...}) call.

How to test your changes?

  • node <inline ESLint smoke test> — verified a fixture with ...globalFlags, an inline env-backed flag, and a shared flag reference lints without fatal errors and reports [].
  • pnpm eslint packages/eslint-plugin-cli/rules/command-flags-with-env.js
  • pnpm nx run store:lint — attempted, but it currently fails on unrelated existing lint issues in packages/store/src/cli/services/store/auth/callback.test.ts and packages/store/src/cli/services/store/auth/token-client.ts.

Post-release steps

None.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • This change is not user-facing, so no changeset is needed

@alfonso-noriega alfonso-noriega requested a review from a team as a code owner June 18, 2026 10:51
@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant