prettier / eslint-config-prettier

Turns off all rules that are unnecessary or might conflict with Prettier.
MIT License
5.43k stars 255 forks source link

Configuration with @stylistic/eslint-plugin #268

Closed pnodet closed 11 months ago

pnodet commented 11 months ago

Per this blog post some style rules are moving from the eslint basic rules to this plugin @stylistic/eslint-plugin

I wonder how this affect the eslint config, since the prettier rules conflicting won't disable rules prefixed from the plugin, especially with the new flat config the prefix can be set arbitrarily.

Example using the plugin in the new flat config and setting the plugin prefix to style:

    {
        plugins: {
            style: pluginStylistic,
        },
    },
    {
        files: ["*.js"],
        rules: {
            'style/array-bracket-spacing': ['error', 'never'],
        },
    }
lydell commented 11 months ago

with the new flat config the prefix can be set arbitrarily

I talked to the creators of ESLint about this, and they said I shouldn’t worry about it. Plugins should recommend a prefix and people should use it. They said it was enough with the disclaimer we have: https://github.com/prettier/eslint-config-prettier#eslintconfigjs-flat-config-plugin-caveat


It might be that eslint-config-prettier does not need to support @stylistic/eslint-plugin. It feels like people who use Prettier won’t use that plugin, and people who don’t use Prettier might use it.

But if some popular config pulls in that plugin but you prefer Prettier, then I can see it being useful supporting it.

Either way – supporting it should be pretty easy I think. Basically copy-paste the core rules and add the prefix.

pnodet commented 11 months ago

Okay great!

Yeah that's what I did (adding the rules with style/ prefix)

darekkay commented 9 months ago

It feels like people who use Prettier won’t use that plugin, and people who don’t use Prettier might use it.

While migrating my ESLint rules, I have found a single exception to this statement: prettier doesn't cover spaced-comments and suggests to use the ESLint rule instead.

lydell commented 9 months ago

See https://github.com/prettier/eslint-config-prettier/pull/272