Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
4 tasks done
759325100 opened this issue Mar 5, 2024 · 2 comments · Fixed by vuejs/eslint-plugin-vue#2416
Closed
4 tasks done

Comments

@759325100
Copy link

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

  • I'm using eslint-plugin-vue.
  • I'm sure the problem is a parser problem. (If you are not sure, search for the issue in eslint-plugin-vue repo and open the issue in eslint-plugin-vue repo if there is no solution.
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

8.52.0

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

  • vue-eslint-parser@9.3.2
  • eslint-plugin-vue@9.18.0

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
Copy link
Member

waynzh commented Mar 5, 2024

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

Update: follow up on this in vuejs/eslint-plugin-vue#2416

@759325100
Copy link
Author

@waynzh thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants