eslint-plugin-react-refresh
Advanced tools
Changelog
0.4.16
Fix CJS/ESM interop issue. Sorry everyone for the trouble.
Changelog
0.4.15
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!
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.
Changelog
0.4.14
Changelog
0.4.13
react-redux
connect (export default connect(mapStateToProps, mapDispatchToProps)(MyComponent)
) (fixes #51)Changelog
0.4.12
Changelog
0.4.11
export type foo = string;
) (fixes #47)Changelog
0.4.10
function Foo() {}; export default React.memo(Foo)
(#46) (thanks @SukkaW!)Changelog
0.4.9
function Foo() {}; export default memo(Foo)
(fixes #44) (thanks @SukkaW!)Changelog
0.4.8
export const foo = -1
with allowConstantExport
(fixes #43)Changelog
0.4.7
export { Component as default }
(fixes #41)