prettier / eslint-config-prettier

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

Remove "vue/html-end-tags": "off" #192

Closed adispring closed 3 years ago

adispring commented 3 years ago

If not open "vue/html-end-tags", the following error will not be checked out, which lead to an our online accident.

<div>
  <div>
    <span>haha</span>
  <!-- </div> -->
  <div>
    hehe
  </div>
</div>
lydell commented 3 years ago

Hi!

I copied the example from https://eslint.vuejs.org/rules/html-end-tags.html into Prettier’s playground:

Prettier 2.3.0 Playground link

--parser vue

Input:

<template>
  <!-- ✓ GOOD -->
  <div></div>
  <p></p>
  <p></p>
  <input>
  <br>

  <!-- ✗ BAD -->
  <div>
  <p>
</template>

Output:

SyntaxError: Unexpected closing tag "template". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (12:1)
  10 |   <div>
  11 |   <p>
> 12 | </template>
     | ^^^^^^^^^^^

Prettier gives a syntax error because of the missing end tags, so vue/html-end-tags does seem unnecessary to me when using Prettier.

Can you provide more detail?

adispring commented 3 years ago

Yes, prettier@2.3.0 will report error, and our prettier version is 2.2.1. I'll close this pr.