@petbee/tsconfig 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -6
- package/package.json +2 -2
- package/tsconfig.json +4 -4
package/README.md
CHANGED
|
@@ -1,19 +1,60 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@petbee/tsconfig`
|
|
2
2
|
|
|
3
3
|
This is default `tsconfig.json` that should be used by all Petbee projects.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```bash
|
|
8
|
+
yarn add -D @petbee/tsconfig
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### NestJS Project
|
|
14
|
+
|
|
15
|
+
To start, create a `tsconfig.json` in the root of your project.
|
|
16
|
+
|
|
17
|
+
A typical setup where the application sit in `[project root]/app` folder is as follow:
|
|
8
18
|
|
|
9
19
|
```json
|
|
10
20
|
{
|
|
11
|
-
"extends": "@petbee/tsconfig"
|
|
21
|
+
"extends": "@petbee/tsconfig/nestjs.json",
|
|
22
|
+
"compilerOptions": {
|
|
23
|
+
"rootDir": "./src"
|
|
24
|
+
},
|
|
25
|
+
"exclude": ["node_modules", "dist", "tests/**/*", "**/*.spec.ts"]
|
|
12
26
|
}
|
|
13
27
|
```
|
|
14
28
|
|
|
15
|
-
|
|
29
|
+
### All Other Project
|
|
16
30
|
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
A base configuration file is also provided if the above does not fit your need.
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"extends": "@petbee/tsconfig",
|
|
36
|
+
"compilerOptions": {
|
|
37
|
+
"baseUrl": ".",
|
|
38
|
+
"rootDir": "."
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Common Got Ya
|
|
44
|
+
|
|
45
|
+
#### Type Checking does not honour `skipLibCheck: true` setting
|
|
46
|
+
|
|
47
|
+
There are times when the type failure occur inside of a library your project is consuming, and having `skipLibCheck: true` does not resolved it. In this scenario, add an `exclude` option to your `tsconfig.json`.
|
|
48
|
+
|
|
49
|
+
eg.
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"extends": "@petbee/tsconfig",
|
|
54
|
+
"compilerOptions": {
|
|
55
|
+
"baseUrl": ".",
|
|
56
|
+
"rootDir": ".",
|
|
57
|
+
"exclude": ["./node_modules/**/*"]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
19
60
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@petbee/tsconfig",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"typescript": "^3 || ^4 || ^5"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "6d0700f54e3e0066c16afbef99920922b326da9e"
|
|
19
19
|
}
|
package/tsconfig.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"allowSyntheticDefaultImports": true,
|
|
5
5
|
"esModuleInterop": true,
|
|
6
6
|
"jsx": "react",
|
|
7
|
-
"lib": ["es2017", "dom", "es2018.promise", "esnext.asynciterable"],
|
|
8
|
-
"module": "
|
|
7
|
+
"lib": ["es2017", "dom", "es2018.promise", "esnext.asynciterable", "es2019", "es2020", "esnext"],
|
|
8
|
+
"module": "esnext",
|
|
9
9
|
"moduleResolution": "node",
|
|
10
10
|
"noImplicitAny": true,
|
|
11
11
|
"noImplicitReturns": true,
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"strictFunctionTypes": true,
|
|
18
18
|
"strictNullChecks": true,
|
|
19
19
|
"strictPropertyInitialization": true,
|
|
20
|
-
"target": "
|
|
20
|
+
"target": "es2020",
|
|
21
21
|
"forceConsistentCasingInFileNames": true
|
|
22
22
|
},
|
|
23
23
|
"typeAcquisition": {
|
|
24
|
-
"enable":
|
|
24
|
+
"enable": true
|
|
25
25
|
}
|
|
26
26
|
}
|