@petbee/tsconfig 1.0.1 → 1.0.3

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 CHANGED
@@ -1,19 +1,60 @@
1
- # Petbee `tsconfig.json`
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
- Add a `tsconfig.json` file inside your builder folder (react or node) with the following
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
- And run
29
+ ### All Other Project
16
30
 
17
- ```bash
18
- yarn add -D @petbee/tsconfig
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/nestjs.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "declaration": true,
5
+ "removeComments": true,
6
+ "emitDecoratorMetadata": true,
7
+ "experimentalDecorators": true,
8
+ "allowSyntheticDefaultImports": true,
9
+ "target": "ES2019",
10
+ "sourceMap": true,
11
+ "outDir": "./dist",
12
+ "baseUrl": "./",
13
+ "incremental": true,
14
+ "skipLibCheck": true,
15
+ "esModuleInterop": true
16
+ }
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@petbee/tsconfig",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
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": "9987c88805147a050ed1eca4413916241b5596da"
18
+ "gitHead": "4abb4d54bdc927736aee06803e0e9a5d179acfa1"
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": "es6",
7
+ "lib": ["es2017", "dom", "es2018.promise", "esnext.asynciterable", "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": "es2017",
20
+ "target": "esnext",
21
21
  "forceConsistentCasingInFileNames": true
22
22
  },
23
23
  "typeAcquisition": {
24
- "enable": false
24
+ "enable": true
25
25
  }
26
26
  }