@4mbl/tsconfig 0.0.0-alpha.c07b435 → 0.0.0-alpha.c0e445a
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 +28 -0
- package/README.md +32 -17
- package/dist/base.json +13 -5
- package/dist/browser.json +2 -1
- package/dist/bun.json +14 -0
- package/dist/next.json +4 -3
- package/dist/node-ts.json +1 -1
- package/dist/node.json +2 -2
- package/dist/vite-react/app.json +3 -6
- package/dist/vite-react/node.json +3 -6
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
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
|
+
|
|
21
|
+
## 5.0.0-beta.0
|
|
22
|
+
|
|
23
|
+
### Major Changes
|
|
24
|
+
|
|
25
|
+
- e651e24: Enable `noUncheckedSideEffectImports` on all templates. This is the default in TypeScript 6/7, we set it explicitly to ensure consistent behavior for templates that already enabled it.
|
|
26
|
+
- e651e24: Disable automatic type discovery to align with TypeScript 6/7 behavior. Node.js types are now explicitly enabled for Node.js related templates.
|
|
27
|
+
- e651e24: All templates now have `rootDir` option set to './src' to align with TypeScript 6/7 behavior.
|
|
28
|
+
- e651e24: Drop explicit "dom.iterable" from `lib` as it is included in "dom" by default in TypeScript 6/7.
|
|
29
|
+
- e651e24: Remove explicit `target` from all templates to use the latest ECMAScript version in TypeScript 6/7. The ES version on `lib` is now "ESNext" all templates.
|
|
30
|
+
|
|
3
31
|
## 4.4.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
> Strict TypeScript configuration for various environments.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
"display": "Base",
|
|
4
4
|
"compilerOptions": {
|
|
5
5
|
/* Base Options */
|
|
6
|
-
"
|
|
6
|
+
"rootDir": "${configDir}/src",
|
|
7
|
+
"lib": ["esnext"],
|
|
7
8
|
"allowJs": true,
|
|
8
9
|
"skipLibCheck": true,
|
|
9
10
|
"resolveJsonModule": true,
|
|
@@ -11,9 +12,12 @@
|
|
|
11
12
|
"paths": {
|
|
12
13
|
"@/*": ["${configDir}/src/*"]
|
|
13
14
|
},
|
|
15
|
+
"types": [],
|
|
14
16
|
|
|
15
17
|
/* Output */
|
|
16
|
-
"target"
|
|
18
|
+
//* "target" is omitted here intentionally, typescript
|
|
19
|
+
//* defaults to current year's ecmascript standard
|
|
20
|
+
|
|
17
21
|
"outDir": "${configDir}/dist",
|
|
18
22
|
"sourceMap": true,
|
|
19
23
|
"declarationMap": true,
|
|
@@ -28,15 +32,19 @@
|
|
|
28
32
|
"strict": true,
|
|
29
33
|
"checkJs": true,
|
|
30
34
|
"erasableSyntaxOnly": true,
|
|
31
|
-
"forceConsistentCasingInFileNames": true,
|
|
32
35
|
"allowSyntheticDefaultImports": true,
|
|
36
|
+
"allowUnreachableCode": false,
|
|
37
|
+
"exactOptionalPropertyTypes": true,
|
|
38
|
+
"forceConsistentCasingInFileNames": true,
|
|
33
39
|
"noFallthroughCasesInSwitch": true,
|
|
34
40
|
"noImplicitAny": true,
|
|
35
41
|
"noImplicitOverride": true,
|
|
36
42
|
"noImplicitReturns": false,
|
|
43
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
44
|
+
"noUncheckedIndexedAccess": true,
|
|
45
|
+
"noUncheckedSideEffectImports": true,
|
|
37
46
|
"noUnusedLocals": true,
|
|
38
|
-
"noUnusedParameters": true
|
|
39
|
-
"noUncheckedIndexedAccess": true
|
|
47
|
+
"noUnusedParameters": true
|
|
40
48
|
},
|
|
41
49
|
"include": ["${configDir}/src/**/*"],
|
|
42
50
|
"exclude": ["${configDir}/node_modules"]
|
package/dist/browser.json
CHANGED
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
"display": "Browser",
|
|
4
4
|
"extends": "./base.json",
|
|
5
5
|
"compilerOptions": {
|
|
6
|
-
"lib": ["
|
|
6
|
+
"lib": ["esnext", "dom"],
|
|
7
7
|
"jsx": "react-jsx",
|
|
8
8
|
"module": "ESNext",
|
|
9
9
|
"moduleResolution": "Bundler",
|
|
10
10
|
"paths": { "*": ["${configDir}/src/*"] },
|
|
11
|
+
"types": [],
|
|
11
12
|
"noEmit": true,
|
|
12
13
|
"sourceMap": true
|
|
13
14
|
}
|
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,8 +3,8 @@
|
|
|
3
3
|
"display": "Next.js",
|
|
4
4
|
"extends": "./base.json",
|
|
5
5
|
"compilerOptions": {
|
|
6
|
-
"
|
|
7
|
-
"lib": ["
|
|
6
|
+
"rootDir": "${configDir}",
|
|
7
|
+
"lib": ["esnext", "dom"],
|
|
8
8
|
"allowJs": true,
|
|
9
9
|
"skipLibCheck": true,
|
|
10
10
|
"strict": true,
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
],
|
|
24
24
|
"paths": {
|
|
25
25
|
"@/*": ["${configDir}/src/*"]
|
|
26
|
-
}
|
|
26
|
+
},
|
|
27
|
+
"types": ["node"]
|
|
27
28
|
},
|
|
28
29
|
"include": [
|
|
29
30
|
"${configDir}/next-env.d.ts",
|
package/dist/node-ts.json
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"extends": "./base.json",
|
|
5
5
|
"compilerOptions": {
|
|
6
6
|
// same options as node template
|
|
7
|
-
"target": "ESNext",
|
|
8
7
|
"moduleResolution": "NodeNext",
|
|
9
8
|
"module": "NodeNext",
|
|
10
9
|
"paths": { "*": ["${configDir}/src/*"] },
|
|
10
|
+
"types": ["node"],
|
|
11
11
|
|
|
12
12
|
// options for typescript-only
|
|
13
13
|
// https://nodejs.org/api/typescript.html#type-stripping
|
package/dist/node.json
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"display": "Node",
|
|
4
4
|
"extends": "./base.json",
|
|
5
5
|
"compilerOptions": {
|
|
6
|
-
"target": "ESNext",
|
|
7
6
|
"moduleResolution": "NodeNext",
|
|
8
7
|
"module": "NodeNext",
|
|
9
|
-
"paths": { "*": ["${configDir}/src/*"] }
|
|
8
|
+
"paths": { "*": ["${configDir}/src/*"] },
|
|
9
|
+
"types": ["node"]
|
|
10
10
|
}
|
|
11
11
|
}
|
package/dist/vite-react/app.json
CHANGED
|
@@ -4,19 +4,16 @@
|
|
|
4
4
|
"extends": "../base.json",
|
|
5
5
|
"compilerOptions": {
|
|
6
6
|
"tsBuildInfoFile": "${configDir}/node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
7
|
-
"target": "ES2022",
|
|
8
7
|
"useDefineForClassFields": true,
|
|
9
|
-
"lib": ["
|
|
8
|
+
"lib": ["esnext", "dom"],
|
|
10
9
|
"module": "ESNext",
|
|
10
|
+
"types": [],
|
|
11
11
|
|
|
12
12
|
/* Bundler mode */
|
|
13
13
|
"moduleResolution": "bundler",
|
|
14
14
|
"allowImportingTsExtensions": true,
|
|
15
15
|
"noEmit": true,
|
|
16
|
-
"jsx": "react-jsx"
|
|
17
|
-
|
|
18
|
-
/* Linting */
|
|
19
|
-
"noUncheckedSideEffectImports": true
|
|
16
|
+
"jsx": "react-jsx"
|
|
20
17
|
},
|
|
21
18
|
"include": ["${configDir}/src"]
|
|
22
19
|
}
|
|
@@ -4,17 +4,14 @@
|
|
|
4
4
|
"extends": "../base.json",
|
|
5
5
|
"compilerOptions": {
|
|
6
6
|
"tsBuildInfoFile": "${configDir}/node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
7
|
-
"
|
|
8
|
-
"lib": ["ES2023"],
|
|
7
|
+
"lib": ["esnext"],
|
|
9
8
|
"module": "ESNext",
|
|
9
|
+
"types": ["node"],
|
|
10
10
|
|
|
11
11
|
/* Bundler mode */
|
|
12
12
|
"moduleResolution": "bundler",
|
|
13
13
|
"allowImportingTsExtensions": true,
|
|
14
|
-
"noEmit": true
|
|
15
|
-
|
|
16
|
-
/* Linting */
|
|
17
|
-
"noUncheckedSideEffectImports": true
|
|
14
|
+
"noEmit": true
|
|
18
15
|
},
|
|
19
16
|
"include": ["${configDir}/vite.config.ts"]
|
|
20
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4mbl/tsconfig",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.c0e445a",
|
|
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",
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
"tsconfig"
|
|
31
32
|
],
|
|
32
33
|
"peerDependencies": {
|
|
33
|
-
"typescript": ">=
|
|
34
|
+
"typescript": ">=6.0.0"
|
|
34
35
|
},
|
|
35
36
|
"peerDependenciesMeta": {
|
|
36
37
|
"typescript": {
|