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 errors are thrown when required props are missing. If set jsxTemplates: true #2139

Closed
johanninos opened this issue Nov 23, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@johanninos
Copy link

johanninos commented Nov 23, 2022

Volar version

v1.0.9

Link to minimal reproduction

https://sfc.vuejs.org/#eNqVkD1uwzAMha9CaEkLNNLuugGKXKAH0OLatKPA+oFIpwUM372U3CFLhiwCyUd+T+SqPlPStwVVo1pGn+aO8WQDQNtf3DwYiVtzJ0hKfXaJgZCXBHMXpg+rmKwS1fkUM8O5jMKYo4eDNjUrHofC2qelV72pvf3ou6SvFIP8YS3W9l8QZgO1UmoCKLlVF+ZEjTE09oV6JR3zZCTSeQnsPGokf/zO8YcwC9iqgths2MTyHP2DfQd3qwHAurLjGTcZkbrZhSeuYAP+1ju4wJjHrkf4yjHRvktlN0CcXZje5Vc2DDi6gLWnre/p5bWa3F1r+wOQzJXC

Steps to reproduce

1.Copying the code from "minimal copy" to vscode (maybe any ide with palm extension?), missing the required props header.
2.Set jsxTemplates to true

  "vueCompilerOptions": {
	"jsxTemplates": true,
   }

What is expected?

same behavior as jsxTemplates: false

截屏2022-11-23 16 27 20

get a error like Type '{}' is not assignable to type 'Partial<{}> & Omit<Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>'. Property 'title' is missing in type '{}' but required in type 'Omit<Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>'.ts(2322) Child.vue(10, 3): 'title' is declared here.

What is actually happening?

type looks correct, but there is no error when required props are missing
截屏2022-11-23 16 26 59

Any additional comments?

For virtual files, There is no such distinction between jsxTemplates true and false.

//parent.vue
截屏2022-11-23 16 44 36

//child.vue
截屏2022-11-23 16 48 50

If the value of the prop is set, the type checking is correct. Even with jsxTemplates: true.
截屏2022-11-23 17 00 26

@johanninos johanninos changed the title No errors are thrown when required props are missing. If set jsxTemplate: true No errors are thrown when required props are missing. If set jsxTemplates: true Nov 23, 2022
@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