Skip to content

Commit 9917422

Browse files
committed
docs(tsconfig): add note to clarify about extends behavior
1 parent 3d707ff commit 9917422

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

configs/tsconfig/readme.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ yarn add -D @latipun7/tsconfig typescript
1616

1717
- NodeJS ESModule target
1818

19-
```json
19+
```jsonc
2020
// tsconfig.json
2121
{
2222
"extends": "@latipun7/tsconfig/esm",
@@ -28,7 +28,7 @@ yarn add -D @latipun7/tsconfig typescript
2828

2929
- NextJS apps
3030

31-
```json
31+
```jsonc
3232
// tsconfig.json
3333
{
3434
"extends": "@latipun7/tsconfig/next",
@@ -40,7 +40,7 @@ yarn add -D @latipun7/tsconfig typescript
4040

4141
- NodeJS CommonJS target
4242

43-
```json
43+
```jsonc
4444
// tsconfig.json
4545
{
4646
"extends": "@latipun7/tsconfig/cjs",
@@ -50,6 +50,10 @@ yarn add -D @latipun7/tsconfig typescript
5050
}
5151
```
5252

53+
**Note**: Since typescript's `extends` has behavior that properties with relative paths found in the configuration file, which aren't excluded from inheritance, will be resolved relative to the configuration file they originated in.
54+
55+
This means, `files`, `include`, `exclude`, and other properties that accept relative path like `compilerOptions.baseUrl`, `compilerOptions.paths`, etc, you need to specify it yourself.
56+
5357
## Hacking to the Gate~! 🐱‍💻🎶
5458

5559
[MIT License][license-url] © Latif Sulistyo

0 commit comments

Comments
 (0)