Hey everyone! I'm stuck with a frustrating TypeScript issue and would love some help. Setup:
I have a Nuxt module (@agorastore/shared-ui) with strict: true that type-checks perfectly fine when I run checks within the module itself This module is published to npm and consumed by my main Nuxt app My app also has strict: true enabled I'm using vue-tsc --noEmit for type checking + VSCode with Volar
The Problem: When I run vue-tsc in my app, I get 46 TypeScript errors from the module's Vue component files in node_modules/@agorastore/shared-ui/dist/runtime//.vue. These are errors like:
TS7053: Element implicitly has an 'any' type TS18048: 'X' is possibly 'undefined' TS2532: Object is possibly 'undefined'
The Weird Part:
If I disable strict: false in my app → errors disappear The module itself type-checks perfectly with strict mode enabled These feel like false positives since the module's source code is valid
What I've Already Tried: skipLibCheck: true in tsconfig.json (already enabled) Adding node_modules to exclude array Excluding specific paths: "exclude": ["node_modules/@agorastore/shared-ui//"] Creating a separate tsconfig.typecheck.json with explicit includes Adding --skipLibCheck flag directly to vue-tsc command Various Nuxt-specific configurations
None of these prevent vue-tsc from checking the .vue files in node_modules.
The Question: How can I prevent TypeScript/vue-tsc from type-checking Vue component files that are distributed in node_modules, while still maintaining strict mode for my own app code?
The module distributes compiled .vue files in its dist folder, and it seems like vue-tsc is directly analyzing these files rather than just using their type declarations