Skip to content

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

Merged
9larsons merged 1 commit into
mainfrom
renovate/eslint-plugin-react-refresh-0.x
Jun 1, 2026
Merged

Update dependency eslint-plugin-react-refresh to v0.5.2#28175
9larsons merged 1 commit into
mainfrom
renovate/eslint-plugin-react-refresh-0.x

Conversation

@tryghost-renovate
Copy link
Copy Markdown
Contributor

@tryghost-renovate tryghost-renovate Bot commented May 26, 2026

This PR contains the following updates:

Package Change Age Confidence
eslint-plugin-react-refresh 0.4.240.5.2 age 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)

Configuration

📅 Schedule: (in timezone Etc/UTC)

  • 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: Never, 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 Mend Renovate.

@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label May 27, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.63%. Comparing base (0d61ce1) to head (d7abfe3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #28175      +/-   ##
==========================================
- Coverage   73.63%   73.63%   -0.01%     
==========================================
  Files        1536     1536              
  Lines      130817   130817              
  Branches    15657    15653       -4     
==========================================
- Hits        96330    96324       -6     
+ Misses      33522    33504      -18     
- Partials      965      989      +24     
Flag Coverage Δ
admin-tests 54.18% <ø> (ø)
e2e-tests 73.63% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tryghost-renovate tryghost-renovate Bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch 12 times, most recently from 5a23fb3 to d0b3943 Compare May 28, 2026 06:02
@9larsons 9larsons force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from d0b3943 to b972f24 Compare May 31, 2026 21:19
@9larsons 9larsons enabled auto-merge (squash) May 31, 2026 23:37
@9larsons 9larsons force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from b972f24 to d7abfe3 Compare May 31, 2026 23:59
@9larsons 9larsons merged commit 1da1851 into main Jun 1, 2026
54 checks passed
@9larsons 9larsons deleted the renovate/eslint-plugin-react-refresh-0.x branch June 1, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant