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

strictTemplates option works only bound props #2136

Closed
revyh opened this issue Nov 21, 2022 · 0 comments
Closed

strictTemplates option works only bound props #2136

revyh opened this issue Nov 21, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@revyh
Copy link

revyh commented Nov 21, 2022

I tried vueCompilerOptions.strictTemplates and it works only on bound props.

// CustomButton.vue
<script setup lang="ts">

defineProps<{}>(); 

</script>

// AnotherComponent.vue
<template>
  <!-- this reports errors -->
  <custom-button :non-existent-props="'some value'" />

  <!-- this is not -->
  <custom-button non-existent-prop="some value" />
</template>

I expected volar to report in both cases because it doesn't matter how values are passed to props. The only thing that matter is whether the prop exists or not.

Versions
vue: 3.2.45
typescript: 4.8.4
vue-tsc/volar: 1.0.9

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants