Update dependency eslint-plugin-react-refresh to v0.5.2 (#28175)
This PR contains the following updates:
| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
|
[eslint-plugin-react-refresh](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh)
| [`0.4.24` →
`0.5.2`](https://renovatebot.com/diffs/npm/eslint-plugin-react-refresh/0.4.24/0.5.2)
|

|

|
---
### Release Notes
<details>
<summary>ArnaudBarre/eslint-plugin-react-refresh
(eslint-plugin-react-refresh)</summary>
###
[`v0.5.2`](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/HEAD/CHANGELOG.md#052)
[Compare
Source](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/compare/v0.5.1...v0.5.2)
- Support nested function calls for extraHOCs (actually fixes
[#​104](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/104))
###
[`v0.5.1`](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/HEAD/CHANGELOG.md#051)
[Compare
Source](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/compare/v0.5.0...v0.5.1)
- Mark ESLint v10 as supported
- Support false positives with TypeScript function overloading (fixes
[#​105](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/105))
- Support nested function calls for extraHOCs (fixes
[#​104](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/104))
###
[`v0.5.0`](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/HEAD/CHANGELOG.md#050)
[Compare
Source](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/compare/v0.4.26...v0.5.0)
##### Breaking changes
- The package now ships as ESM and requires ESLint 9 + node 20. Because
legacy config doesn't support ESM, this requires to use [flat
config](https://eslint.org/docs/latest/use/configure/migration-guide)
- A new `reactRefresh` export is available and prefered over the default
export. It's an object with two properties:
- `plugin`: The plugin object with the rules
- `configs`: An object containing configuration presets, each exposed as
a function. These functions accept your custom options, merge them with
sensible defaults for that config, and return the final config object.
- `customHOCs` option was renamed to `extraHOCs`
- Validation of HOCs calls is now more strict, you may need to add some
HOCs to the `extraHOCs` option
Config example:
```js
import { defineConfig } from "eslint/config";
import { reactRefresh } from "eslint-plugin-react-refresh";
export default defineConfig(
/* Main config */
reactRefresh.configs.vite({ extraHOCs: ["someLibHOC"] }),
);
```
Config example without config:
```js
import { defineConfig } from "eslint/config";
import { reactRefresh } from "eslint-plugin-react-refresh";
export default defineConfig({
files: ["**/*.ts", "**/*.tsx"],
plugins: {
// other plugins
"react-refresh": reactRefresh.plugin,
},
rules: {
// other rules
"react-refresh/only-export-components": [
"warn",
{ extraHOCs: ["someLibHOC"] },
],
},
});
```
##### Why
This version follows a revamp of the internal logic to better make the
difference between random call expressions like `export const Enum =
Object.keys(Record)` and actual React HOC calls like `export const
MemoComponent = memo(Component)`. (fixes
[#​93](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/93))
The rule now handles ternaries and patterns like `export default
customHOC(props)(Component)` which makes it able to correctly support
files like [this
one](https://redirect.github.com/eclipse-apoapsis/ort-server/blob/ddfc624ce71b9f2ca6bad9b8c82d4c3249dd9c8b/ui/src/routes/__root.tsx)
given this config:
```json
{
"react-refresh/only-export-components": [
"warn",
{ "extraHOCs": ["createRootRouteWithContext"] }
]
}
```
> \[!NOTE]
> Actually createRoute functions from TanStack Router are not React
HOCs, they return route objects that [fake to be a memoized
component](https://redirect.github.com/TanStack/router/blob/8628d0189412ccb8d3a01840aa18bac8295e18c8/packages/react-router/src/route.tsx#L263)
but are not. When only doing `createRootRoute({ component: Foo })`, HMR
will work fine, but as soon as you add a prop to the options that is not
a React component, HMR will not work. I would recommend to avoid adding
any TanStack function to `extraHOCs` it you want to preserve good HMR in
the long term. [Bluesky
thread](https://bsky.app/profile/arnaud-barre.bsky.social/post/3ma5h5tf2sk2e).
Because I'm not 100% sure this new logic doesn't introduce any false
positive, this is done in a major-like version. This also give me the
occasion to remove the hardcoded `connect` from the rule. If you are
using `connect` from `react-redux`, you should now add it to `extraHOCs`
like this:
```json
{
"react-refresh/only-export-components": ["warn", { "extraHOCs": ["connect"] }]
}
```
###
[`v0.4.26`](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/HEAD/CHANGELOG.md#0426)
[Compare
Source](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/compare/v0.4.25...v0.4.26)
- Revert changes to fix
[#​93](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/93)
(fixes
[#​95](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/95))
###
[`v0.4.25`](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/HEAD/CHANGELOG.md#0425)
[Compare
Source](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/compare/v0.4.24...v0.4.25)
- Report cases like `export const ENUM = Object.keys(TABLE) as
EnumType[];` (fixes
[#​93](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/93))
(reverted in 0.4.26)
- Allow `_` in component names
([#​94](https://redirect.github.com/ArnaudBarre/eslint-plugin-react-refresh/pull/94))
</details>
---
### Configuration
📅 **Schedule**: (in timezone Etc/UTC)
- Branch creation
- Only on Sunday and Saturday (`* * * * 0,6`)
- Between 11:00 PM and 11:59 PM, Monday through Friday (`* 23 * * 1-5`)
- Between 12:00 AM and 04:59 AM, Monday through Saturday (`* 0-4 * *
1-6`)
- Automerge
- Only on Sunday and Saturday (`* * * * 0,6`)
- Between 11:00 PM and 11:59 PM, Monday through Friday (`* 23 * * 1-5`)
- Between 12:00 AM and 04:59 AM, Monday through Saturday (`* 0-4 * *
1-6`)
🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.
♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://redirect.github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xOTUuMTMiLCJ1cGRhdGVkSW5WZXIiOiI0My4yMDUuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
Co-authored-by: tryghost-renovate[bot] <269725441+tryghost-renovate[bot]@users.noreply.github.com> T
tryghost-renovate[bot] committed
1da1851cd917fc2f104a41910a5b31fbcf57fbaa
Parent: 0d61ce1
Committed by GitHub <noreply@github.com>
on 6/1/2026, 12:26:05 AM