vuejs / vue-eslint-parser

The ESLint custom parser for `.vue` files.
MIT License
443 stars 74 forks source link

Not escaped ampersand used in attribute/prop creates errors in next lines #157

Closed krystian-wolarek closed 2 years ago

krystian-wolarek commented 2 years ago

Tell us about your environment

Please show your full configuration: Clean Vue project with 1 additional rule

"rules": {
      "vue/max-attributes-per-line": [
        "error",
        {
          "singleline": {
            "max": 1
          },
          "multiline": {
            "max": 1
          }
        }
      ]
    }

What did you do?

When we place any attribute ( prop or normal html attribute) that ends with & like in example bellow then eslint complains in next line about errors that not exist. See What actually happened?

When i add any letter after ampersand or escape it manually it working fine. See What did you expect to happen?

<some-component
    separator="&"
    any-attribute="Vue logo"
    class="anything" />

What did you expect to happen?

Zrzut ekranu 2022-06-21 o 14 28 20

What actually happened?

Zrzut ekranu 2022-06-21 o 14 27 28

Repository to reproduce this issue

https://codesandbox.io/s/vigilant-chihiro-e3s7xz?file=/src/App.vue

ota-meshi commented 2 years ago

Thank you for posting issue!

I have fixed this issue. Try using the latest version of vue-eslint-parser.