From 0e92d6d29d56470d3a514378cf6a793b110f7e09 Mon Sep 17 00:00:00 2001 From: Francisco Presencia Date: Sat, 15 Apr 2023 09:13:59 +0900 Subject: [PATCH] Added another FAQ for beginners with a specific error (#35) * Added another FAQ for beginners with a specific error Since this seems intended to people who don't want to commit to TS, it seems like this issue might be a bit strange and it took me a bit of fumbling around to find out this simple solution in the end. So I added a FAQ question that I think might be useful for future people who might encounter this error. * Update README.md Co-authored-by: Andrey Sitnik * Update README.md --------- Co-authored-by: Andrey Sitnik --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index ce80034..727b14d 100644 --- a/README.md +++ b/README.md @@ -142,3 +142,32 @@ you can validate whether `d.ts`-files have some issues with the following comman ```sh npx tsc path/to/your/dts/files/**/*.d.ts --noEmit ``` + +### I am getting an error **from Node types**, how do I skip `node_modules`? + +If you are getting an error that looks something like this: + +``` +✖ node_modules/@types/node/globals.d.ts:68:13: Type error TS2502 + 'AbortController' is referenced directly or indirectly in its own type annotation. +✖ node_modules/@types/node/globals.d.ts:75:13: Type error TS2502 + 'AbortSignal' is referenced directly or indirectly in its own type annotation. +``` + +You can skip the whole `node_modules` folder by specifying the options in `tsconfig.json`: + +```json +{ + "exclude": ["node_modules"] +} +``` + +Or + +```json +{ + "compilerOptions": { + "skipLibCheck": true + } +} +```