Skip to content

Commit

Permalink
docs: Add note on lib option in TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnns committed Mar 9, 2025
1 parent 639b106 commit 7102dc3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ npm install typescript @peerigon/configs --save-dev

Then create a `tsconfig.json` just for type-checking next to your `package.json`:

```json
```jsonc
{
"extends": "@peerigon/configs/typescript"
"extends": "@peerigon/configs/typescript",
"compilerOptions": {
// Our config sets only "lib": ["es2022"].
// Depending on your project, you might need to add DOM (and more).
"lib": ["es2022", "dom"],
},
}
```

Expand All @@ -32,7 +37,7 @@ In case you're developing a library with a dedicated build process, we recommend
{
"extends": ["./tsconfig.json", "@peerigon/configs/typescript/lib"],
"include": ["src"],
"exclude": ["src/**/*.test.ts", "src/tests/**/*.ts"]
"exclude": ["src/**/*.test.ts", "src/**/*.test.tsx", "src/tests/**/*"]
}
```

Expand Down

0 comments on commit 7102dc3

Please sign in to comment.