vuejs / eslint-plugin-vue

Official ESLint plugin for Vue.js
https://eslint.vuejs.org/
MIT License
4.47k stars 667 forks source link

vue/html-quotes fix tool bug #2604

Closed 759325100 closed 1 week ago

759325100 commented 1 week ago

vue/html-quotes to fix unexpected problems in the following code

<span :class='{"action": index === 0}'>

I got a wrong result

<span :class="{&quot;action&quot;: index === 0}">

Checklist

Tell us about your environment

Please show your full configuration:

{
  "vue/html-quotes": [ "error", "double"]
}

What did you do?

<span :class='{"action": index === 0}'>

What did you expect to happen?

<span :class="{'action': index === 0}">

What actually happened?

<span :class="{&quot;action&quot;: index === 0}">

Repository to reproduce this issue

759325100 commented 1 week ago

I think this is a situation that the rule fix tool ignores. If it can be taken into account, the compatibility may be better.

waynzh commented 1 week ago

Refer to this https://github.com/vuejs/eslint-plugin-vue/issues/2587#issuecomment-2441149617

ota-meshi commented 1 week ago

Yeah. It's duplicate of #2587.