Enforce React Refresh component-only exports#7944
Conversation
|
|
50bd636 to
b52077c
Compare
9cd72d8 to
d775544
Compare
There was a problem hiding this comment.
Pull request overview
This PR tightens the repo’s linting baseline by enabling react-refresh/only-export-components as an error in the root flat ESLint config, enforcing React Fast Refresh–compatible “component-only” exports across JSX/TSX sources.
Changes:
- Added
eslint-plugin-react-refreshto the ESLint flat config and enabledreact-refresh/only-export-componentsaterrorseverity for**/*.{jsx,tsx}. - Tuned rule options to match repo patterns (allow constant exports, allow
metadata, recognize additional HOC-style wrappers viaextraHOCs). - Exempted
packages/styled-react/src/index.tsxfrom this rule via a targeted ignore.
Show a summary per file
| File | Description |
|---|---|
| eslint.config.mjs | Adds and configures react-refresh/only-export-components for JSX/TSX files, with repo-specific allowances and a scoped ignore. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
b52077c to
5acea17
Compare
d775544 to
4137503
Compare
|
Integration test results from github/github-ui PR:
All checks passed! |
e3309b4 to
e1a9f34
Compare
e16b5d4 to
da96ace
Compare
e1a9f34 to
8f57704
Compare
da96ace to
76e557e
Compare
8f57704 to
eaf51b5
Compare
76e557e to
bd67d8c
Compare
bd67d8c to
06623dc
Compare
Closes #
No linked issue.
Enables
react-refresh/only-export-componentsas an error after the preceding stack layers move non-component exports out of component files.Changelog
New
react-refresh/only-export-componentsto the flat ESLint config.Changed
Object.assigncomponents, andfixedForwardRef.Removed
Rollout strategy
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