JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6141148
  • Score
    100M100P100Q204355F
  • License MIT

Validate that your components can safely be updated with fast refresh

Package Exports

  • eslint-plugin-react-refresh
  • eslint-plugin-react-refresh/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-react-refresh) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

eslint-plugin-react-refresh

Validate that your components can safely be updated with fast refresh.

⚠️ To avoid false positive, this plugin is only applied on tsx & jsx files.

Installation

npm i -D eslint-plugin-react-refresh

Usage

{
  "plugins": ["react-refresh"],
  "rules": {
    "react-refresh/only-export-components": "warn"
  }
}

Fail

export const foo = () => {};
export const Bar = () => <></>;
export const CONSTANT = 3;
export const Foo = () => <></>;
export default function () {}
export * from "./foo";

Pass

export default function Foo() {
  return <></>;
}
const foo = () => {};
export const Bar = () => <></>;