Skip to content

Commit

Permalink
Added another FAQ for beginners with a specific error (#35)
Browse files Browse the repository at this point in the history
* 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 <andrey@sitnik.ru>

* Update README.md

---------

Co-authored-by: Andrey Sitnik <andrey@sitnik.ru>
  • Loading branch information
franciscop and ai committed Apr 15, 2023
1 parent 870cd91 commit 0e92d6d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Expand Up @@ -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
}
}
```

0 comments on commit 0e92d6d

Please sign in to comment.