ArnaudBarre / eslint-plugin-react-refresh

Validate that your components can safely be updated with fast refresh
MIT License
198 stars 9 forks source link

[BUG] Not working as intended #3

Closed AndreaPontrandolfo closed 1 year ago

AndreaPontrandolfo commented 1 year ago

README suggests to do this:

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

But the plugin is doing the wrong exports, infact i only got it working by doing:

{
  "plugins": ["only-export-components"],
  "rules": {
    "only-export-components/only-export-components": "warn"
  }
}
ArnaudBarre commented 1 year ago

The plugin name is based on the npm package. I think something is wrong in your setup. Do you have a small reproduction?

AndreaPontrandolfo commented 1 year ago

Sure, this is my usecase: https://github.com/AndreaPontrandolfo/sheriff/blob/master/configs/eslint.config.js#L536 I'm on the EslintFlatConfig.

ArnaudBarre commented 1 year ago

Seems like you are using a namespace: https://eslint.org/blog/2022/08/new-config-system-part-2/#personalized-plugin-namespaces

The documentation is for the current configuration setup and I think it's fine for now because the flat config is still marked as experimental: https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new

Closing as work as intended