Skip to content

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

Open
@alphatr

Description

@alphatr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions