@sicoti/tsconfig 1.0.0 → 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 +381 -331
- package/base.json +90 -89
- package/bun.json +49 -39
- package/nestjs.json +55 -47
- package/nextjs.json +53 -47
- package/node.json +49 -0
- package/package.json +6 -6
- package/react-library.json +48 -42
package/base.json
CHANGED
|
@@ -1,89 +1,90 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
-
"display": "Base Configuration",
|
|
4
|
-
|
|
5
|
-
/* ═══════════════════════════════════════════════════════════════════════════════════
|
|
6
|
-
* @sicoti/tsconfig - Base Configuration
|
|
7
|
-
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
8
|
-
*
|
|
9
|
-
* Foundation configuration that ALL other presets extend.
|
|
10
|
-
* Contains ONLY universal settings applicable to every TypeScript project.
|
|
11
|
-
*
|
|
12
|
-
* ⚠️ INTENTIONALLY EXCLUDED (delegated to environment-specific configs):
|
|
13
|
-
* - Source maps, declarations, emit settings → Build-target specific
|
|
14
|
-
* - skipLibCheck → Performance optimization per environment
|
|
15
|
-
* - lib targets (DOM, ESNext) → Varies by runtime (browser vs server)
|
|
16
|
-
* - JSX settings → Only for React-based projects
|
|
17
|
-
*
|
|
18
|
-
* Available Presets:
|
|
19
|
-
* base.json
|
|
20
|
-
* ├── nextjs.json → Next.js applications
|
|
21
|
-
* ├── nestjs.json → NestJS backend applications
|
|
22
|
-
* ├──
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* →
|
|
35
|
-
* →
|
|
36
|
-
* →
|
|
37
|
-
* →
|
|
38
|
-
* →
|
|
39
|
-
* →
|
|
40
|
-
* →
|
|
41
|
-
*
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
//
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
//
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
// ───
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
+
"display": "Base Configuration",
|
|
4
|
+
|
|
5
|
+
/* ═══════════════════════════════════════════════════════════════════════════════════
|
|
6
|
+
* @sicoti/tsconfig - Base Configuration
|
|
7
|
+
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
8
|
+
*
|
|
9
|
+
* Foundation configuration that ALL other presets extend.
|
|
10
|
+
* Contains ONLY universal settings applicable to every TypeScript project.
|
|
11
|
+
*
|
|
12
|
+
* ⚠️ INTENTIONALLY EXCLUDED (delegated to environment-specific configs):
|
|
13
|
+
* - Source maps, declarations, emit settings → Build-target specific
|
|
14
|
+
* - skipLibCheck → Performance optimization per environment
|
|
15
|
+
* - lib targets (DOM, ESNext) → Varies by runtime (browser vs server)
|
|
16
|
+
* - JSX settings → Only for React-based projects
|
|
17
|
+
*
|
|
18
|
+
* Available Presets:
|
|
19
|
+
* base.json
|
|
20
|
+
* ├── nextjs.json → Next.js applications
|
|
21
|
+
* ├── nestjs.json → NestJS backend applications
|
|
22
|
+
* ├── node.json → Node.js / shared library packages (declaration emit)
|
|
23
|
+
* ├── bun.json → Bun native runtime (no emit, .ts imports)
|
|
24
|
+
* └── react-library.json → React component libraries
|
|
25
|
+
*
|
|
26
|
+
* Reference: https://www.typescriptlang.org/tsconfig
|
|
27
|
+
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
28
|
+
|
|
29
|
+
"compilerOptions": {
|
|
30
|
+
/* ═══════════════════════════════════════════════════════════════════════════════
|
|
31
|
+
* STRICT TYPE CHECKING
|
|
32
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
33
|
+
* "strict: true" enables these 8 fundamental rules:
|
|
34
|
+
* → strictNullChecks: Check null/undefined assignments
|
|
35
|
+
* → strictFunctionTypes: Strict function type checking
|
|
36
|
+
* → strictBindCallApply: Type checking for bind/call/apply
|
|
37
|
+
* → strictPropertyInitialization: Ensure class properties are initialized
|
|
38
|
+
* → noImplicitThis: Error on implicit 'this' types
|
|
39
|
+
* → noImplicitAny: Error on implicit 'any' types
|
|
40
|
+
* → alwaysStrict: Emit "use strict" in all files
|
|
41
|
+
* → useUnknownInCatchVariables: Use 'unknown' instead of 'any' in catch
|
|
42
|
+
* ═══════════════════════════════════════════════════════════════════════════════ */
|
|
43
|
+
"strict": true,
|
|
44
|
+
|
|
45
|
+
/* ═══════════════════════════════════════════════════════════════════════════════
|
|
46
|
+
* ADDITIONAL TYPE SAFETY (Not included in strict: true)
|
|
47
|
+
* ═══════════════════════════════════════════════════════════════════════════════ */
|
|
48
|
+
|
|
49
|
+
// ─── Unused Code Detection ───────────────────────────────────────────────────
|
|
50
|
+
"noUnusedLocals": true, // Error on unused local variables
|
|
51
|
+
"noUnusedParameters": true, // Error on unused function parameters
|
|
52
|
+
"allowUnusedLabels": false, // Error on unused labels
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
// ─── Control Flow Analysis ───────────────────────────────────────────────────
|
|
56
|
+
"noImplicitReturns": true, // Error when not all paths return a value
|
|
57
|
+
"noFallthroughCasesInSwitch": true, // Error on switch case fall-through
|
|
58
|
+
"allowUnreachableCode": false, // Error on unreachable code
|
|
59
|
+
|
|
60
|
+
// ─── Index Signature Safety ──────────────────────────────────────────────────
|
|
61
|
+
"noUncheckedIndexedAccess": true, // Add undefined to index signature results
|
|
62
|
+
"exactOptionalPropertyTypes": false, // Distinguish between undefined and missing
|
|
63
|
+
"noPropertyAccessFromIndexSignature": true, // Require bracket notation for index access
|
|
64
|
+
|
|
65
|
+
// ─── Class & Override Safety ─────────────────────────────────────────────────
|
|
66
|
+
"noImplicitOverride": true, // Require 'override' keyword for overrides
|
|
67
|
+
|
|
68
|
+
// ─── Import Validation ───────────────────────────────────────────────────────
|
|
69
|
+
"noUncheckedSideEffectImports": true, // Validate side-effect imports exist
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
/* ═══════════════════════════════════════════════════════════════════════════════
|
|
73
|
+
* MODULE HYGIENE (Runtime-neutral Settings)
|
|
74
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
75
|
+
* target/module/moduleResolution intentionally belong to runtime presets.
|
|
76
|
+
* ═══════════════════════════════════════════════════════════════════════════════ */
|
|
77
|
+
"moduleDetection": "force", // Treat all files as modules consistently
|
|
78
|
+
|
|
79
|
+
// ─── Module Interoperability ─────────────────────────────────────────────────
|
|
80
|
+
"esModuleInterop": true, // Enable CommonJS/ESM interop
|
|
81
|
+
"allowSyntheticDefaultImports": true, // Allow default imports from CJS modules
|
|
82
|
+
"resolveJsonModule": true, // Allow importing JSON files
|
|
83
|
+
"isolatedModules": true, // Ensure safe transpilation by tools
|
|
84
|
+
|
|
85
|
+
/* ═══════════════════════════════════════════════════════════════════════════════
|
|
86
|
+
* CODE QUALITY & CONSISTENCY
|
|
87
|
+
* ═══════════════════════════════════════════════════════════════════════════════ */
|
|
88
|
+
"forceConsistentCasingInFileNames": true // Enforce consistent file name casing
|
|
89
|
+
}
|
|
90
|
+
}
|
package/bun.json
CHANGED
|
@@ -1,39 +1,49 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
-
"display": "Bun
|
|
4
|
-
"extends": "./base.json",
|
|
5
|
-
|
|
6
|
-
/* ═══════════════════════════════════════════════════════════════════════════════════
|
|
7
|
-
* @sicoti/tsconfig - Bun Preset
|
|
8
|
-
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
9
|
-
*
|
|
10
|
-
* Optimized for
|
|
11
|
-
*
|
|
12
|
-
* Key characteristics:
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/* ───
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
+
"display": "Bun Native Configuration",
|
|
4
|
+
"extends": "./base.json",
|
|
5
|
+
|
|
6
|
+
/* ═══════════════════════════════════════════════════════════════════════════════════
|
|
7
|
+
* @sicoti/tsconfig - Bun Native Preset
|
|
8
|
+
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
9
|
+
*
|
|
10
|
+
* Optimized for packages that run natively on the Bun runtime (no transpilation).
|
|
11
|
+
*
|
|
12
|
+
* Key characteristics:
|
|
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
|
|
22
|
+
*
|
|
23
|
+
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
24
|
+
|
|
25
|
+
"compilerOptions": {
|
|
26
|
+
/* ─── Runtime Environment ───────────────────────────────────────────────────── */
|
|
27
|
+
"lib": ["ESNext"], // Server-side only, no DOM
|
|
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
|
|
37
|
+
|
|
38
|
+
/* ─── Output Settings ───────────────────────────────────────────────────── */
|
|
39
|
+
"noEmit": true, // Bun runs TypeScript directly, no transpilation needed
|
|
40
|
+
"skipLibCheck": true, // Skip .d.ts checking for performance
|
|
41
|
+
|
|
42
|
+
/* ─── Relaxed Checks for Development ──────────────────────────────────── */
|
|
43
|
+
"noUnusedLocals": false,
|
|
44
|
+
"noUnusedParameters": false,
|
|
45
|
+
// Bun's SpawnOptions and other internal types use optional properties
|
|
46
|
+
// that conflict with exactOptionalPropertyTypes
|
|
47
|
+
"exactOptionalPropertyTypes": false
|
|
48
|
+
}
|
|
49
|
+
}
|
package/nestjs.json
CHANGED
|
@@ -1,47 +1,55 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
-
"display": "NestJS Configuration",
|
|
4
|
-
"extends": "./base.json",
|
|
5
|
-
|
|
6
|
-
/* ═══════════════════════════════════════════════════════════════════════════════════
|
|
7
|
-
* @sicoti/tsconfig - NestJS Preset
|
|
8
|
-
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
9
|
-
*
|
|
10
|
-
* Optimized for NestJS applications with decorator-based dependency injection.
|
|
11
|
-
*
|
|
12
|
-
* Key characteristics:
|
|
13
|
-
* - Server-side only (no DOM libs)
|
|
14
|
-
* - Decorator metadata emission for DI container
|
|
15
|
-
* - Source maps for debugging in production
|
|
16
|
-
* - Compiled output with incremental builds
|
|
17
|
-
* - Relaxed settings for NestJS-specific patterns
|
|
18
|
-
*
|
|
19
|
-
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
20
|
-
|
|
21
|
-
"compilerOptions": {
|
|
22
|
-
/* ─── Runtime Environment ───────────────────────────────────────────────────── */
|
|
23
|
-
"lib": ["ESNext"], // Server-side only, no DOM
|
|
24
|
-
"target": "ESNext", // Modern Node.js supports latest features
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
+
"display": "NestJS Configuration",
|
|
4
|
+
"extends": "./base.json",
|
|
5
|
+
|
|
6
|
+
/* ═══════════════════════════════════════════════════════════════════════════════════
|
|
7
|
+
* @sicoti/tsconfig - NestJS Preset
|
|
8
|
+
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
9
|
+
*
|
|
10
|
+
* Optimized for NestJS applications with decorator-based dependency injection.
|
|
11
|
+
*
|
|
12
|
+
* Key characteristics:
|
|
13
|
+
* - Server-side only (no DOM libs)
|
|
14
|
+
* - Decorator metadata emission for DI container
|
|
15
|
+
* - Source maps for debugging in production
|
|
16
|
+
* - Compiled output with incremental builds
|
|
17
|
+
* - Relaxed settings for NestJS-specific patterns
|
|
18
|
+
*
|
|
19
|
+
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
20
|
+
|
|
21
|
+
"compilerOptions": {
|
|
22
|
+
/* ─── Runtime Environment ───────────────────────────────────────────────────── */
|
|
23
|
+
"lib": ["ESNext"], // Server-side only, no DOM
|
|
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
|
|
31
|
+
|
|
32
|
+
/* ─── NestJS Decorator Support ──────────────────────────────────────────────── */
|
|
33
|
+
"emitDecoratorMetadata": true, // Required for NestJS dependency injection
|
|
34
|
+
"experimentalDecorators": true, // Enable decorator syntax
|
|
35
|
+
|
|
36
|
+
/* ─── Output Settings ───────────────────────────────────────────────────── */
|
|
37
|
+
"noEmit": false, // Emit compiled JavaScript
|
|
38
|
+
"declaration": false, // No .d.ts files needed for apps
|
|
39
|
+
"removeComments": true, // Smaller output bundles
|
|
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
|
+
/* ─── Source Maps for Debugging ─────────────────────────────────────────────── */
|
|
45
|
+
"sourceMap": true, // Enable source maps
|
|
46
|
+
"inlineSources": true, // Include sources in source maps
|
|
47
|
+
|
|
48
|
+
/* ─── Relaxed Checks for NestJS Patterns ────────────────────────────── */
|
|
49
|
+
// NestJS decorators and DI patterns require these relaxations
|
|
50
|
+
"strictBindCallApply": false,
|
|
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
|
|
54
|
+
}
|
|
55
|
+
}
|
package/nextjs.json
CHANGED
|
@@ -1,47 +1,53 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
-
"display": "Next.js Configuration",
|
|
4
|
-
"extends": "./base.json",
|
|
5
|
-
|
|
6
|
-
/* ═══════════════════════════════════════════════════════════════════════════════════
|
|
7
|
-
* @sicoti/tsconfig - Next.js Preset
|
|
8
|
-
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
9
|
-
*
|
|
10
|
-
* Optimized for Next.js applications (App Router & Pages Router).
|
|
11
|
-
*
|
|
12
|
-
* Key characteristics:
|
|
13
|
-
* - Browser + Server rendering (DOM + ESNext libs)
|
|
14
|
-
* - JSX preserved for Next.js compiler (SWC/Turbopack)
|
|
15
|
-
* - No emit (Next.js handles all compilation)
|
|
16
|
-
* - Next.js language service plugin for enhanced DX
|
|
17
|
-
* - Incremental type checking for faster builds
|
|
18
|
-
*
|
|
19
|
-
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
20
|
-
|
|
21
|
-
"compilerOptions": {
|
|
22
|
-
/* ─── Runtime Environment ───────────────────────────────────────────────────── */
|
|
23
|
-
"lib": ["DOM", "DOM.Iterable", "ESNext"], // Browser APIs + Modern JavaScript
|
|
24
|
-
"target": "ES2017", // Compatibility target for older browsers
|
|
25
|
-
|
|
26
|
-
/* ───
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
+
"display": "Next.js Configuration",
|
|
4
|
+
"extends": "./base.json",
|
|
5
|
+
|
|
6
|
+
/* ═══════════════════════════════════════════════════════════════════════════════════
|
|
7
|
+
* @sicoti/tsconfig - Next.js Preset
|
|
8
|
+
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
9
|
+
*
|
|
10
|
+
* Optimized for Next.js applications (App Router & Pages Router).
|
|
11
|
+
*
|
|
12
|
+
* Key characteristics:
|
|
13
|
+
* - Browser + Server rendering (DOM + ESNext libs)
|
|
14
|
+
* - JSX preserved for Next.js compiler (SWC/Turbopack)
|
|
15
|
+
* - No emit (Next.js handles all compilation)
|
|
16
|
+
* - Next.js language service plugin for enhanced DX
|
|
17
|
+
* - Incremental type checking for faster builds
|
|
18
|
+
*
|
|
19
|
+
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
20
|
+
|
|
21
|
+
"compilerOptions": {
|
|
22
|
+
/* ─── Runtime Environment ───────────────────────────────────────────────────── */
|
|
23
|
+
"lib": ["DOM", "DOM.Iterable", "ESNext"], // Browser APIs + Modern JavaScript
|
|
24
|
+
"target": "ES2017", // Compatibility target for older browsers
|
|
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
|
+
|
|
31
|
+
/* ─── JSX Handling ──────────────────────────────────────────────────────────── */
|
|
32
|
+
"jsx": "preserve", // Let Next.js/SWC handle JSX transformation
|
|
33
|
+
"allowJs": true, // Allow JavaScript files in the project
|
|
34
|
+
|
|
35
|
+
/* ─── Output Settings ───────────────────────────────────────────────────── */
|
|
36
|
+
"noEmit": true, // Next.js handles all compilation
|
|
37
|
+
"skipLibCheck": true, // Skip .d.ts checking for performance
|
|
38
|
+
"incremental": true, // Enable incremental type checking
|
|
39
|
+
"tsBuildInfoFile": "./.cache/tsconfig.tsbuildinfo", // Keep build artifacts out of root
|
|
40
|
+
|
|
41
|
+
/* ─── Next.js Plugin ────────────────────────────────────────────────────────── */
|
|
42
|
+
"plugins": [
|
|
43
|
+
{
|
|
44
|
+
"name": "next" // Enhanced autocomplete & type checking
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
/* ─── Relaxed Checks for Next.js Patterns ────────────────────────────── */
|
|
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
|
|
52
|
+
}
|
|
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>",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"email": "dev@sicoti.org"
|
|
23
23
|
},
|
|
24
24
|
"engines": {
|
|
25
|
-
"node": ">=
|
|
25
|
+
"node": ">=24.0.0",
|
|
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
|
}
|