@4mbl/tsconfig 5.0.0-beta.0 → 5.0.0-beta.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @4mbl/tsconfig Changelog
2
2
 
3
+ ## 5.0.0-beta.2
4
+
5
+ ### Major Changes
6
+
7
+ - f95bc32: [base] Enable noPropertyAccessFromIndexSignature
8
+ - f95bc32: [base] Disable allowUnreachableCode
9
+ - f95bc32: [base] Enable exactOptionalPropertyTypes
10
+
11
+ ### Minor Changes
12
+
13
+ - fe250ba: Add template for Bun.
14
+
15
+ ## 5.0.0-beta.1
16
+
17
+ ### Minor Changes
18
+
19
+ - 1bd158c: [next] Include framework generated files in rootDir scope
20
+
3
21
  ## 5.0.0-beta.0
4
22
 
5
23
  ### Major Changes
package/README.md CHANGED
@@ -2,15 +2,16 @@
2
2
 
3
3
  > Strict TypeScript configuration for various environments.
4
4
 
5
- * [Usage](#usage)
6
- * [Available templates](#available-templates)
7
- * [Base (tsconfig)](#base-tsconfig)
8
- * [Node (tsconfig)](#node-tsconfig)
9
- * [Node-TS (tsconfig)](#node-ts-tsconfig)
10
- * [Browser (tsconfig)](#browser-tsconfig)
11
- * [Next (tsconfig)](#next-tsconfig)
12
- * [Vite React (app | node)](#vite-react-app--node)
13
- * [Versioning](#versioning)
5
+ - [Usage](#usage)
6
+ - [Available templates](#available-templates)
7
+ - [Base (tsconfig)](#base-tsconfig)
8
+ - [Node (tsconfig)](#node-tsconfig)
9
+ - [Node-TS (tsconfig)](#node-ts-tsconfig)
10
+ - [Bun (tsconfig)](#bun-tsconfig)
11
+ - [Browser (tsconfig)](#browser-tsconfig)
12
+ - [Next (tsconfig)](#next-tsconfig)
13
+ - [Vite React (app | node)](#vite-react-app--node)
14
+ - [Versioning](#versioning)
14
15
 
15
16
  ---
16
17
 
@@ -22,11 +23,21 @@ Install the [`@4mbl/tsconfig`](https://www.npmjs.com/package/@4mbl/tsconfig) npm
22
23
  npm install -D @4mbl/tsconfig
23
24
  ```
24
25
 
26
+ Install the type definitions required by your environment:
27
+
28
+ ```shell
29
+ # When using /node, /node-ts, /next, or /vite-react/node template
30
+ npm install -D @types/node
31
+
32
+ # When using /bun template
33
+ bun add -D @types/bun
34
+ ```
35
+
25
36
  Create a `tsconfig.json` file in the root of your project and extend the desired `tsconfig` template.
26
37
 
27
38
  ```jsonc
28
39
  {
29
- "extends": "@4mbl/tsconfig/node"
40
+ "extends": "@4mbl/tsconfig/node",
30
41
  // your custom configuration...
31
42
  }
32
43
  ```
@@ -47,6 +58,10 @@ Extends the base template with configuration specific to Node.js.
47
58
 
48
59
  Extends the node template with configuration for TypeScript-only projects.
49
60
 
61
+ ### Bun (<kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/bun.json)</kbd>)
62
+
63
+ Extends the base template with configuration specific to Bun.
64
+
50
65
  ### Browser (<kbd>[tsconfig](https://unpkg.com/@4mbl/tsconfig@latest/browser.json)</kbd>)
51
66
 
52
67
  Extends the base template with configuration specific to browser and React applications.
@@ -62,11 +77,11 @@ Extends the base template with configuration from the Next.js app template.
62
77
  "extends": "@4mbl/tsconfig/next",
63
78
  "compilerOptions": {
64
79
  "paths": {
65
- "@/*": ["./src/*"]
66
- }
80
+ "@/*": ["./src/*"],
81
+ },
67
82
  },
68
83
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
69
- "exclude": ["node_modules"]
84
+ "exclude": ["node_modules"],
70
85
  }
71
86
  ```
72
87
 
@@ -83,8 +98,8 @@ Vite uses seperate `tsconfig` files for the application and the node environment
83
98
  "files": [],
84
99
  "references": [
85
100
  { "path": "./tsconfig.app.json" },
86
- { "path": "./tsconfig.node.json" }
87
- ]
101
+ { "path": "./tsconfig.node.json" },
102
+ ],
88
103
  }
89
104
  ```
90
105
 
@@ -92,7 +107,7 @@ Vite uses seperate `tsconfig` files for the application and the node environment
92
107
 
93
108
  ```jsonc
94
109
  {
95
- "extends": "@4mbl/tsconfig/vite-react/app"
110
+ "extends": "@4mbl/tsconfig/vite-react/app",
96
111
  }
97
112
  ```
98
113
 
@@ -100,7 +115,7 @@ Vite uses seperate `tsconfig` files for the application and the node environment
100
115
 
101
116
  ```jsonc
102
117
  {
103
- "extends": "@4mbl/tsconfig/vite-react/node"
118
+ "extends": "@4mbl/tsconfig/vite-react/node",
104
119
  }
105
120
  ```
106
121
 
package/dist/base.json CHANGED
@@ -32,16 +32,19 @@
32
32
  "strict": true,
33
33
  "checkJs": true,
34
34
  "erasableSyntaxOnly": true,
35
- "forceConsistentCasingInFileNames": true,
36
35
  "allowSyntheticDefaultImports": true,
36
+ "allowUnreachableCode": false,
37
+ "exactOptionalPropertyTypes": true,
38
+ "forceConsistentCasingInFileNames": true,
37
39
  "noFallthroughCasesInSwitch": true,
38
40
  "noImplicitAny": true,
39
41
  "noImplicitOverride": true,
40
42
  "noImplicitReturns": false,
41
- "noUnusedLocals": true,
42
- "noUnusedParameters": true,
43
+ "noPropertyAccessFromIndexSignature": true,
43
44
  "noUncheckedIndexedAccess": true,
44
- "noUncheckedSideEffectImports": true
45
+ "noUncheckedSideEffectImports": true,
46
+ "noUnusedLocals": true,
47
+ "noUnusedParameters": true
45
48
  },
46
49
  "include": ["${configDir}/src/**/*"],
47
50
  "exclude": ["${configDir}/node_modules"]
package/dist/bun.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Bun",
4
+ "extends": "./base.json",
5
+ "compilerOptions": {
6
+ "moduleResolution": "bundler",
7
+ "module": "preserve",
8
+ "paths": { "*": ["${configDir}/src/*"] },
9
+ "types": ["bun"],
10
+
11
+ "noEmit": true,
12
+ "allowImportingTsExtensions": true
13
+ }
14
+ }
package/dist/next.json CHANGED
@@ -3,6 +3,7 @@
3
3
  "display": "Next.js",
4
4
  "extends": "./base.json",
5
5
  "compilerOptions": {
6
+ "rootDir": "${configDir}",
6
7
  "lib": ["esnext", "dom"],
7
8
  "allowJs": true,
8
9
  "skipLibCheck": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4mbl/tsconfig",
3
- "version": "5.0.0-beta.0",
3
+ "version": "5.0.0-beta.2",
4
4
  "description": "Strict TypeScript configuration for various environments.",
5
5
  "type": "module",
6
6
  "author": "4mbl",
@@ -8,6 +8,7 @@
8
8
  "homepage": "https://github.com/4mbl/config/tree/main/packages/tsconfig#readme",
9
9
  "exports": {
10
10
  "./browser": "./dist/browser.json",
11
+ "./bun": "./dist/bun.json",
11
12
  "./next": "./dist/next.json",
12
13
  "./node-ts": "./dist/node-ts.json",
13
14
  "./node": "./dist/node.json",