Skip to content

no-setup-props-reactivity-loss should report template string expressions #2470

Closed
@ByScripts

Description

@ByScripts

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: 8.57.0
  • eslint-plugin-vue version: 9.26.0
  • Vue version: 3.4.27
  • Node version: 20.12.2
  • Operating System: macOS Sonoma 14.5

Please show your full configuration:

{
  rules: {
    'vue/no-setup-props-reactivity-loss': 'error'
  }
}

What did you do?

<template>{{ foo }}</template>

<script setup lang="ts">
const props = defineProps<{
  foo: string
}>()

const foo = `${props.foo}`
</script>

What did you expect to happen?

Following code should throw an ESLint error

const foo = `${props.foo}`

What actually happened?

No error

Link to reproduce this issue

https://ota-meshi.github.io/eslint-plugin-vue-demo/#eJxdz9sKwjAMBuBXCUXYBOvAS083IvgQu9jYMizMpKTtUErf3VJExLscvsCfqAYeUe3V0Q1irD+3ZB6WxUOEESdDeOHcE5KHBJPwA6olYHVoCZ/FZdWH2f/rOrYE4NAHW1th69ZQJgADk/Nw7xe8irDACcp+OzEffoW7c5jH24/rVvFLU1dw2rSU1rk8Np8H1EZJmNGpfVQ5aUOsSwpdTrVgP3izGP/SM7usdim9AQOUXZw=

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions