-
-
Notifications
You must be signed in to change notification settings - Fork 216
Description
When working in nested directories/projects, it's possible to define code where certain libs are omitted:
Imagine your Svelte codebase has a service worker, and you want to exclude lib.dom.d.ts
in related code. Svelte obviously requires lib.dom.d.ts
, but by using another tsconfig (like above) tsc
enforces this as desired. VS Code, however, does not, when using Svelte for VS Code. If you disable the extension, it works fine.
From the logs, you can see that the extension "injects" several libs:
Info 85 [11:59:08.356] event:
{"seq":0,"type":"event","event":"createFileWatcher","body":{"id":20,"path":"path/to/root/node_modules/svelte/types/package.json"}}
Info 86 [11:59:08.356] Finishing updateGraphWorker: Project: path/to/nested/tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed: 553.7230999999999ms
Info 87 [11:59:08.356] Project 'path/to/nested/tsconfig.json' (Configured)
Info 88 [11:59:08.359] Files (56)
Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/lib.dom.d.ts
...
—in turn, this seems to make all TS/JS code that is a descendent of any folder containing a node_modules/svelte
automatically include all of those declarations (as far as VS Code is concerned).
For .svelte
code, this makes sense, but for plain TS/JS, would it be at all possible to omit/ignore/exclude these from syntax checking? (either implicitly or explicity)