prettier / eslint-config-prettier

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

conflict with vue/html-self-closing #85

Closed aldarund closed 5 years ago

aldarund commented 5 years ago
  extends: [
    '@nuxtjs',
    'plugin:nuxt/recommended',
    'plugin:prettier/recommended',
    'prettier',
    'prettier/vue',
  ],
  plugins: [
    'prettier'
  ],

It will lead to problem with for example img tags

Thats how prettier wants it <img src="~assets/img/lemken_icon.png" alt="L" /> Thats how vue eslint wants it `

L

`

eslint-config-prettier-check also dont report this rule as a problem

related prettier issue https://github.com/prettier/prettier/issues/5246

lydell commented 5 years ago

Hi!

vue/html-self-closing is already disabled:

https://github.com/prettier/eslint-config-prettier/blob/a2fceb9024838ea27c0c1b1184e7ff69ee76974f/vue.js#L5

Could you make a reproduction repo, where I can run npm it to reproduce?

aldarund commented 5 years ago

Hmmm, i cant reproduce it now... My only guess that there was some weird caching issue.. Closing for now

cmygray commented 5 years ago

I have the same issue. Every <br> tag is fixed to self-closing tag.

https://gist.github.com/cmygray/f968f44c28832c1513679c688bd2fef0

lydell commented 5 years ago

@cmygray Prettier formats all void elements with a slash (<br />), yes. That's why the vue/html-self-closing rule conflicts/is redundant with Prettier. So eslint-config-prettier turns it off. However, you have turned it on again in your config. Remove the rule and your conflicts should go away.