Skip to content

Template props validation generates kebab-case key with incorrect optional modifier placement #2411

Closed
@yyx990803

Description

@yyx990803
  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: macOS
  • Vetur version: 0.28.0
  • VS Code version: 1.50.1

Problem

If a component defines optional props in camel case, e.g.

Screen Shot 2020-10-29 at 4 13 03 PM

Then in another component that uses it, the types generated for props validation places the optional modifier ? incorrectly as part of the key:

Screen Shot 2020-10-29 at 4 16 27 PM

The generated type should be

{
  'default-split'?: number
}

not

{
  'default-split?': number
}

Reproducible Case

This can be reproduced on https://github.com/vuejs/vue-devtools/tree/next by opening https://github.com/vuejs/vue-devtools/blob/next/packages/app-frontend/src/features/components/ComponentsInspector.vue and hover over <SplitPane>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions