Skip to content

No option to ignore type-checking library components in node_modules #158

@michumk

Description

@michumk

Describe the bug
Currently, if we use use both nuxt-typed-router and @nuxt/content modules in the same project, the nuxt typecheck command results with an error

This happens because a component in @nuxtjs/mdc (a dependency of @nuxt/content) does not comply with rules enforced by nuxt-typed-router.

None of the nuxt-typed-router configuration options currently resolve the issue.

Expected behavior
A configuration option to disable type-checking internal components in node_modules, allowing libraries that don't comply with nuxt-typed-router rules to work without issues.

Error output

~/projects/nuxt-starter-iex3xpmq 22s
❯ npm run typecheck

> typecheck
> nuxt typecheck

node_modules/@nuxtjs/mdc/dist/runtime/components/prose/ProseA.vue:2:4 - error TS2345: Argument of type '{ href: string; target: "_blank" | "_parent" | "_self" | "_top" | null | undefined; }' is not assignable to parameter of type 'Omit<NuxtLinkProps, "to" | "external"> & { to: any; external?: false | undefined; } & Record<string, unknown>'.
  Property 'to' is missing in type '{ href: string; target: "_blank" | "_parent" | "_self" | "_top" | null | undefined; }' but required in type '{ to: any; external?: false | undefined; }'.

2   <NuxtLink
     ~~~~~~~~

  .nuxt/typed-router/typed-router.d.ts:40:3
    40   to: NuxtRoute<T, P, E>;
         ~~
    'to' is declared here.


Found 1 error in node_modules/@nuxtjs/mdc/dist/runtime/components/prose/ProseA.vue:2

Reproduction
https://stackblitz.com/edit/nuxt-starter-iex3xpmq?file=nuxt.config.ts

Steps to reproduce

  1. npm install
  2. npm run typecheck

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