vuejs / vue-eslint-parser

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

There is a bug in the use fix action of v-for-delimiter-style under special syntax #226

Closed 759325100 closed 4 months ago

759325100 commented 4 months ago

Before You File a Bug Report Please Confirm You Have Done The Following...

What version of ESLint are you using?

8.52.0

What version of eslint-plugin-vue and vue-eslint-parser are you using?

What did you do?

Configuration ``` { "rules": { "vue/v-for-delimiter-style": ["error", "in"], } } ```
<!-- fix before  -->
<template>
  <div>
    <span v-for="(item,) in items" :text="item.text" :key="item.id"></span>
  </div>
</template>

<!-- fix after  -->
<template>
  <div>
    <span v-for="(itemin) in items" :text="item.text" :key="item.id"></span>
  </div>
</template>

real images

image image image

What did you expect to happen?

ESLint Check Result: Expected 'in' instead of ',' in 'v-for'.eslintvue/v-for-delimiter-style

Using fix action: remove trailing comma

What actually happened?

ESLint Check Result: Expected 'in' instead of ',' in 'v-for'.eslintvue/v-for-delimiter-style

Using fix action: The fix tool replaced in to the trailing comma, causing the variable name to be abnormal.

Link to Minimal Reproducible Example

N/A

Additional comments

No response

waynzh commented 4 months ago

This might be an issue with the eslint-plugin-vue repo.

Update: follow up on this in https://github.com/vuejs/eslint-plugin-vue/pull/2416

759325100 commented 4 months ago

@waynzh thank you