You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
~/workspaces/tmp/vite-project
vue-tsc -b
src/App.vue:8:7 - error TS2353: Object literal may only specify known properties, and 'thispropdoesnotexist' does not exist in type '{ readonly msg: string; } & VNodeProps & AllowedComponentProps & ComponentCustomProps'.
8 thispropdoesnotexist="sfsdf"
~~~~~~~~~~~~~~~~~~~~
Found 1 error.
It finds the error for the unknown prop, but not the unknown event.
You can also try adding vueCompilerOptions.checkUnknownEvents: true
What is expected?
According to the docs, checkUnknownEvents and strictTemplates should:
Check unknown props.
I interpret this as it should check emits—the same way it checks props.
What is actually happening?
There is seemingly no type checking on unknown props
Link to minimal reproduction
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered:
johannes-lindgren
changed the title
TypeScript is not reporting vueCompilerOptions.strictTemplates.checkUnknownEvents
TypeScript is not reporting vueCompilerOptions.checkUnknownEvents
Mar 20, 2025
johannes-lindgren
changed the title
TypeScript is not reporting vueCompilerOptions.checkUnknownEvents
TypeScript is not reporting errors from vueCompilerOptions.checkUnknownEvents
Mar 20, 2025
Vue - Official extension or vue-tsc version
vue-tsc@2.2.8
VSCode version
Vue version
vue@3.5.13
TypeScript version
typescript@5.7.3
System Info
package.json dependencies
Steps to reproduce
vueCompilerOptions.strictTemplates: true
totsconfig.app.json
src/App.vue
<HelloWorld />
, add an unknown emit handler. For reference, also add an unknown prop.Run
vue-tsc
:It finds the error for the unknown prop, but not the unknown event.
You can also try adding
vueCompilerOptions.checkUnknownEvents: true
What is expected?
According to the docs,
checkUnknownEvents
andstrictTemplates
should:I interpret this as it should check emits—the same way it checks props.
What is actually happening?
There is seemingly no type checking on unknown props
Link to minimal reproduction
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: