Skip to content
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

Allow using @ts-expect-error in Vue templates #2366

Closed
victorgarciaesgi opened this issue Feb 7, 2023 · 0 comments · Fixed by #3215
Closed

Allow using @ts-expect-error in Vue templates #2366

victorgarciaesgi opened this issue Feb 7, 2023 · 0 comments · Fixed by #3215
Labels
enhancement New feature or request

Comments

@victorgarciaesgi
Copy link

Hi all, and thanks again @johnsoncodehk for the amazing Volar.

I have a case on my Nuxt module (https://github.com/victorgarciaesgi/nuxt-typed-router), where I need to test types output of components.
I use vue-tsc to scan the fixtures to make sure things break where it should, and things are valid where it should.
It works well for ts files because I can use @ts-expect-error.
But on my case I want to test that the overrided types of <NuxtLink/> are working well.

The workaround I found for now is to use a .tsx and to test on a render function, but that miss the point the types are correctly injected into the global Vue scope.

What I can do in tsx:

import {NuxtLink} from '@typed-router';

function render() {
  return (
        {/* @ts-expect-error */}
        <NuxtLink to={{ name: 'user-id', params: { foo: 'bar' } }}></NuxtLink>;
   )
}

What I want to do in vue templates:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants