v0.4.15
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.