Skip to content

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

@victorgarciaesgi

Description

@victorgarciaesgi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions