Skip to content

Commit 1d4bc98

Browse files
authored
docs: guide user to enable libReplacement option (#67)
1 parent 468d6cf commit 1d4bc98

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,24 @@ npm i -D better-typescript-lib
4343

4444
[If you are using TypeScript 4.4 or prior, see the v1 branch.](https://github.com/uhyo/better-typescript-lib/tree/v1)
4545

46+
### Set `libReplacement: true`
47+
48+
If you are using **TypeScript 5.8 or later**, include the following setting in your `tsconfig.json`:
49+
50+
```json
51+
{
52+
"compilerOptions": {
53+
// ...
54+
"libReplacement": true
55+
}
56+
}
57+
```
58+
59+
> [!NOTE]
60+
> The `libReplacement` option is available from TypeScript 5.8. If you are using TypeScript 5.7 or earlier, better-typescript-lib will work by default.
61+
>
62+
> Technically this option is not required for the current version of TypeScript because the default value is `true`. It is recommended to include it for future compatibility. In the following versions of TypeScript (likely 6.0 or later), the default value may be changed to `false` and you will need to set it to `true`.
63+
4664
### How it works
4765

4866
Starting from TypeScript 4.5, the TypeScript compiler detects existence of `@typescript/lib-xxx` packages (e.g. `@typescript/lib-es2015`) and uses them instead of the built-in definitions. By installing `better-typescript-lib`, these package names are mapped to corresponding `@better-typescript-lib/xxx` packages.

0 commit comments

Comments
 (0)