Skip to content

Compatible with tsconfig allowArbitraryExtensions option #5366

Open
@Teages

Description

@Teages

Vue - Official extension or vue-tsc version

2.2.10

VSCode version

1.100

Vue version

main branch

TypeScript version

>=5.0

Steps to reproduce

  1. enable allowArbitraryExtensions in tsconfig.json
  2. create two files: WithType.vue, WithType.d.vue.ts, add a type export in WithType.d.vue.ts
  3. try to import the type by import type { X } from './WithType.vue', it throws a error when vue language tools enabled

What is expected?

Language tools should import the type of *.vue from *.d.vue.ts as the first choice because allowArbitraryExtensions is enabled

What is actually happening?

Language tools try to import the type from the script block of *.vue and got nothing

Link to minimal reproduction

https://github.com/Teages/vue-allow-arbitrary-extensions

Any additional comments?

nuxt/module-builder#597
unjs/mkdist#270
unjs/mkdist#268 (comment)
https://github.com/vuejs/core/blob/v3.5.13/packages/compiler-sfc/src/script/resolveType.ts#L1154

microsoft/TypeScript#50133

vuejs/core#13301

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions