{"repo":"ArnaudBarre/eslint-plugin-react-refresh","free":true,"listed":false,"github":"https://github.com/ArnaudBarre/eslint-plugin-react-refresh","clone":"git clone https://github.com/ArnaudBarre/eslint-plugin-react-refresh.git","description":"Validate that your components can safely be updated with Fast Refresh","language":"TypeScript","stars":337,"topics":["eslint","react","fast-refresh"],"license":"MIT","category":"ui-components","readme_excerpt":"eslint-plugin-react-refresh Validate that your components can safely be updated with Fast Refresh. Explainer \"Fast Refresh\", also known as \"hot reloading\", is a feature in many modern bundlers. If you update some React component(s) on disk, then the bundler will know to update only the impacted parts of your page -- without a full page reload. eslint-plugin-react-refresh enforces that your components are structured in a way that integrations such as react-refresh expect. Limitations ⚠️ To avoid false positives, by default this plugin is only applied on tsx & jsx files. See Options to run on JS files. ⚠️ The plugin relies on naming conventions (i.e. use PascalCase for components, camelCase for util functions). This is why there are some limitations: - export are not supported and will be reported as an error - Anonymous function are not supported (i.e export default function() {} ) - Class components are not supported - All-uppercase function export is considered an error when not using direct named export (ex const CMS = () = < ; export { CMS } ) Installation Usage This plugin provides a single rule, react-refresh/only-export-components . There are multiple ways to enable it. Recommended config Vite config This enables the allowConstantExport option which is supported by Vite React plugins. Next config This allows exports like fetchCache and revalidate which are used in Page or Layout components and don't trigger a full page reload. Without config Examples These examples are ","default_branch":null,"files":null,"tree":[],"storefront":"/r/ArnaudBarre","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ArnaudBarre/eslint-plugin-react-refresh/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}