N
Nuxt2mo ago
Ducky

How can i ignore some folders in my app when run pnpm nuxi typecheck

I have i typescript params in my nuxt config
typescript: {
typeCheck: false,
strict: true,
}
typescript: {
typeCheck: false,
strict: true,
}
And i have a tsconfig.json in the root folder with that in
{
"extends": "./.nuxt/tsconfig.json",
"exclude": ["**/types/graphql/**.ts", "**/app-modules/explore/**"],
"compilerOptions": {
"skipLibCheck": true
}
}
{
"extends": "./.nuxt/tsconfig.json",
"exclude": ["**/types/graphql/**.ts", "**/app-modules/explore/**"],
"compilerOptions": {
"skipLibCheck": true
}
}
All my code is in the "app" folder. Exemple: app/app-modules/explore/... That the results of my pnpm nuxi typecheck:
Found 519 errors in 85 files.

Errors Files
3 app/app-modules/action/components/modales/actionEstimationModal.vue:123
3 app/app-modules/explore-global/components/GeneralGraph.vue:64
1 app/app-modules/explore/components/chart/byZone.vue:29
3 app/app-modules/explore/components/filters/index.vue:30
1 app/app-modules/explore/components/table/chronological.vue:62
2 app/app-modules/explore/composables/chart/useExploreBarChart.ts:

Found 519 errors in 85 files.

Errors Files
3 app/app-modules/action/components/modales/actionEstimationModal.vue:123
3 app/app-modules/explore-global/components/GeneralGraph.vue:64
1 app/app-modules/explore/components/chart/byZone.vue:29
3 app/app-modules/explore/components/filters/index.vue:30
1 app/app-modules/explore/components/table/chronological.vue:62
2 app/app-modules/explore/composables/chart/useExploreBarChart.ts:

3 Replies
kapa.ai
kapa.ai2mo ago
Hi @Ducky. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To ignore specific folders or files during type checking with pnpm nuxi typecheck, you might expect that adding them to the exclude array in your root tsconfig.json would be sufficient. However, in Nuxt, the .nuxt/tsconfig.json file is auto-generated and your root tsconfig.json extends it. Any options you set in your root tsconfig.json (like exclude) will override the generated config, but there are some caveats: - The Nuxt documentation and issues indicate that customizing exclude in your root tsconfig.json should work, but if you overwrite certain options (like compilerOptions.paths), you may lose important Nuxt-specific module resolutions, which can break type support for things like #imports and aliases. This doesn't directly affect exclude, but it's a sign that not all customizations are always respected as expected by the Nuxt tooling [Nuxt TypeScript Concepts]. - The nuxt typecheck command uses vue-tsc and the generated .nuxt/tsconfig.json as its base. If your exclude is not being respected, it may be because the type checker is not using your root tsconfig.json as the entry point, but rather the generated one [nuxt typecheck command]. What you can try: 1. Check the Effective tsconfig Used by vue-tsc:
Make sure that vue-tsc is actually using your root tsconfig.json (with your exclude), not just .nuxt/tsconfig.json. If not, your exclude settings may be ignored. 2. Use the ignore Option in nuxt.config:
While the ignore option in nuxt.config is primarily for build-time file ignoring, not type checking, it may help reduce what files Nuxt processes overall [ignore option]. 3. Move Excluded Folders Outside the App Directory:
If possible, move folders you want to exclude outside of the main app directory, so they're not picked up by Nuxt or vue-tsc at all. 4. Custom Typecheck Script:
If Nuxt's built-in type checking doesn't respect your exclude, you can run vue-tsc directly with your desired config:
npx vue-tsc --project tsconfig.json

npx vue-tsc --project tsconfig.json

This gives you full control over the tsconfig.json used. Summary:
The knowledge sources do not explicitly confirm that the exclude field in your root tsconfig.json will always be respected by pnpm nuxi typecheck, since Nuxt generates and uses its own .nuxt/tsconfig.json for type checking. If your exclusions are not working, consider running vue-tsc directly with your config, or restructure your project so unwanted files are not included in the type check scope [Nuxt TypeScript Concepts]. If you need more granular control, you may need to wait for further improvements in Nuxt's type checking integration, as some related issues have been discussed in the community [Github Issue: failed to resolve "extends":"./.nuxt/tsconfig.json"]. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2mo ago
<@272718635137499146> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Ducky
DuckyOP2mo ago
Still not working with you adivce.. Still not working with you adivce.. I try every steps but is still check the folder explore

Did you find this page helpful?