Skip to content

Enforce React Refresh component-only exports#7944

Open
joshblack wants to merge 3 commits into
joshblack/eslint-react-refresh/fix-styled-hooksfrom
joshblack/eslint-react-refresh/enforce-rule
Open

Enforce React Refresh component-only exports#7944
joshblack wants to merge 3 commits into
joshblack/eslint-react-refresh/fix-styled-hooksfrom
joshblack/eslint-react-refresh/enforce-rule

Conversation

@joshblack

@joshblack joshblack commented Jun 8, 2026

Copy link
Copy Markdown
Member

Closes #

No linked issue.

Enables react-refresh/only-export-components as an error after the preceding stack layers move non-component exports out of component files.

Changelog

New

  • Added react-refresh/only-export-components to the flat ESLint config.

Changed

  • Configured the rule for this codebase's patterns, including constant exports, Next metadata, compound Object.assign components, and fixedForwardRef.
  • Skips the styled-react TSX entrypoint barrel because the package build expects that filename and it only re-exports deprecated APIs.

Removed

  • Nothing.

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; lint enforcement only, no consumer-facing runtime change.

Testing & Reviewing

Validated the configured rule reported zero remaining React Refresh violations before enabling it. Full validation passed for format, lint, CSS lint, type-check, and build; full browser test runs hit transient timeouts, and the affected files passed on targeted rerun.

Merge checklist

@changeset-bot

changeset-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9cd72d8

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 the staff Author is a staff member label Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

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.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 8, 2026
@joshblack joshblack changed the title joshblack/eslint react refresh/enforce rule Enforce React Refresh component-only exports Jun 8, 2026
@joshblack joshblack added skip changeset This change does not need a changelog integration-tests: skipped manually Changes in this PR do not require an integration test labels Jun 8, 2026
@joshblack joshblack marked this pull request as ready for review June 8, 2026 17:37
@joshblack joshblack requested a review from a team as a code owner June 8, 2026 17:37
@joshblack joshblack requested review from Copilot and francinelucca and removed request for Copilot June 8, 2026 17:37
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.

1 participant