Skip to content

vue/html-self-closing doesn't work when used with prettier #2232

Open
@yoshi-pi

Description

@yoshi-pi

What rule do you want to change?
vue/html-self-closing

Does this change cause the rule to produce more or fewer warnings?
No

How will the change be implemented? (New option, new default behavior, etc.)?
The change will be implemented by dividing the html.void option into two distinct rules.

Additional context
Currently the html.void option in vue/html-self-closing is causing conflicts with prettier, so vue/html-self-closing is turned off in eslint-config-prettier. Because of this, when ESLint and prettier are used together, vue/html-self-closing is not available by default even if plugin:vue/vue3-recommended is set.

<MyComp></MyComp> // not throw error with prettier

I think the solution is to create another new rule with only the html.void option and turn off that option in eslint-config-prettier configuration file. What do you think?

Update:
I have an additional question. Is it necessary to lint tags other than Vue components using eslint-vue-plugin?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions