Skip to content

Releases: ArnaudBarre/eslint-plugin-react-refresh

v0.4.16

02 Dec 11:39
Compare
Choose a tag to compare

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

v0.4.15

02 Dec 09:38
Compare
Choose a tag to compare

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

24 Oct 18:14
Compare
Choose a tag to compare
  • Warn if a context is exported alongside a component (fixes #53). Thanks @IgorAufricht!

v0.4.13

19 Oct 22:59
Compare
Choose a tag to compare
  • Support for react-redux connect (export default connect(mapStateToProps, mapDispatchToProps)(MyComponent)) (fixes #51)
  • Support for Arbitrary Module Identifiers syntax (fixes #52)

v0.4.12

14 Sep 10:08
Compare
Choose a tag to compare
  • Support type assertion on default export (fixes #48)
  • Add default export to fix usage with jiti (fixes #50)

v0.4.11

22 Aug 10:18
Compare
Choose a tag to compare
  • Ignore type exports (ex. export type foo = string;) (fixes #47)

v0.4.10

20 Aug 18:51
7101b09
Compare
Choose a tag to compare
  • Support function Foo() {}; export default React.memo(Foo) (#46) (thanks @SukkaW!)

v0.4.9

21 Jul 15:10
897a11d
Compare
Choose a tag to compare
  • Support function Foo() {}; export default memo(Foo) (fixes #44) (thanks @SukkaW!)

v0.4.8

09 Jul 23:33
Compare
Choose a tag to compare
  • Support export const foo = -1 with allowConstantExport (fixes #43)

v0.4.7

09 May 11:15
Compare
Choose a tag to compare
  • Support export { Component as default } (fixes #41)