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
Thanks3 Replies
this is my eslintrc config
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 thisI started that way, and got the same result.