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

Open
JoshuaKGoldberg opened this issue Nov 24, 2024 · 0 comments
Open

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

JoshuaKGoldberg opened this issue Nov 24, 2024 · 0 comments

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

No branches or pull requests

1 participant