vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 593 forks source link

Consider using web-types schema for component data #2090

Open rchl opened 4 years ago

rchl commented 4 years ago

Feature Request

I don't know the framework support system well but it seems like it's necessary to specify tags and attributes separately (at least if one wants more detailed attributes description).

Vetur should maybe consider using the schema that webstorm uses (for example https://github.com/nuxt/nuxt.js/blob/0a4aacc946126b5b4c39cd2e546edcb9838053c7/packages/vue-app/web-types/web-types.json).

It has everything in the same file/object and there is no need to split anything. Also, it uses an existing schema (http://json.schemastore.org/web-types) so developers can get their types validated when creating them.

rchl commented 4 years ago

On a related note, not sure if it's the limitation of the schema or Vetur but even though Nuxt defines type for an attribute, it doesn't seem to have any effect in Vetur.

https://github.com/nuxt-community/nuxt-helper-json/blob/37c75c9c0bcf2c06a6fc41be5bd73bcbbf6b0d13/nuxt-attributes.json#L13

yoyo930021 commented 4 years ago

Follow vuejs/vue#7186