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

eslint rule no-useless-assignment doesn't work well. #2660

Open
2 tasks done
alphatr opened this issue Dec 23, 2024 · 1 comment
Open
2 tasks done

eslint rule no-useless-assignment doesn't work well. #2660

alphatr opened this issue Dec 23, 2024 · 1 comment

Comments

@alphatr
Copy link

alphatr commented Dec 23, 2024

Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have read the FAQ and my problem is not listed.

Tell us about your environment

  • ESLint version: 9.17.0
  • eslint-plugin-vue version: 9.32.0
  • Vue version: 3.5.13
  • Node version: v22.11.0
  • Operating System: macos 15.1.1

Please show your full configuration:

import pluginVue from 'eslint-plugin-vue'

export default [
  ...pluginVue.configs['flat/base'],
  {
    rules: {
      'no-useless-assignment': 'error',
    }
  }
]

What did you do?

<template>
  <p :title="title">test</p>
</template>
<script setup>
import {ref} from "vue"

const title = ref("test")
const color = ref("#FFF")
</script>
<style>
p {
  color: v-bind(color);
}
</style>

What did you expect to happen?

doesn't report error;

What actually happened?

report error 'This assigned value is not used in subsequent statements.'

Repository to reproduce this issue

https://ota-meshi.github.io/eslint-plugin-vue-demo

@ota-meshi ota-meshi added needs repro Need a repository that can reproduce the problem, or a link to DEMO. and removed needs repro Need a repository that can reproduce the problem, or a link to DEMO. labels Dec 23, 2024
@waynzh
Copy link
Member

waynzh commented Dec 31, 2024

I can confirm this issue.
It's likely something in vue-eslint-parser or we might need to add vue/no-useless-assignment to handle it. I haven't looked too closely yet, but will check when I have time.

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

No branches or pull requests

3 participants