Skip to content

Proper TypeScript support - Babel parses TS as JS instead of TS #140

@JoJk0

Description

@JoJk0

Currently, only Vue SFC files without typescript-specific syntax presence are working with the addon (e.g. TS files with no TS syntax).

Example

Adding anything TypeScript-specific throws an error, e.g. adding and using ComponentProps type inside ./examples/vite/src/writing-docs/mdx-1.basic-example.stories.vue

<script setup lang="ts">
import type { ComponentProps } from 'vue-component-type-helpers'

import Checkbox from '../components/Checkbox.vue'

const a: ComponentProps<typeof Checkbox> = {
  label: 'Unchecked',
}
</script>

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions