Skip to content

Update dependency eslint-plugin-react-refresh to v0.5.0#16

Open
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/eslint-plugin-react-refresh-0.x
Open

Update dependency eslint-plugin-react-refresh to v0.5.0#16
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/eslint-plugin-react-refresh-0.x

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Apr 3, 2024

This PR contains the following updates:

Package Change Age Confidence
eslint-plugin-react-refresh 0.4.50.5.0 age confidence

Release Notes

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

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)
  • 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,
];

v0.4.20

Compare Source

  • Don't warn on nested HOC calls (fixes #​79)
  • Fix false positive with as const (fixes #​80)

v0.4.19

Compare Source

Add name to configs for ESLint Config Inspector

v0.4.18

Compare Source

ESM/CJS interop is the worse that happened to this ecosystem, this is all I have to say.

v0.4.17

Compare Source

  • Fix detection of local components to not generate warning on for variable inside JSX files that follow React component naming (fixes #​75)
  • Update types to not require extra unnecessary .default property access under TS node16 module resolution (fixes #​70)

v0.4.16

Compare Source

Fix CJS/ESM interop issue. Sorry everyone for the trouble.

v0.4.15

Compare Source

Add support for custom HOCs (#​60)

By default, the rule only knows that memo & forwardRef function calls with return a React component. With this option, you can also allow extra function names like Mobx observer to make this code valid:

const Foo = () => <></>;
export default observer(Foo);
{
  "react-refresh/only-export-components": [
    "error",
    { "customHOCs": ["observer"] }
  ]
}

Thanks @​HorusGoul!

Add recommended config and simple types (#​67)

You can now add the recommended config to your ESLint config like this:

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

export default [
  /* Main config */
  reactRefresh.configs.recommended, // Or reactRefresh.configs.vite for Vite users
];

To follow ESLint recommandations, the rule is added with the error severity.

Some simple types ensure that people typecheking their config won't need @ts-expect-error anymore.

Bump ESLint peer dependency to 8.40

This was actually done by mistake in the previous release when moving from a deprecated API to a new one.

Given that ESLint 8 is officialy end-of-life and the only report (#​56) didn't get likes, I'm going forward and documenting the expected minimum version from ESLin in the package JSON so that people can get warning from their package manager.

v0.4.14

Compare Source

v0.4.13

Compare Source

v0.4.12

Compare Source

  • Support type assertion on default export (fixes #​48)
  • Add default export to fix usage with jiti (fixes #​50)

v0.4.11

Compare Source

  • Ignore type exports (ex. export type foo = string;) (fixes #​47)

v0.4.10

Compare Source

  • Support function Foo() {}; export default React.memo(Foo) (#​46) (thanks @​SukkaW!)

v0.4.9

Compare Source

  • Support function Foo() {}; export default memo(Foo) (fixes #​44) (thanks @​SukkaW!)

v0.4.8

Compare Source

  • Support export const foo = -1 with allowConstantExport (fixes #​43)

v0.4.7

Compare Source

  • Support export { Component as default } (fixes #​41)

v0.4.6

Compare Source

  • Ignore cypress test files (#​39)

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 was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from c3b76cf to 934864c Compare May 9, 2024 23:46
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.6 Update dependency eslint-plugin-react-refresh to v0.4.7 May 9, 2024
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from 934864c to dfd1264 Compare July 12, 2024 02:53
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.7 Update dependency eslint-plugin-react-refresh to v0.4.8 Jul 12, 2024
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.8 Update dependency eslint-plugin-react-refresh to v0.4.9 Jul 24, 2024
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from dfd1264 to 6509b4f Compare July 24, 2024 05:36
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.9 Update dependency eslint-plugin-react-refresh to v0.4.10 Aug 21, 2024
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from 6509b4f to 17bbaaa Compare August 21, 2024 02:58
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.10 Update dependency eslint-plugin-react-refresh to v0.4.11 Aug 23, 2024
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from 17bbaaa to 9112fd1 Compare August 23, 2024 05:36
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.11 Update dependency eslint-plugin-react-refresh to v0.4.12 Sep 15, 2024
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from 9112fd1 to 45b1d51 Compare September 15, 2024 02:34
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from 45b1d51 to a0edf0f Compare October 20, 2024 05:47
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.12 Update dependency eslint-plugin-react-refresh to v0.4.13 Oct 20, 2024
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.13 Update dependency eslint-plugin-react-refresh to v0.4.14 Oct 25, 2024
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from a0edf0f to 7737507 Compare October 25, 2024 14:44
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from 7737507 to 5dff8fb Compare December 2, 2024 23:43
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.14 Update dependency eslint-plugin-react-refresh to v0.4.16 Dec 2, 2024
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from 5dff8fb to 30142c0 Compare January 12, 2025 11:52
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.16 Update dependency eslint-plugin-react-refresh to v0.4.18 Jan 12, 2025
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.18 Update dependency eslint-plugin-react-refresh to v0.4.19 Feb 9, 2025
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from 30142c0 to ecd852a Compare February 9, 2025 07:06
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.19 Update dependency eslint-plugin-react-refresh to v0.4.20 Apr 24, 2025
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from ecd852a to cf082eb Compare April 24, 2025 04:21
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.20 Update dependency eslint-plugin-react-refresh to v0.4.21 Sep 23, 2025
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from cf082eb to f0d218d Compare September 23, 2025 12:04
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.21 Update dependency eslint-plugin-react-refresh to v0.4.22 Sep 26, 2025
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from f0d218d to 9db8de5 Compare September 26, 2025 11:43
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.22 Update dependency eslint-plugin-react-refresh to v0.4.23 Oct 2, 2025
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from 9db8de5 to 91c74d2 Compare October 2, 2025 07:29
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from 91c74d2 to 1a4a180 Compare October 16, 2025 08:02
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.23 Update dependency eslint-plugin-react-refresh to v0.4.24 Oct 16, 2025
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.24 Update dependency eslint-plugin-react-refresh to v0.4.25 Dec 15, 2025
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from 1a4a180 to 2533817 Compare December 15, 2025 19:52
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.25 Update dependency eslint-plugin-react-refresh to v0.4.26 Dec 18, 2025
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from 2533817 to aa5452f Compare December 18, 2025 08:06
@renovate renovate bot force-pushed the renovate/eslint-plugin-react-refresh-0.x branch from aa5452f to 425dc2d Compare February 2, 2026 03:10
@renovate renovate bot changed the title Update dependency eslint-plugin-react-refresh to v0.4.26 Update dependency eslint-plugin-react-refresh to v0.5.0 Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants