Skip to content

Configs to set .vue extension via overrides #2036

Closed
@privatenumber

Description

@privatenumber

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:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions