Skip to content

Add mergeProps ESLint migration tooling - #8278

Open
joshblack wants to merge 6 commits into
copilot/update-style-docs-prop-mergingfrom
migrate/merge-props-eslint-tooling
Open

Add mergeProps ESLint migration tooling#8278
joshblack wants to merge 6 commits into
copilot/update-style-docs-prop-mergingfrom
migrate/merge-props-eslint-tooling

Conversation

@joshblack

@joshblack joshblack commented Aug 10, 2026

Copy link
Copy Markdown
Member

Closes #

This PR adds the tooling used to identify and track component roots that should adopt mergeProps. It introduces a private ESLint package, the migration report script, and the workflow that keeps the report current.

Changelog

New

  • Add @primer/eslint-config with the primer/prefer-merge-props rule.
  • Add the merge props migration-status report and workflow integration.

Changed

  • Register the local Primer ESLint plugin in the root configuration.

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

This is internal migration tooling and has no public-facing impact.

Testing & Reviewing

Please review the rule boundary and report output. Pure prop-forwarding wrappers should be ignored, while component roots that combine authored and consumer props should remain findings.

@changeset-bot

changeset-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5e983dc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions github-actions Bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Aug 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

@joshblack joshblack changed the title migrate/merge props eslint tooling Add mergeProps ESLint migration tooling Aug 10, 2026
@joshblack joshblack added the skip changeset This change does not need a changelog label Aug 10, 2026
@joshblack
joshblack marked this pull request as ready for review August 10, 2026 20:10
@joshblack
joshblack requested a review from a team as a code owner August 10, 2026 20:10
@joshblack
joshblack requested review from francinelucca and a lite review from Copilot August 10, 2026 20:10
@joshblack joshblack added the integration-tests: skipped manually Changes in this PR do not require an integration test label Aug 10, 2026
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8278 August 10, 2026 20:17 Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds internal migration tooling to track component roots that should adopt mergeProps, by introducing a local ESLint rule/package and a scheduled GitHub Actions job that generates a migration-status report.

Changes:

  • Introduces a private @primer/eslint-config package that registers the primer/prefer-merge-props rule (disabled by default) plus unit tests.
  • Adds a script/merge-props-migration-status.mts report generator that runs ESLint over packages/react/src with the rule enabled and prints a Markdown summary.
  • Integrates the report into the scheduled “Migration Status” workflow and registers the local config in the root eslint.config.mjs.
Show a summary per file
File Description
script/merge-props-migration-status.mts Generates a Markdown report by running ESLint with primer/prefer-merge-props enabled and summarizing violations.
packages/eslint-config/vitest.config.ts Configures Vitest for the new ESLint-config workspace package.
packages/eslint-config/tsconfig.json TS config for the new workspace package (including rule/test sources).
packages/eslint-config/src/rules/preferMergeProps.ts Implements the prefer-merge-props ESLint rule logic.
packages/eslint-config/src/rules/preferMergeProps.test.ts Adds RuleTester-based coverage for intended rule boundaries and false-positive avoidance.
packages/eslint-config/src/index.ts Exports the flat config + plugin under the primer namespace and keeps the rule off by default.
packages/eslint-config/src/index.test.ts Verifies package exports and default disabled behavior.
packages/eslint-config/package.json Declares the new private workspace package, deps, and basic scripts.
package-lock.json Links the new workspace package into the lockfile.
eslint.config.mjs Registers the local Primer ESLint config in the root flat config array.
.github/workflows/migration-status.yml Adds a scheduled job to run the mergeProps migration-status script and publish to step summary.

Review details

Tip

Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 10/11 changed files
  • Comments generated: 4
  • Review effort level: Lite

Comment on lines +27 to +29
const affectedResults = results.filter(result => {
return result.messages.some(message => message.ruleId === ruleId)
})
Comment on lines +11 to +14
messages: {
preferMergeProps:
'Spread props on a component root element with mergeProps so component and consumer props are merged intentionally.',
},
Comment on lines +16 to +19
- name: install dependencies
run: npm ci
- name: run migration script
run: node script/merge-props-migration-status.mts >> $GITHUB_STEP_SUMMARY
Comment on lines +10 to +12
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
@joshblack
joshblack force-pushed the migrate/merge-props-eslint-tooling branch 2 times, most recently from 24e1307 to 7169487 Compare August 10, 2026 21:10
@github-actions
github-actions Bot requested a deployment to storybook-preview-8278 August 10, 2026 21:15 Abandoned
Copilot AI and others added 6 commits August 10, 2026 16:19
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Ignore pure prop-forwarding wrappers so the adoption report only tracks component roots with props that need intentional merging.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 00bfd295-6ed9-4119-8d63-103a0b3c63e8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm integration-tests: skipped manually Changes in this PR do not require an integration test skip changeset This change does not need a changelog staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants