8000 Manually annotating prop with JSDoc doesn't produce right type · Issue #6854 · vuejs/core · GitHub
[go: up one dir, main page]

Skip to content

Manually annotating prop with JSDoc doesn't produce right type #6854

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

Open
rchl opened this issue Oct 11, 2022 · 2 comments
Open

Manually annotating prop with JSDoc doesn't produce right type #6854

rchl opened this issue Oct 11, 2022 · 2 comments

Comments

@rchl
Copy link
rchl commented Oct 11, 2022

Vue version

3.2.0

Link to minimal reproduction

https://sfc.vuejs.org/#eNpNUMtuwjAQ/JWVL4Eo2Gp7i9yoHHvrHXMIZGmDsGPZDgVZ/veuE5Tii/cxOzO7kW2t5dcRWc1kQG0vbcBGGQDZ9dcmRuip6iElKXJBGSmeYJT6o+ttoBhvdnABOjy14yVAzCSm1VhD8Wk6vBVVrlg3WF/PXQBRlvAR7hYh9jqPrwryUqz5F8GkGfUB3W5fwe6lgtcK3vZNglLMs5OxhQkg09Swda69T0r5PczUsFrDe/NPM/dT/hKBKZBiWYRVbDaz0a3lZz8YOs4kox4Nr9girBg5zrliPyHQbkL40zGf9Oz54L4FRdyNJvQaOXq9Objh16MjYsUmA6TP0h/G+3+V

Steps to reproduce

  1. Download the code from the reproduction playground
  2. Install Volar in the editor
  3. Hover over the items in the template

What is expected?

The type of items should be number[]

What is actually happening?

The type of items is any.

Screenshot 2022-10-11 at 23 25 08

System Info

No response

Any additional comments?

I've also created example projects using both Vue 3 and Vue 2.7 at:

(note that those repros are on their own branches)

This is to show that this works in Vue 2.7 when annotating using the PropOptions type (Vue 2 variant of Vue 3's Prop type).

Also see corresponding Volar issue: vuejs/language-tools#1984 (comment)

@shamrin
Copy link
shamrin commented Oct 12, 2023

I've started a related discussion about JSDoc and defineProps() macro: vuejs/rfcs#584

@devleesch001
Copy link
devleesch001 commented May 16, 2025

I try, and i get this with same syntaxe on Intelji IDE

Image

But using this syntaxe with PropType instead Prop I get that

Image

I think is more accurate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0