N
Nuxt2y ago
Sam K

Typescript complains about props not being used in the template if not used as props.theprop

Hi, I am using nuxt with ts and vue volar extension with the typescript plugin. as shown in the fist screenshot that when accessing the prop directly from the template as {{ someProp }} it complains about the const props is not being used, the value in the app shows but ESLINT crashes, but if I use it {{ props.someProp }}} works fine and ESLINT does not complain. Any thoughts on this issue Thanks
No description
No description
No description
3 Replies
Sam  K
Sam K2y ago
this is my eslintrc config
No description
vinku
vinku2y ago
You are using typescript as script lang, but not defining props with typescript. defineProps<{something: somethingInterface;}>(); const props = defineProps<{ foo: string bar?: number }>() maybe this better example , define props like this
Sam  K
Sam K2y ago
I started that way, and got the same result.
Want results from more Discord servers?
Add your server