Update dependency eslint-plugin-react-refresh to v0.5.2 #27

Open
renovate-bot wants to merge 1 commit from renovate/eslint-plugin-react-refresh-0.x into main
Collaborator

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
eslint-plugin-react-refresh 0.4.200.5.2 age adoption passing confidence

Release Notes

ArnaudBarre/eslint-plugin-react-refresh (eslint-plugin-react-refresh)

v0.5.2

Compare Source

  • Support nested function calls for extraHOCs (actually fixes #​104)

v0.5.1

Compare Source

  • Mark ESLint v10 as supported
  • Support false positives with TypeScript function overloading (fixes #​105)
  • Support nested function calls for extraHOCs (fixes #​104)

v0.5.0

Compare Source

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
  • 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:

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:

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)

The rule now handles ternaries and patterns like export default customHOC(props)(Component) which makes it able to correctly support files like this one given this config:

{
  "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 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.

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:

{
  "react-refresh/only-export-components": ["warn", { "extraHOCs": ["connect"] }]
}

v0.4.26

Compare Source

v0.4.25

Compare Source

  • Report cases like export const ENUM = Object.keys(TABLE) as EnumType[]; (fixes #​93) (reverted in 0.4.26)
  • Allow _ in component names (#​94)

v0.4.24

Compare Source

  • Add "generateImageMetadata", "generateSitemaps" & "generateStaticParams" to allowExportNames in Next config

v0.4.23

Compare Source

  • Add "metadata", "generateMetadata" & "generateViewport" to allowExportNames in Next config

v0.4.22

Compare Source

  • Add "viewport" to allowExportNames in Next config (#​89)

v0.4.21

Compare Source

  • Add Next config (fixes #​85)

This allows exports like fetchCache and revalidate which are used in Page or Layout components and don't trigger a full page reload.

import reactRefresh from "eslint-plugin-react-refresh";

export default [
  /* Main config */
  reactRefresh.configs.next,
];

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Adoption](https://docs.renovatebot.com/merge-confidence/) | [Passing](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---|---|---| | [eslint-plugin-react-refresh](https://github.com/ArnaudBarre/eslint-plugin-react-refresh) | [`0.4.20` → `0.5.2`](https://renovatebot.com/diffs/npm/eslint-plugin-react-refresh/0.4.20/0.5.2) | ![age](https://developer.mend.io/api/mc/badges/age/npm/eslint-plugin-react-refresh/0.5.2?slim=true) | ![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/eslint-plugin-react-refresh/0.5.2?slim=true) | ![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/eslint-plugin-react-refresh/0.4.20/0.5.2?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/eslint-plugin-react-refresh/0.4.20/0.5.2?slim=true) | --- ### Release Notes <details> <summary>ArnaudBarre/eslint-plugin-react-refresh (eslint-plugin-react-refresh)</summary> ### [`v0.5.2`](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/HEAD/CHANGELOG.md#052) [Compare Source](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/compare/v0.5.1...v0.5.2) - Support nested function calls for extraHOCs (actually fixes [#&#8203;104](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/104)) ### [`v0.5.1`](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/HEAD/CHANGELOG.md#051) [Compare Source](https://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 [#&#8203;105](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/105)) - Support nested function calls for extraHOCs (fixes [#&#8203;104](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/104)) ### [`v0.5.0`](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/HEAD/CHANGELOG.md#050) [Compare Source](https://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 [#&#8203;93](https://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://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://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://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/HEAD/CHANGELOG.md#0426) [Compare Source](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/compare/v0.4.25...v0.4.26) - Revert changes to fix [#&#8203;93](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/93) (fixes [#&#8203;95](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/95)) ### [`v0.4.25`](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/HEAD/CHANGELOG.md#0425) [Compare Source](https://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 [#&#8203;93](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/93)) (reverted in 0.4.26) - Allow `_` in component names ([#&#8203;94](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/pull/94)) ### [`v0.4.24`](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/HEAD/CHANGELOG.md#0424) [Compare Source](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/compare/v0.4.23...v0.4.24) - Add `"generateImageMetadata"`, `"generateSitemaps"` & `"generateStaticParams"` to `allowExportNames` in Next config ### [`v0.4.23`](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/HEAD/CHANGELOG.md#0423) [Compare Source](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/compare/v0.4.22...v0.4.23) - Add `"metadata"`, `"generateMetadata"` & `"generateViewport"` to `allowExportNames` in Next config ### [`v0.4.22`](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/HEAD/CHANGELOG.md#0422) [Compare Source](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/compare/v0.4.21...v0.4.22) - Add `"viewport"` to `allowExportNames` in Next config ([#&#8203;89](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/pull/89)) ### [`v0.4.21`](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/HEAD/CHANGELOG.md#0421) [Compare Source](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/compare/v0.4.20...v0.4.21) - Add Next config (fixes [#&#8203;85](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/issues/85)) This allows exports like `fetchCache` and `revalidate` which are used in Page or Layout components and don't trigger a full page reload. ```js import reactRefresh from "eslint-plugin-react-refresh"; export default [ /* Main config */ reactRefresh.configs.next, ]; ``` </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, 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 [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS44Mi4zIiwidXBkYXRlZEluVmVyIjoiNDMuMzEuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZnJvbnRlbmQiLCJyZW5vdmF0ZSJdfQ==-->
renovate-bot force-pushed renovate/eslint-plugin-react-refresh-0.x from 000883270f to d9f9fd591b 2025-09-26 06:02:53 +01:00 Compare
renovate-bot changed title from Update dependency eslint-plugin-react-refresh to v0.4.21 to Update dependency eslint-plugin-react-refresh to v0.4.22 2025-09-26 06:02:53 +01:00
renovate-bot force-pushed renovate/eslint-plugin-react-refresh-0.x from d9f9fd591b to 90b5ae961e 2025-10-02 06:02:58 +01:00 Compare
renovate-bot changed title from Update dependency eslint-plugin-react-refresh to v0.4.22 to Update dependency eslint-plugin-react-refresh to v0.4.23 2025-10-02 06:02:58 +01:00
renovate-bot changed title from Update dependency eslint-plugin-react-refresh to v0.4.23 to Update dependency eslint-plugin-react-refresh to v0.4.24 2025-10-16 06:02:56 +01:00
renovate-bot force-pushed renovate/eslint-plugin-react-refresh-0.x from 90b5ae961e to 7d7a7d9760 2025-10-16 06:02:56 +01:00 Compare
renovate-bot changed title from Update dependency eslint-plugin-react-refresh to v0.4.24 to Update dependency eslint-plugin-react-refresh to v0.4.25 2025-12-15 05:03:14 +00:00
renovate-bot force-pushed renovate/eslint-plugin-react-refresh-0.x from 7d7a7d9760 to 6cccf15411 2025-12-15 05:03:14 +00:00 Compare
renovate-bot changed title from Update dependency eslint-plugin-react-refresh to v0.4.25 to Update dependency eslint-plugin-react-refresh to v0.4.26 2025-12-17 05:03:32 +00:00
renovate-bot force-pushed renovate/eslint-plugin-react-refresh-0.x from 6cccf15411 to 909c7e986d 2025-12-17 05:03:32 +00:00 Compare
renovate-bot changed title from Update dependency eslint-plugin-react-refresh to v0.4.26 to Update dependency eslint-plugin-react-refresh to v0.5.0 2026-02-02 05:03:33 +00:00
renovate-bot force-pushed renovate/eslint-plugin-react-refresh-0.x from 909c7e986d to 423b837345 2026-02-02 05:03:33 +00:00 Compare
renovate-bot changed title from Update dependency eslint-plugin-react-refresh to v0.5.0 to Update dependency eslint-plugin-react-refresh to v0.5.2 2026-02-24 05:01:51 +00:00
renovate-bot force-pushed renovate/eslint-plugin-react-refresh-0.x from 423b837345 to 499c9801ba 2026-02-24 05:01:51 +00:00 Compare
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/eslint-plugin-react-refresh-0.x:renovate/eslint-plugin-react-refresh-0.x
git switch renovate/eslint-plugin-react-refresh-0.x

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff renovate/eslint-plugin-react-refresh-0.x
git switch renovate/eslint-plugin-react-refresh-0.x
git rebase main
git switch main
git merge --ff-only renovate/eslint-plugin-react-refresh-0.x
git switch renovate/eslint-plugin-react-refresh-0.x
git rebase main
git switch main
git merge --no-ff renovate/eslint-plugin-react-refresh-0.x
git switch main
git merge --squash renovate/eslint-plugin-react-refresh-0.x
git switch main
git merge --ff-only renovate/eslint-plugin-react-refresh-0.x
git switch main
git merge renovate/eslint-plugin-react-refresh-0.x
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MobiusReactor/TicTacToeV2!27
No description provided.