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

Configuration with @stylistic/eslint-plugin #268

Closed
pnodet opened this issue Nov 3, 2023 · 4 comments
Closed

Configuration with @stylistic/eslint-plugin #268

pnodet opened this issue Nov 3, 2023 · 4 comments

Comments

@pnodet
Copy link

pnodet commented Nov 3, 2023

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
Copy link
Member

lydell commented Nov 3, 2023

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
Copy link
Author

pnodet commented Nov 3, 2023

Okay great!

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

@darekkay
Copy link

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
Copy link
Member

lydell commented Dec 21, 2023

See #272

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

3 participants