@sicoti/tsconfig 1.0.1 → 2.0.0
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 +69 -0
- package/LICENSE +21 -21
- package/README.md +38 -23
- package/base.json +11 -10
- package/bun.json +26 -16
- package/nestjs.json +9 -1
- package/nextjs.json +8 -2
- package/node.json +49 -0
- package/package.json +5 -5
- package/react-library.json +12 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [2.0.0](https://github.com/Yuzu02/SICOTI/compare/tsconfig-v1.1.0...tsconfig-v2.0.0) (2026-08-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* **release:** @sicoti/tsconfig now targets TypeScript 6+ and models Node, Bun, Next.js, NestJS, and bundled React runtimes explicitly. TypeScript 5.9 and previous emit semantics are no longer supported.
|
|
9
|
+
* **tsconfig:** @sicoti/tsconfig now targets TypeScript 6+ and models Node, Bun, Next.js, NestJS, and bundled React runtimes explicitly. TypeScript 5.9 and previous emit semantics are no longer supported.
|
|
10
|
+
|
|
11
|
+
### ✨ Features
|
|
12
|
+
|
|
13
|
+
* **ci:** ✨ Add release renaming functionality and update config schema ([9db7ca1](https://github.com/Yuzu02/SICOTI/commit/9db7ca1df27c2a1b4e8fe3b584a8825997e281e4))
|
|
14
|
+
* **monorepo:** :sparkles: Added Moon Worker and Obs internal package ([66c2f56](https://github.com/Yuzu02/SICOTI/commit/66c2f5609a7c9a92b65d933cb10716aeaa99b79f))
|
|
15
|
+
* **monorepo:** :sparkles: merge @sicoti/observability package + LGTM infra ([f617192](https://github.com/Yuzu02/SICOTI/commit/f617192a1f0341cec4f201e7004eed8b27b911d9))
|
|
16
|
+
* **monorepo:** ✨ add per-shell auth policy with MFA enforcement and signup gate ([b699dbb](https://github.com/Yuzu02/SICOTI/commit/b699dbbcea92f66804c2db734c378a09a3e020e0))
|
|
17
|
+
* **monorepo:** ✨ Implement 6 enhancement plans — DDD modularization, strict TS, DTO factory, infra ([a72098f](https://github.com/Yuzu02/SICOTI/commit/a72098f039a99bc46deab0a5bbdbeb8375d661da))
|
|
18
|
+
* **monorepo:** 🚀 Integrate enhancements branch ([952ef90](https://github.com/Yuzu02/SICOTI/commit/952ef906c4a5a8a65c0fd3bdd076d527e0d0299a))
|
|
19
|
+
* **tsconfig:** 🧭 modernize shared TypeScript runtime presets ([37a0473](https://github.com/Yuzu02/SICOTI/commit/37a0473a43fa8fcc2ff3120a775b4f26fd626ecf))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### 🐛 Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **api:** 🐛 Add Redis reconnect strategy for Better Auth secondary storage ([ae7ba14](https://github.com/Yuzu02/SICOTI/commit/ae7ba14ea5e3acd22971ff55b7661cfa0d97100f))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### 🧪 Tests
|
|
28
|
+
|
|
29
|
+
* **monorepo:** 🧪 Set up Vitest, Playwright and Supertest testing infrastructure ([c97fb7f](https://github.com/Yuzu02/SICOTI/commit/c97fb7fcbe1ad7034d490fee4c39c4c657e1fc19))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### 👷 Continuous Integration
|
|
33
|
+
|
|
34
|
+
* **config:** :chart_with_upwards_trend: Enhanced the Release Please Config ([ac138b3](https://github.com/Yuzu02/SICOTI/commit/ac138b318ca0e6db25e5518655a4fae12f6064e9))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### 🔧 Miscellaneous Chores
|
|
38
|
+
|
|
39
|
+
* **deps:** :arrow_up: Upgrade deps and resolve conflicts ([1be80fe](https://github.com/Yuzu02/SICOTI/commit/1be80fe3c05f9bf23c63ec5bb9a37fe7411a77d1))
|
|
40
|
+
* **monorepo:** :arrow_up: Standarize CLAUDE.md to AGENTS.md and complete bdni fichas internal review ([7a1ec0c](https://github.com/Yuzu02/SICOTI/commit/7a1ec0c4afe8be81b6ae72dd386ea9b3c2417663))
|
|
41
|
+
* **monorepo:** :wrench: align shared surfaces and tooling ([b6ee331](https://github.com/Yuzu02/SICOTI/commit/b6ee331ac936dc8e0ac02d99f065687b77e59c81))
|
|
42
|
+
* **monorepo:** ⬆️ modernize toolchain and dependency stack ([5599016](https://github.com/Yuzu02/SICOTI/commit/55990167dfc33f4cd932495004dfef301fcf36a9))
|
|
43
|
+
* **monorepo:** 🧹 align CI contracts and documentation ([c9efe57](https://github.com/Yuzu02/SICOTI/commit/c9efe5762247df9a9d2651d8d1effffba8e8a1b3))
|
|
44
|
+
* **release:** 🔀 reconcile squashed main history ([daf7213](https://github.com/Yuzu02/SICOTI/commit/daf721371a4c45d10e2ab5101b18945f15e9d70e))
|
|
45
|
+
* **release:** weekly merge dev → main (2026-W34) ([0e40fa7](https://github.com/Yuzu02/SICOTI/commit/0e40fa7120a50cbc2ebf6d1349557249e30cbe00))
|
|
46
|
+
|
|
47
|
+
## [1.1.0](https://github.com/Yuzu02/SICOTI/compare/tsconfig-v1.0.1...tsconfig-v1.1.0) (2026-03-20)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### ✨ Features
|
|
51
|
+
|
|
52
|
+
* **monorepo:** :loud_sound: Added LGTM stack for local test ([ee69776](https://github.com/Yuzu02/SICOTI/commit/ee697762d0926b7a95723417b49e2ad64f5ce277))
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### 💄 Styles
|
|
56
|
+
|
|
57
|
+
* **docs:** :art: clean up formatting and remove unnecessary whitespace in documentation files ([6fd7622](https://github.com/Yuzu02/SICOTI/commit/6fd76223f6ebcf41c7cf7be02c3c57fd46e71880))
|
|
58
|
+
* **monorepo:** :art: Complete setup of the tsconfig package ([013f572](https://github.com/Yuzu02/SICOTI/commit/013f572f646ffd14cc3a1387ed5884740b17e636))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### ♻️ Code Refactoring
|
|
62
|
+
|
|
63
|
+
* **monorepo:** :recycle: Upgrade dependencies and introduce Either utility ([#254](https://github.com/Yuzu02/SICOTI/issues/254)) ([d48cf89](https://github.com/Yuzu02/SICOTI/commit/d48cf893b735bbcb151ccd385650e1ed8faaf21f))
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### 🔧 Miscellaneous Chores
|
|
67
|
+
|
|
68
|
+
* **monorepo:** :arrow_up: Update dependencies and improve configuration ([#252](https://github.com/Yuzu02/SICOTI/issues/252)) ([b1cf3ea](https://github.com/Yuzu02/SICOTI/commit/b1cf3ea194ca1dd4368eb8469ee936544bf1799d))
|
|
69
|
+
* **setup:** :wrench: Establish centralized TypeScript configurations ([4295d31](https://github.com/Yuzu02/SICOTI/commit/4295d3134e19684a369169c38f05fe6cf6a96d5d))
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 SICOTI
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 SICOTI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@sicoti/tsconfig)
|
|
4
4
|
[](https://www.npmjs.com/package/@sicoti/tsconfig)
|
|
5
|
-
[](https://www.typescriptlang.org/)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
8
|
> Centralized, shareable TypeScript configuration presets that enforce maximum type safety and best practices for modern JavaScript projects. Built for Next.js, NestJS, React libraries, and Bun with zero configuration.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
- [⚡ Quick Start](#-quick-start)
|
|
16
16
|
- [Next.js Applications](#nextjs-applications)
|
|
17
17
|
- [NestJS Applications](#nestjs-applications)
|
|
18
|
-
- [React Component Libraries](#react-component-libraries)
|
|
18
|
+
- [Bundled React Component Libraries](#bundled-react-component-libraries)
|
|
19
19
|
- [Bun Packages & CLI Tools](#bun-packages--cli-tools)
|
|
20
20
|
- [📋 Available Presets](#-available-presets)
|
|
21
21
|
- [🔒 Strict Type Checking](#-strict-type-checking)
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
## ✨ Features
|
|
37
37
|
|
|
38
38
|
- 🔒 **Maximum Type Safety** — Strict mode plus additional safety checks beyond `strict: true`
|
|
39
|
-
- 📦 **Environment-Specific Presets** — Optimized configs for Next.js, NestJS, React libraries, and Bun
|
|
39
|
+
- 📦 **Environment-Specific Presets** — Optimized configs for Next.js, NestJS, Node/shared libraries, React libraries, and Bun
|
|
40
40
|
- 🎯 **Zero Configuration** — Works out of the box with sensible defaults
|
|
41
41
|
- 🔧 **Fully Extensible** — Easy to override any setting for your specific needs
|
|
42
42
|
- 📚 **Well Documented** — Clear comments explaining every option
|
|
@@ -59,8 +59,8 @@ bun add -D @sicoti/tsconfig typescript
|
|
|
59
59
|
|
|
60
60
|
## 🔍 Requirements
|
|
61
61
|
|
|
62
|
-
- **TypeScript**: `>=
|
|
63
|
-
- **Node.js**: `>=
|
|
62
|
+
- **TypeScript**: `>= 6 < 8` (consumer fixtures are compiled with TypeScript 6 and TypeScript 7)
|
|
63
|
+
- **Node.js**: `>= 24.0.0`
|
|
64
64
|
- **Package Manager**: npm, yarn, pnpm, or bun
|
|
65
65
|
|
|
66
66
|
## ⚡ Quick Start
|
|
@@ -73,7 +73,6 @@ Choose the preset that matches your project type and extend it in your `tsconfig
|
|
|
73
73
|
{
|
|
74
74
|
"extends": "@sicoti/tsconfig/nextjs.json",
|
|
75
75
|
"compilerOptions": {
|
|
76
|
-
"baseUrl": ".",
|
|
77
76
|
"paths": {
|
|
78
77
|
"@/*": ["./src/*"]
|
|
79
78
|
}
|
|
@@ -90,7 +89,6 @@ Choose the preset that matches your project type and extend it in your `tsconfig
|
|
|
90
89
|
"extends": "@sicoti/tsconfig/nestjs.json",
|
|
91
90
|
"compilerOptions": {
|
|
92
91
|
"outDir": "./dist",
|
|
93
|
-
"baseUrl": ".",
|
|
94
92
|
"paths": {
|
|
95
93
|
"@/*": ["./src/*"]
|
|
96
94
|
}
|
|
@@ -100,15 +98,17 @@ Choose the preset that matches your project type and extend it in your `tsconfig
|
|
|
100
98
|
}
|
|
101
99
|
```
|
|
102
100
|
|
|
103
|
-
### React Component Libraries
|
|
101
|
+
### Bundled React Component Libraries
|
|
102
|
+
|
|
103
|
+
`react-library.json` models source that is bundled before publication (for
|
|
104
|
+
example with tsdown, Rolldown, Vite library mode, or an equivalent build tool).
|
|
105
|
+
TypeScript typechecks the source while the bundler owns JavaScript and declaration
|
|
106
|
+
output.
|
|
104
107
|
|
|
105
108
|
```jsonc
|
|
106
109
|
{
|
|
107
110
|
"extends": "@sicoti/tsconfig/react-library.json",
|
|
108
111
|
"compilerOptions": {
|
|
109
|
-
"outDir": "./dist",
|
|
110
|
-
"rootDir": "./src",
|
|
111
|
-
"baseUrl": ".",
|
|
112
112
|
"paths": {
|
|
113
113
|
"@/*": ["./src/*"]
|
|
114
114
|
}
|
|
@@ -124,9 +124,6 @@ Choose the preset that matches your project type and extend it in your `tsconfig
|
|
|
124
124
|
{
|
|
125
125
|
"extends": "@sicoti/tsconfig/bun.json",
|
|
126
126
|
"compilerOptions": {
|
|
127
|
-
"outDir": "./dist",
|
|
128
|
-
"rootDir": "./src",
|
|
129
|
-
"baseUrl": ".",
|
|
130
127
|
"paths": {
|
|
131
128
|
"@/*": ["./src/*"]
|
|
132
129
|
}
|
|
@@ -136,14 +133,28 @@ Choose the preset that matches your project type and extend it in your `tsconfig
|
|
|
136
133
|
}
|
|
137
134
|
```
|
|
138
135
|
|
|
136
|
+
### Node / Shared Libraries
|
|
137
|
+
|
|
138
|
+
`node.json` models direct Node ESM execution with `NodeNext` resolution and
|
|
139
|
+
declaration emit. Relative ESM imports therefore use the runtime extension that
|
|
140
|
+
Node will execute (for example `./value.js` from TypeScript source):
|
|
141
|
+
|
|
142
|
+
```jsonc
|
|
143
|
+
{
|
|
144
|
+
"extends": "@sicoti/tsconfig/node.json",
|
|
145
|
+
"include": ["src/**/*"]
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
139
149
|
## 📋 Available Presets
|
|
140
150
|
|
|
141
151
|
| Preset | Use Case | Key Features |
|
|
142
152
|
| :------- | :--------- | :------------- |
|
|
143
153
|
| `nextjs.json` | Next.js apps (App Router / Pages Router) | `jsx: preserve`, `noEmit`, Next.js plugin |
|
|
144
|
-
| `nestjs.json` | NestJS backend applications |
|
|
145
|
-
| `
|
|
146
|
-
| `
|
|
154
|
+
| `nestjs.json` | NestJS backend applications executed by Node | `NodeNext`, decorator metadata, source maps, DI support |
|
|
155
|
+
| `node.json` | Node ESM packages/libraries that emit declarations | `NodeNext`, Node types, declaration + source-map emit |
|
|
156
|
+
| `react-library.json` | React libraries bundled before publication | `module: Preserve`, bundler resolution, `jsx: react-jsx`, `noEmit` |
|
|
157
|
+
| `bun.json` | Bun-native packages & CLI tools | `module: Preserve`, bundler resolution, `.ts` imports, `noEmit` |
|
|
147
158
|
| `base.json` | ⚠️ Internal foundation (not for direct use) | Universal strict settings |
|
|
148
159
|
|
|
149
160
|
## 🔒 Strict Type Checking
|
|
@@ -173,11 +184,14 @@ All presets inherit from `base.json` which enables maximum type safety:
|
|
|
173
184
|
| `noFallthroughCasesInSwitch` | Error on switch case fall-through |
|
|
174
185
|
| `allowUnreachableCode` | Error on unreachable code |
|
|
175
186
|
| `noUncheckedIndexedAccess` | Add `undefined` to index signature results |
|
|
176
|
-
| `exactOptionalPropertyTypes` | Distinguish between `undefined` and missing |
|
|
177
187
|
| `noPropertyAccessFromIndexSignature` | Require bracket notation for index access |
|
|
178
188
|
| `noImplicitOverride` | Require 'override' keyword for overrides |
|
|
179
189
|
| `noUncheckedSideEffectImports` | Validate side-effect imports exist |
|
|
180
190
|
|
|
191
|
+
`exactOptionalPropertyTypes` is deliberately `false` in the shared baseline for
|
|
192
|
+
the current NestJS/Prisma/React compatibility boundary. This does not relax
|
|
193
|
+
`strict`, `noUncheckedIndexedAccess`, or `noPropertyAccessFromIndexSignature`.
|
|
194
|
+
|
|
181
195
|
## 💡 Why These Checks Matter
|
|
182
196
|
|
|
183
197
|
### `noUncheckedIndexedAccess`
|
|
@@ -301,9 +315,10 @@ function getValue(condition: boolean): string {
|
|
|
301
315
|
```mermaid
|
|
302
316
|
flowchart TD
|
|
303
317
|
base["base.json<br/>Foundation (DO NOT extend directly)<br/>Universal strict settings"] --> nextjs["nextjs.json<br/>Next.js applications<br/>jsx: preserve, noEmit, Next.js plugin"]
|
|
304
|
-
base --> nestjs["nestjs.json<br/>NestJS
|
|
305
|
-
base -->
|
|
306
|
-
base -->
|
|
318
|
+
base --> nestjs["nestjs.json<br/>NestJS on Node<br/>NodeNext, decorators, source maps"]
|
|
319
|
+
base --> node["node.json<br/>Direct Node ESM<br/>NodeNext, declaration emit"]
|
|
320
|
+
base --> bun["bun.json<br/>Bun-native runtime<br/>Preserve, bundler resolution, noEmit"]
|
|
321
|
+
base --> reactlib["react-library.json<br/>Bundled React libraries<br/>Preserve, bundler resolution, noEmit"]
|
|
307
322
|
```
|
|
308
323
|
|
|
309
324
|
### Design Philosophy
|
|
@@ -311,13 +326,14 @@ flowchart TD
|
|
|
311
326
|
**`base.json` includes:**
|
|
312
327
|
|
|
313
328
|
- Universal strict type checking settings
|
|
314
|
-
-
|
|
329
|
+
- Runtime-neutral module hygiene
|
|
315
330
|
- Code quality checks (unused code, control flow)
|
|
316
331
|
- Import safety validations
|
|
317
332
|
|
|
318
333
|
**`base.json` intentionally excludes:**
|
|
319
334
|
|
|
320
335
|
- `lib` (DOM, ESNext) — Varies by runtime environment
|
|
336
|
+
- `target`, `module`, `moduleResolution` — Must model the actual runtime/bundler
|
|
321
337
|
- `jsx` settings — Only for React-based projects
|
|
322
338
|
- `sourceMap`, `declaration` — Build output varies by project
|
|
323
339
|
- `emitDecoratorMetadata` — Only for NestJS/decorator-based DI
|
|
@@ -332,7 +348,6 @@ You can override any setting in your project's `tsconfig.json`:
|
|
|
332
348
|
"compilerOptions": {
|
|
333
349
|
// Override specific settings
|
|
334
350
|
"noUncheckedIndexedAccess": false, // Disable if too strict for your codebase
|
|
335
|
-
"baseUrl": ".",
|
|
336
351
|
"paths": {
|
|
337
352
|
"@/*": ["./src/*"],
|
|
338
353
|
"@components/*": ["./src/components/*"]
|
package/base.json
CHANGED
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
* base.json
|
|
20
20
|
* ├── nextjs.json → Next.js applications
|
|
21
21
|
* ├── nestjs.json → NestJS backend applications
|
|
22
|
-
* ├──
|
|
22
|
+
* ├── node.json → Node.js / shared library packages (declaration emit)
|
|
23
|
+
* ├── bun.json → Bun native runtime (no emit, .ts imports)
|
|
23
24
|
* └── react-library.json → React component libraries
|
|
24
25
|
*
|
|
25
26
|
* Reference: https://www.typescriptlang.org/tsconfig
|
|
@@ -48,6 +49,8 @@
|
|
|
48
49
|
// ─── Unused Code Detection ───────────────────────────────────────────────────
|
|
49
50
|
"noUnusedLocals": true, // Error on unused local variables
|
|
50
51
|
"noUnusedParameters": true, // Error on unused function parameters
|
|
52
|
+
"allowUnusedLabels": false, // Error on unused labels
|
|
53
|
+
|
|
51
54
|
|
|
52
55
|
// ─── Control Flow Analysis ───────────────────────────────────────────────────
|
|
53
56
|
"noImplicitReturns": true, // Error when not all paths return a value
|
|
@@ -56,7 +59,7 @@
|
|
|
56
59
|
|
|
57
60
|
// ─── Index Signature Safety ──────────────────────────────────────────────────
|
|
58
61
|
"noUncheckedIndexedAccess": true, // Add undefined to index signature results
|
|
59
|
-
"exactOptionalPropertyTypes":
|
|
62
|
+
"exactOptionalPropertyTypes": false, // Distinguish between undefined and missing
|
|
60
63
|
"noPropertyAccessFromIndexSignature": true, // Require bracket notation for index access
|
|
61
64
|
|
|
62
65
|
// ─── Class & Override Safety ─────────────────────────────────────────────────
|
|
@@ -65,13 +68,13 @@
|
|
|
65
68
|
// ─── Import Validation ───────────────────────────────────────────────────────
|
|
66
69
|
"noUncheckedSideEffectImports": true, // Validate side-effect imports exist
|
|
67
70
|
|
|
71
|
+
|
|
68
72
|
/* ═══════════════════════════════════════════════════════════════════════════════
|
|
69
|
-
* MODULE
|
|
73
|
+
* MODULE HYGIENE (Runtime-neutral Settings)
|
|
74
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
75
|
+
* target/module/moduleResolution intentionally belong to runtime presets.
|
|
70
76
|
* ═══════════════════════════════════════════════════════════════════════════════ */
|
|
71
|
-
"
|
|
72
|
-
"module": "ESNext", // Use ES modules
|
|
73
|
-
"moduleResolution": "bundler", // Modern bundler resolution (Vite, esbuild, etc.)
|
|
74
|
-
"moduleDetection": "force", // Treat all files as modules
|
|
77
|
+
"moduleDetection": "force", // Treat all files as modules consistently
|
|
75
78
|
|
|
76
79
|
// ─── Module Interoperability ─────────────────────────────────────────────────
|
|
77
80
|
"esModuleInterop": true, // Enable CommonJS/ESM interop
|
|
@@ -82,8 +85,6 @@
|
|
|
82
85
|
/* ═══════════════════════════════════════════════════════════════════════════════
|
|
83
86
|
* CODE QUALITY & CONSISTENCY
|
|
84
87
|
* ═══════════════════════════════════════════════════════════════════════════════ */
|
|
85
|
-
"forceConsistentCasingInFileNames": true
|
|
86
|
-
"allowImportingTsExtensions": false, // Disallow .ts/.tsx extensions in imports
|
|
87
|
-
"verbatimModuleSyntax": false // Allow flexible import/export syntax
|
|
88
|
+
"forceConsistentCasingInFileNames": true // Enforce consistent file name casing
|
|
88
89
|
}
|
|
89
90
|
}
|
package/bun.json
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
-
"display": "Bun
|
|
3
|
+
"display": "Bun Native Configuration",
|
|
4
4
|
"extends": "./base.json",
|
|
5
5
|
|
|
6
6
|
/* ═══════════════════════════════════════════════════════════════════════════════════
|
|
7
|
-
* @sicoti/tsconfig - Bun Preset
|
|
7
|
+
* @sicoti/tsconfig - Bun Native Preset
|
|
8
8
|
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
9
9
|
*
|
|
10
|
-
* Optimized for
|
|
10
|
+
* Optimized for packages that run natively on the Bun runtime (no transpilation).
|
|
11
11
|
*
|
|
12
12
|
* Key characteristics:
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
17
|
-
*
|
|
13
|
+
* - No emit — Bun runs TypeScript directly
|
|
14
|
+
* - allowImportingTsExtensions — import .ts files directly
|
|
15
|
+
* - verbatimModuleSyntax — enforce explicit type-only imports
|
|
16
|
+
* - Bun types for Bun-specific APIs
|
|
17
|
+
*
|
|
18
|
+
* Use this preset for:
|
|
19
|
+
* - CLI tools (packages/cli)
|
|
20
|
+
* - Playground / experimentation (packages/playground)
|
|
21
|
+
* - Any package that runs directly on Bun without bundling
|
|
18
22
|
*
|
|
19
23
|
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
20
24
|
|
|
@@ -22,18 +26,24 @@
|
|
|
22
26
|
/* ─── Runtime Environment ───────────────────────────────────────────────────── */
|
|
23
27
|
"lib": ["ESNext"], // Server-side only, no DOM
|
|
24
28
|
"target": "ESNext", // Bun supports latest ECMAScript
|
|
29
|
+
"types": ["bun"], // Bun-specific global types
|
|
30
|
+
|
|
31
|
+
/* ─── Module Settings ─────────────────────────────────────────────────────── */
|
|
32
|
+
"module": "Preserve", // Let Bun handle module resolution
|
|
33
|
+
"moduleResolution": "bundler", // Bun resolves modules with bundler-like semantics
|
|
34
|
+
"moduleDetection": "force", // Match Bun's recommended TypeScript configuration
|
|
35
|
+
"allowImportingTsExtensions": true, // Import .ts files directly (Bun native)
|
|
36
|
+
"verbatimModuleSyntax": true, // Enforce explicit type-only imports
|
|
25
37
|
|
|
26
38
|
/* ─── Output Settings ───────────────────────────────────────────────────── */
|
|
27
|
-
"noEmit":
|
|
28
|
-
"declaration": true, // Generate .d.ts for consumers
|
|
29
|
-
"declarationMap": true, // Source maps for declarations
|
|
39
|
+
"noEmit": true, // Bun runs TypeScript directly, no transpilation needed
|
|
30
40
|
"skipLibCheck": true, // Skip .d.ts checking for performance
|
|
31
|
-
"incremental": true, // Faster rebuilds
|
|
32
|
-
"tsBuildInfoFile": "./.cache/tsconfig.tsbuildinfo", // Keep build artifacts out of root
|
|
33
41
|
|
|
34
|
-
/* ─── Relaxed Checks for
|
|
35
|
-
// Libraries may export utilities that appear unused locally
|
|
42
|
+
/* ─── Relaxed Checks for Development ──────────────────────────────────── */
|
|
36
43
|
"noUnusedLocals": false,
|
|
37
|
-
"noUnusedParameters": false
|
|
44
|
+
"noUnusedParameters": false,
|
|
45
|
+
// Bun's SpawnOptions and other internal types use optional properties
|
|
46
|
+
// that conflict with exactOptionalPropertyTypes
|
|
47
|
+
"exactOptionalPropertyTypes": false
|
|
38
48
|
}
|
|
39
49
|
}
|
package/nestjs.json
CHANGED
|
@@ -22,6 +22,12 @@
|
|
|
22
22
|
/* ─── Runtime Environment ───────────────────────────────────────────────────── */
|
|
23
23
|
"lib": ["ESNext"], // Server-side only, no DOM
|
|
24
24
|
"target": "ESNext", // Modern Node.js supports latest features
|
|
25
|
+
"types": ["node"], // NestJS applications execute on Node by default
|
|
26
|
+
|
|
27
|
+
/* ─── Node Module Host ──────────────────────────────────────────────────────── */
|
|
28
|
+
"module": "NodeNext", // Model direct Node ESM execution by default
|
|
29
|
+
"moduleResolution": "NodeNext", // Keep TypeScript resolution aligned with Node
|
|
30
|
+
"verbatimModuleSyntax": false, // Preserve Nest decorator/import interoperability
|
|
25
31
|
|
|
26
32
|
/* ─── NestJS Decorator Support ──────────────────────────────────────────────── */
|
|
27
33
|
"emitDecoratorMetadata": true, // Required for NestJS dependency injection
|
|
@@ -42,6 +48,8 @@
|
|
|
42
48
|
/* ─── Relaxed Checks for NestJS Patterns ────────────────────────────── */
|
|
43
49
|
// NestJS decorators and DI patterns require these relaxations
|
|
44
50
|
"strictBindCallApply": false,
|
|
45
|
-
|
|
51
|
+
// NestJS and its ecosystem libraries (Prisma, Better Auth) don't handle
|
|
52
|
+
// exact optional properties well in DTOs, config objects, and decorators
|
|
53
|
+
"exactOptionalPropertyTypes": false
|
|
46
54
|
}
|
|
47
55
|
}
|
package/nextjs.json
CHANGED
|
@@ -23,6 +23,11 @@
|
|
|
23
23
|
"lib": ["DOM", "DOM.Iterable", "ESNext"], // Browser APIs + Modern JavaScript
|
|
24
24
|
"target": "ES2017", // Compatibility target for older browsers
|
|
25
25
|
|
|
26
|
+
/* ─── Framework Module Host ────────────────────────────────────────────────── */
|
|
27
|
+
"module": "ESNext", // Next.js owns ESM transformation
|
|
28
|
+
"moduleResolution": "bundler", // Turbopack/SWC resolve bundler-style imports
|
|
29
|
+
"moduleDetection": "force", // Treat every source file as a module
|
|
30
|
+
|
|
26
31
|
/* ─── JSX Handling ──────────────────────────────────────────────────────────── */
|
|
27
32
|
"jsx": "preserve", // Let Next.js/SWC handle JSX transformation
|
|
28
33
|
"allowJs": true, // Allow JavaScript files in the project
|
|
@@ -41,7 +46,8 @@
|
|
|
41
46
|
],
|
|
42
47
|
|
|
43
48
|
/* ─── Relaxed Checks for Next.js Patterns ────────────────────────────── */
|
|
44
|
-
//
|
|
45
|
-
|
|
49
|
+
// Next.js internal types and third-party React libraries don't handle
|
|
50
|
+
// exact optional properties well (e.g., component props with optional fields)
|
|
51
|
+
"exactOptionalPropertyTypes": false
|
|
46
52
|
}
|
|
47
53
|
}
|
package/node.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
+
"display": "Node.js / Library Configuration",
|
|
4
|
+
"extends": "./base.json",
|
|
5
|
+
|
|
6
|
+
/* ═══════════════════════════════════════════════════════════════════════════════════
|
|
7
|
+
* @sicoti/tsconfig - Node.js / Library Preset
|
|
8
|
+
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
9
|
+
*
|
|
10
|
+
* Optimized for Node.js ESM packages and libraries that execute directly under Node.
|
|
11
|
+
*
|
|
12
|
+
* Key characteristics:
|
|
13
|
+
* - Server-side only (no DOM libs)
|
|
14
|
+
* - Declaration files for library consumers
|
|
15
|
+
* - Incremental builds for faster development
|
|
16
|
+
* - Relaxed unused checks for library exports
|
|
17
|
+
*
|
|
18
|
+
* Use this preset for:
|
|
19
|
+
* - Shared packages (packages/shared)
|
|
20
|
+
* - Root tsconfig (editor support)
|
|
21
|
+
* - Any package that emits .d.ts files
|
|
22
|
+
*
|
|
23
|
+
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
24
|
+
|
|
25
|
+
"compilerOptions": {
|
|
26
|
+
/* ─── Runtime Environment ───────────────────────────────────────────────────── */
|
|
27
|
+
"lib": ["ESNext"], // Server-side only, no DOM
|
|
28
|
+
"target": "ESNext", // Modern runtime supports latest ECMAScript
|
|
29
|
+
"types": ["node"], // Node globals and built-in modules
|
|
30
|
+
|
|
31
|
+
/* ─── Node Module Host ──────────────────────────────────────────────────────── */
|
|
32
|
+
"module": "NodeNext", // Match the module format selected by Node/package.json
|
|
33
|
+
"moduleResolution": "NodeNext", // Reject imports that Node itself cannot resolve
|
|
34
|
+
|
|
35
|
+
/* ─── Output Settings ───────────────────────────────────────────────────── */
|
|
36
|
+
"noEmit": false, // Emit compiled output
|
|
37
|
+
"declaration": true, // Generate .d.ts for consumers
|
|
38
|
+
"declarationMap": true, // Source maps for declarations
|
|
39
|
+
"sourceMap": true, // Source maps for emitted JavaScript
|
|
40
|
+
"skipLibCheck": true, // Skip .d.ts checking for performance
|
|
41
|
+
"incremental": true, // Faster rebuilds
|
|
42
|
+
"tsBuildInfoFile": "./.cache/tsconfig.tsbuildinfo", // Keep build artifacts out of root
|
|
43
|
+
|
|
44
|
+
/* ─── Relaxed Checks for Library Development ─────────────────────────── */
|
|
45
|
+
// Libraries may export utilities that appear unused locally
|
|
46
|
+
"noUnusedLocals": false,
|
|
47
|
+
"noUnusedParameters": false
|
|
48
|
+
}
|
|
49
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.schemastore.org/package.json",
|
|
3
3
|
"name": "@sicoti/tsconfig",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"description": "Centralized, shareable TypeScript configuration presets for monorepos and multi-project setups — provides consistent, battle-tested tsconfig bases (Base, Next.js, React libraries, Bun, NestJS) to reduce duplication, enforce best practices, and simplify upgrades.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": "SICOTI Team <dev@sicoti.org>",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"bun": ">=1.3.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"typescript": ">=
|
|
29
|
+
"typescript": ">=6 <8"
|
|
30
30
|
},
|
|
31
31
|
"keywords": [
|
|
32
32
|
"typescript",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"nextjs.json",
|
|
42
42
|
"react-library.json",
|
|
43
43
|
"bun.json",
|
|
44
|
+
"node.json",
|
|
44
45
|
"nestjs.json",
|
|
45
46
|
"CHANGELOG.md",
|
|
46
47
|
"README.md",
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
"./nextjs.json": "./nextjs.json",
|
|
52
53
|
"./react-library.json": "./react-library.json",
|
|
53
54
|
"./bun.json": "./bun.json",
|
|
55
|
+
"./node.json": "./node.json",
|
|
54
56
|
"./nestjs.json": "./nestjs.json"
|
|
55
57
|
},
|
|
56
58
|
"publishConfig": {
|
|
@@ -58,8 +60,6 @@
|
|
|
58
60
|
},
|
|
59
61
|
"scripts": {
|
|
60
62
|
"pack": "bun pm pack",
|
|
61
|
-
"publish:dry": "bun publish --dry-run"
|
|
62
|
-
"publish": "bun publish --access public",
|
|
63
|
-
"release": "bun run pack && bun publish --access public"
|
|
63
|
+
"publish:dry": "bun publish --dry-run"
|
|
64
64
|
}
|
|
65
65
|
}
|
package/react-library.json
CHANGED
|
@@ -7,12 +7,13 @@
|
|
|
7
7
|
* @sicoti/tsconfig - React Library Preset
|
|
8
8
|
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
9
9
|
*
|
|
10
|
-
* Optimized for React component libraries
|
|
10
|
+
* Optimized for React component libraries bundled before publication.
|
|
11
11
|
*
|
|
12
12
|
* Key characteristics:
|
|
13
13
|
* - Browser APIs (DOM libs) for component development
|
|
14
14
|
* - React 17+ JSX runtime (automatic import)
|
|
15
|
-
* -
|
|
15
|
+
* - Bundler-native module resolution for source code
|
|
16
|
+
* - No tsc emit; the library build tool owns JavaScript/declaration output
|
|
16
17
|
* - Relaxed unused checks for flexible component exports
|
|
17
18
|
*
|
|
18
19
|
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
@@ -22,13 +23,16 @@
|
|
|
22
23
|
"lib": ["DOM", "DOM.Iterable", "ESNext"], // Browser APIs + Modern JavaScript
|
|
23
24
|
"target": "ESNext", // Modern bundlers handle transpilation
|
|
24
25
|
|
|
26
|
+
/* ─── Bundled Library Module Host ──────────────────────────────────────────── */
|
|
27
|
+
"module": "Preserve", // Preserve source module syntax for the library bundler
|
|
28
|
+
"moduleResolution": "bundler", // Model the bundler that creates the published artifact
|
|
29
|
+
"moduleDetection": "force",
|
|
30
|
+
|
|
25
31
|
/* ─── JSX Handling ──────────────────────────────────────────────────────────── */
|
|
26
32
|
"jsx": "react-jsx", // New React 17+ JSX transform
|
|
27
33
|
|
|
28
34
|
/* ─── Output Settings ───────────────────────────────────────────────────── */
|
|
29
|
-
"noEmit":
|
|
30
|
-
"declaration": true, // Generate .d.ts for consumers
|
|
31
|
-
"declarationMap": true, // Source maps for declarations
|
|
35
|
+
"noEmit": true, // tsdown/another build tool owns JS and declaration generation
|
|
32
36
|
"skipLibCheck": true, // Skip .d.ts checking for performance
|
|
33
37
|
"incremental": true, // Faster rebuilds
|
|
34
38
|
"tsBuildInfoFile": "./.cache/tsconfig.tsbuildinfo", // Keep build artifacts out of root
|
|
@@ -37,6 +41,8 @@
|
|
|
37
41
|
// Libraries may export components that appear unused locally
|
|
38
42
|
"noUnusedLocals": false,
|
|
39
43
|
"noUnusedParameters": false,
|
|
40
|
-
|
|
44
|
+
// React component props with optional fields and third-party UI libraries
|
|
45
|
+
// don't handle exact optional properties well
|
|
46
|
+
"exactOptionalPropertyTypes": false
|
|
41
47
|
}
|
|
42
48
|
}
|