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

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

Closed
2 tasks done
ByScripts opened this issue Jun 5, 2024 · 1 comment · Fixed by #2489
Closed
2 tasks done

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

ByScripts opened this issue Jun 5, 2024 · 1 comment · Fixed by #2489
Labels

Comments

@ByScripts
Copy link

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=

@FloEdelmann FloEdelmann changed the title no-setup-props-reactivity-loss no-setup-props-reactivity-loss should report template expressions Jun 5, 2024
@FloEdelmann FloEdelmann changed the title no-setup-props-reactivity-loss should report template expressions no-setup-props-reactivity-loss should report template string expressions Jun 19, 2024
@FloEdelmann
Copy link
Member

Pull request welcome to fix this false-negative!

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

Successfully merging a pull request may close this issue.

2 participants