Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Provide a 'recommended' config for flat configs? #64

Closed
JoshuaKGoldberg opened this issue Nov 24, 2024 · 0 comments · Fixed by #67
Closed

Feature: Provide a 'recommended' config for flat configs? #64

JoshuaKGoldberg opened this issue Nov 24, 2024 · 0 comments · Fixed by #67

Comments

@JoshuaKGoldberg
Copy link
Contributor

Right now, if you want to use this plugin in flat config, you have to manually specify one entry in each of plugins and rules:

import reactRefresh from "eslint-plugin-react-refresh";

export default [
  {
    plugins: {
      "react-refresh": reactRefresh,
    },
    rules: {
      "react-refresh/only-export-components": "error",
    },
  },
];

It'd be nice to have a single entry we can reference. Per eslint/eslint#18095, how about:

import reactRefresh from "eslint-plugin-react-refresh";

export default [
  reactRefresh.configs.recommended,
];

...where reactRefresh.configs.recommended is the same object from before?

One side benefit is that it would make it less likely for folks to change the plugin name. In tseslint we've seen folks rename from @typescript-eslint/ to ts/ - sometimes intentionally, sometimes not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant