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

Configs to set .vue extension via overrides #2036

Open
privatenumber opened this issue Nov 14, 2022 · 1 comment
Open

Configs to set .vue extension via overrides #2036

privatenumber opened this issue Nov 14, 2022 · 1 comment

Comments

@privatenumber
Copy link
Contributor

The problem you want to solve.
Currently, the docs recommend passing the .vue extension in via CLI: https://eslint.vuejs.org/user-guide/#usage

This is cumbersome to declare for each config because Vue SFCs are always in .vue files.

Your take on the correct solution to problem.
When an extension/pattern is set via overrides, the extension no longer needs to be manually passed into ESLint via the --ext flag.

I would like to recommend that configs use overrides so ESLint can automatically detect .vue files without the user needing to pass it in:

{
	"overrides": [
		{
			"files": "*.vue",
			// ...
		}
	]
}

Other info

  • Applying the plugin rules specifically to .vue extensions should make it easier to handle conflicts like this:
    This rule only checks `.vue` files and does not interfere with other `.js` files. Unfortunately the default `indent` rule when turned on will try to lint both, so in order to make them complementary you can use `overrides` setting and disable `indent` rule on `.vue` files:
@ota-meshi
Copy link
Member

Thank you for posting the issue,
I think maybe we can move only the parser config to *.vue since the rules may also check *.js files.

Since it's a breaking change, it should be done in a major version, but I don't know yet if it will be in the next major version.
Since the ESLint team is planning a new flat config, we may provide a completely different shareable config.
https://eslint.org/blog/2022/08/new-config-system-part-1/

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

No branches or pull requests

2 participants