@sicoti/tsconfig 1.0.0 → 1.0.1
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 +366 -331
- package/base.json +89 -89
- package/bun.json +39 -39
- package/nestjs.json +47 -47
- package/nextjs.json +47 -47
- package/package.json +2 -2
- package/react-library.json +42 -42
package/base.json
CHANGED
|
@@ -1,89 +1,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
|
-
* ├── bun.json → Bun runtime packages & CLI tools
|
|
23
|
-
* └── react-library.json → React component libraries
|
|
24
|
-
*
|
|
25
|
-
* Reference: https://www.typescriptlang.org/tsconfig
|
|
26
|
-
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
27
|
-
|
|
28
|
-
"compilerOptions": {
|
|
29
|
-
/* ═══════════════════════════════════════════════════════════════════════════════
|
|
30
|
-
* STRICT TYPE CHECKING
|
|
31
|
-
* ═══════════════════════════════════════════════════════════════════════════════
|
|
32
|
-
* "strict: true" enables these 8 fundamental rules:
|
|
33
|
-
* → strictNullChecks: Check null/undefined assignments
|
|
34
|
-
* → strictFunctionTypes: Strict function type checking
|
|
35
|
-
* → strictBindCallApply: Type checking for bind/call/apply
|
|
36
|
-
* → strictPropertyInitialization: Ensure class properties are initialized
|
|
37
|
-
* → noImplicitThis: Error on implicit 'this' types
|
|
38
|
-
* → noImplicitAny: Error on implicit 'any' types
|
|
39
|
-
* → alwaysStrict: Emit "use strict" in all files
|
|
40
|
-
* → useUnknownInCatchVariables: Use 'unknown' instead of 'any' in catch
|
|
41
|
-
* ═══════════════════════════════════════════════════════════════════════════════ */
|
|
42
|
-
"strict": true,
|
|
43
|
-
|
|
44
|
-
/* ═══════════════════════════════════════════════════════════════════════════════
|
|
45
|
-
* ADDITIONAL TYPE SAFETY (Not included in strict: true)
|
|
46
|
-
* ═══════════════════════════════════════════════════════════════════════════════ */
|
|
47
|
-
|
|
48
|
-
// ─── Unused Code Detection ───────────────────────────────────────────────────
|
|
49
|
-
"noUnusedLocals": true, // Error on unused local variables
|
|
50
|
-
"noUnusedParameters": true, // Error on unused function parameters
|
|
51
|
-
|
|
52
|
-
// ─── Control Flow Analysis ───────────────────────────────────────────────────
|
|
53
|
-
"noImplicitReturns": true, // Error when not all paths return a value
|
|
54
|
-
"noFallthroughCasesInSwitch": true, // Error on switch case fall-through
|
|
55
|
-
"allowUnreachableCode": false, // Error on unreachable code
|
|
56
|
-
|
|
57
|
-
// ─── Index Signature Safety ──────────────────────────────────────────────────
|
|
58
|
-
"noUncheckedIndexedAccess": true, // Add undefined to index signature results
|
|
59
|
-
"exactOptionalPropertyTypes": true, // Distinguish between undefined and missing
|
|
60
|
-
"noPropertyAccessFromIndexSignature": true, // Require bracket notation for index access
|
|
61
|
-
|
|
62
|
-
// ─── Class & Override Safety ─────────────────────────────────────────────────
|
|
63
|
-
"noImplicitOverride": true, // Require 'override' keyword for overrides
|
|
64
|
-
|
|
65
|
-
// ─── Import Validation ───────────────────────────────────────────────────────
|
|
66
|
-
"noUncheckedSideEffectImports": true, // Validate side-effect imports exist
|
|
67
|
-
|
|
68
|
-
/* ═══════════════════════════════════════════════════════════════════════════════
|
|
69
|
-
* MODULE SYSTEM (Universal Settings)
|
|
70
|
-
* ═══════════════════════════════════════════════════════════════════════════════ */
|
|
71
|
-
"target": "ESNext", // Emit modern JavaScript
|
|
72
|
-
"module": "ESNext", // Use ES modules
|
|
73
|
-
"moduleResolution": "bundler", // Modern bundler resolution (Vite, esbuild, etc.)
|
|
74
|
-
"moduleDetection": "force", // Treat all files as modules
|
|
75
|
-
|
|
76
|
-
// ─── Module Interoperability ─────────────────────────────────────────────────
|
|
77
|
-
"esModuleInterop": true, // Enable CommonJS/ESM interop
|
|
78
|
-
"allowSyntheticDefaultImports": true, // Allow default imports from CJS modules
|
|
79
|
-
"resolveJsonModule": true, // Allow importing JSON files
|
|
80
|
-
"isolatedModules": true, // Ensure safe transpilation by tools
|
|
81
|
-
|
|
82
|
-
/* ═══════════════════════════════════════════════════════════════════════════════
|
|
83
|
-
* CODE QUALITY & CONSISTENCY
|
|
84
|
-
* ═══════════════════════════════════════════════════════════════════════════════ */
|
|
85
|
-
"forceConsistentCasingInFileNames": true, // Enforce consistent file name casing
|
|
86
|
-
"allowImportingTsExtensions": false, // Disallow .ts/.tsx extensions in imports
|
|
87
|
-
"verbatimModuleSyntax": false // Allow flexible import/export syntax
|
|
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
|
+
* ├── bun.json → Bun runtime packages & CLI tools
|
|
23
|
+
* └── react-library.json → React component libraries
|
|
24
|
+
*
|
|
25
|
+
* Reference: https://www.typescriptlang.org/tsconfig
|
|
26
|
+
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
27
|
+
|
|
28
|
+
"compilerOptions": {
|
|
29
|
+
/* ═══════════════════════════════════════════════════════════════════════════════
|
|
30
|
+
* STRICT TYPE CHECKING
|
|
31
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
32
|
+
* "strict: true" enables these 8 fundamental rules:
|
|
33
|
+
* → strictNullChecks: Check null/undefined assignments
|
|
34
|
+
* → strictFunctionTypes: Strict function type checking
|
|
35
|
+
* → strictBindCallApply: Type checking for bind/call/apply
|
|
36
|
+
* → strictPropertyInitialization: Ensure class properties are initialized
|
|
37
|
+
* → noImplicitThis: Error on implicit 'this' types
|
|
38
|
+
* → noImplicitAny: Error on implicit 'any' types
|
|
39
|
+
* → alwaysStrict: Emit "use strict" in all files
|
|
40
|
+
* → useUnknownInCatchVariables: Use 'unknown' instead of 'any' in catch
|
|
41
|
+
* ═══════════════════════════════════════════════════════════════════════════════ */
|
|
42
|
+
"strict": true,
|
|
43
|
+
|
|
44
|
+
/* ═══════════════════════════════════════════════════════════════════════════════
|
|
45
|
+
* ADDITIONAL TYPE SAFETY (Not included in strict: true)
|
|
46
|
+
* ═══════════════════════════════════════════════════════════════════════════════ */
|
|
47
|
+
|
|
48
|
+
// ─── Unused Code Detection ───────────────────────────────────────────────────
|
|
49
|
+
"noUnusedLocals": true, // Error on unused local variables
|
|
50
|
+
"noUnusedParameters": true, // Error on unused function parameters
|
|
51
|
+
|
|
52
|
+
// ─── Control Flow Analysis ───────────────────────────────────────────────────
|
|
53
|
+
"noImplicitReturns": true, // Error when not all paths return a value
|
|
54
|
+
"noFallthroughCasesInSwitch": true, // Error on switch case fall-through
|
|
55
|
+
"allowUnreachableCode": false, // Error on unreachable code
|
|
56
|
+
|
|
57
|
+
// ─── Index Signature Safety ──────────────────────────────────────────────────
|
|
58
|
+
"noUncheckedIndexedAccess": true, // Add undefined to index signature results
|
|
59
|
+
"exactOptionalPropertyTypes": true, // Distinguish between undefined and missing
|
|
60
|
+
"noPropertyAccessFromIndexSignature": true, // Require bracket notation for index access
|
|
61
|
+
|
|
62
|
+
// ─── Class & Override Safety ─────────────────────────────────────────────────
|
|
63
|
+
"noImplicitOverride": true, // Require 'override' keyword for overrides
|
|
64
|
+
|
|
65
|
+
// ─── Import Validation ───────────────────────────────────────────────────────
|
|
66
|
+
"noUncheckedSideEffectImports": true, // Validate side-effect imports exist
|
|
67
|
+
|
|
68
|
+
/* ═══════════════════════════════════════════════════════════════════════════════
|
|
69
|
+
* MODULE SYSTEM (Universal Settings)
|
|
70
|
+
* ═══════════════════════════════════════════════════════════════════════════════ */
|
|
71
|
+
"target": "ESNext", // Emit modern JavaScript
|
|
72
|
+
"module": "ESNext", // Use ES modules
|
|
73
|
+
"moduleResolution": "bundler", // Modern bundler resolution (Vite, esbuild, etc.)
|
|
74
|
+
"moduleDetection": "force", // Treat all files as modules
|
|
75
|
+
|
|
76
|
+
// ─── Module Interoperability ─────────────────────────────────────────────────
|
|
77
|
+
"esModuleInterop": true, // Enable CommonJS/ESM interop
|
|
78
|
+
"allowSyntheticDefaultImports": true, // Allow default imports from CJS modules
|
|
79
|
+
"resolveJsonModule": true, // Allow importing JSON files
|
|
80
|
+
"isolatedModules": true, // Ensure safe transpilation by tools
|
|
81
|
+
|
|
82
|
+
/* ═══════════════════════════════════════════════════════════════════════════════
|
|
83
|
+
* CODE QUALITY & CONSISTENCY
|
|
84
|
+
* ═══════════════════════════════════════════════════════════════════════════════ */
|
|
85
|
+
"forceConsistentCasingInFileNames": true, // Enforce consistent file name casing
|
|
86
|
+
"allowImportingTsExtensions": false, // Disallow .ts/.tsx extensions in imports
|
|
87
|
+
"verbatimModuleSyntax": false // Allow flexible import/export syntax
|
|
88
|
+
}
|
|
89
|
+
}
|
package/bun.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
-
"display": "Bun Runtime Configuration",
|
|
4
|
-
"extends": "./base.json",
|
|
5
|
-
|
|
6
|
-
/* ═══════════════════════════════════════════════════════════════════════════════════
|
|
7
|
-
* @sicoti/tsconfig - Bun Preset
|
|
8
|
-
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
9
|
-
*
|
|
10
|
-
* Optimized for Bun runtime packages, CLI tools, and utilities.
|
|
11
|
-
*
|
|
12
|
-
* Key characteristics:
|
|
13
|
-
* - Server-side only (no DOM libs)
|
|
14
|
-
* - Declaration files for library consumers
|
|
15
|
-
* - Optimized for Bun's native bundler
|
|
16
|
-
* - Incremental builds for faster development
|
|
17
|
-
* - Relaxed unused checks for library exports
|
|
18
|
-
*
|
|
19
|
-
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
20
|
-
|
|
21
|
-
"compilerOptions": {
|
|
22
|
-
/* ─── Runtime Environment ───────────────────────────────────────────────────── */
|
|
23
|
-
"lib": ["ESNext"], // Server-side only, no DOM
|
|
24
|
-
"target": "ESNext", // Bun supports latest ECMAScript
|
|
25
|
-
|
|
26
|
-
/* ─── Output Settings ───────────────────────────────────────────────────── */
|
|
27
|
-
"noEmit": false, // Emit compiled output
|
|
28
|
-
"declaration": true, // Generate .d.ts for consumers
|
|
29
|
-
"declarationMap": true, // Source maps for declarations
|
|
30
|
-
"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
|
-
|
|
34
|
-
/* ─── Relaxed Checks for Library Development ─────────────────────────── */
|
|
35
|
-
// Libraries may export utilities that appear unused locally
|
|
36
|
-
"noUnusedLocals": false,
|
|
37
|
-
"noUnusedParameters": false
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
+
"display": "Bun Runtime Configuration",
|
|
4
|
+
"extends": "./base.json",
|
|
5
|
+
|
|
6
|
+
/* ═══════════════════════════════════════════════════════════════════════════════════
|
|
7
|
+
* @sicoti/tsconfig - Bun Preset
|
|
8
|
+
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
9
|
+
*
|
|
10
|
+
* Optimized for Bun runtime packages, CLI tools, and utilities.
|
|
11
|
+
*
|
|
12
|
+
* Key characteristics:
|
|
13
|
+
* - Server-side only (no DOM libs)
|
|
14
|
+
* - Declaration files for library consumers
|
|
15
|
+
* - Optimized for Bun's native bundler
|
|
16
|
+
* - Incremental builds for faster development
|
|
17
|
+
* - Relaxed unused checks for library exports
|
|
18
|
+
*
|
|
19
|
+
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
20
|
+
|
|
21
|
+
"compilerOptions": {
|
|
22
|
+
/* ─── Runtime Environment ───────────────────────────────────────────────────── */
|
|
23
|
+
"lib": ["ESNext"], // Server-side only, no DOM
|
|
24
|
+
"target": "ESNext", // Bun supports latest ECMAScript
|
|
25
|
+
|
|
26
|
+
/* ─── Output Settings ───────────────────────────────────────────────────── */
|
|
27
|
+
"noEmit": false, // Emit compiled output
|
|
28
|
+
"declaration": true, // Generate .d.ts for consumers
|
|
29
|
+
"declarationMap": true, // Source maps for declarations
|
|
30
|
+
"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
|
+
|
|
34
|
+
/* ─── Relaxed Checks for Library Development ─────────────────────────── */
|
|
35
|
+
// Libraries may export utilities that appear unused locally
|
|
36
|
+
"noUnusedLocals": false,
|
|
37
|
+
"noUnusedParameters": false
|
|
38
|
+
}
|
|
39
|
+
}
|
package/nestjs.json
CHANGED
|
@@ -1,47 +1,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
|
-
|
|
26
|
-
/* ─── NestJS Decorator Support ──────────────────────────────────────────────── */
|
|
27
|
-
"emitDecoratorMetadata": true, // Required for NestJS dependency injection
|
|
28
|
-
"experimentalDecorators": true, // Enable decorator syntax
|
|
29
|
-
|
|
30
|
-
/* ─── Output Settings ───────────────────────────────────────────────────── */
|
|
31
|
-
"noEmit": false, // Emit compiled JavaScript
|
|
32
|
-
"declaration": false, // No .d.ts files needed for apps
|
|
33
|
-
"removeComments": true, // Smaller output bundles
|
|
34
|
-
"skipLibCheck": true, // Skip .d.ts checking for performance
|
|
35
|
-
"incremental": true, // Faster rebuilds
|
|
36
|
-
"tsBuildInfoFile": "./.cache/tsconfig.tsbuildinfo", // Keep build artifacts out of root
|
|
37
|
-
|
|
38
|
-
/* ─── Source Maps for Debugging ─────────────────────────────────────────────── */
|
|
39
|
-
"sourceMap": true, // Enable source maps
|
|
40
|
-
"inlineSources": true, // Include sources in source maps
|
|
41
|
-
|
|
42
|
-
/* ─── Relaxed Checks for NestJS Patterns ────────────────────────────── */
|
|
43
|
-
// NestJS decorators and DI patterns require these relaxations
|
|
44
|
-
"strictBindCallApply": false,
|
|
45
|
-
"noPropertyAccessFromIndexSignature": false
|
|
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
|
+
|
|
26
|
+
/* ─── NestJS Decorator Support ──────────────────────────────────────────────── */
|
|
27
|
+
"emitDecoratorMetadata": true, // Required for NestJS dependency injection
|
|
28
|
+
"experimentalDecorators": true, // Enable decorator syntax
|
|
29
|
+
|
|
30
|
+
/* ─── Output Settings ───────────────────────────────────────────────────── */
|
|
31
|
+
"noEmit": false, // Emit compiled JavaScript
|
|
32
|
+
"declaration": false, // No .d.ts files needed for apps
|
|
33
|
+
"removeComments": true, // Smaller output bundles
|
|
34
|
+
"skipLibCheck": true, // Skip .d.ts checking for performance
|
|
35
|
+
"incremental": true, // Faster rebuilds
|
|
36
|
+
"tsBuildInfoFile": "./.cache/tsconfig.tsbuildinfo", // Keep build artifacts out of root
|
|
37
|
+
|
|
38
|
+
/* ─── Source Maps for Debugging ─────────────────────────────────────────────── */
|
|
39
|
+
"sourceMap": true, // Enable source maps
|
|
40
|
+
"inlineSources": true, // Include sources in source maps
|
|
41
|
+
|
|
42
|
+
/* ─── Relaxed Checks for NestJS Patterns ────────────────────────────── */
|
|
43
|
+
// NestJS decorators and DI patterns require these relaxations
|
|
44
|
+
"strictBindCallApply": false,
|
|
45
|
+
"noPropertyAccessFromIndexSignature": false
|
|
46
|
+
}
|
|
47
|
+
}
|
package/nextjs.json
CHANGED
|
@@ -1,47 +1,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
|
-
/* ─── JSX Handling ──────────────────────────────────────────────────────────── */
|
|
27
|
-
"jsx": "preserve", // Let Next.js/SWC handle JSX transformation
|
|
28
|
-
"allowJs": true, // Allow JavaScript files in the project
|
|
29
|
-
|
|
30
|
-
/* ─── Output Settings ───────────────────────────────────────────────────── */
|
|
31
|
-
"noEmit": true, // Next.js handles all compilation
|
|
32
|
-
"skipLibCheck": true, // Skip .d.ts checking for performance
|
|
33
|
-
"incremental": true, // Enable incremental type checking
|
|
34
|
-
"tsBuildInfoFile": "./.cache/tsconfig.tsbuildinfo", // Keep build artifacts out of root
|
|
35
|
-
|
|
36
|
-
/* ─── Next.js Plugin ────────────────────────────────────────────────────────── */
|
|
37
|
-
"plugins": [
|
|
38
|
-
{
|
|
39
|
-
"name": "next" // Enhanced autocomplete & type checking
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
|
|
43
|
-
/* ─── Relaxed Checks for Next.js Patterns ────────────────────────────── */
|
|
44
|
-
// Allow dot notation for dynamic route params and config objects
|
|
45
|
-
"noPropertyAccessFromIndexSignature": false
|
|
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
|
+
/* ─── JSX Handling ──────────────────────────────────────────────────────────── */
|
|
27
|
+
"jsx": "preserve", // Let Next.js/SWC handle JSX transformation
|
|
28
|
+
"allowJs": true, // Allow JavaScript files in the project
|
|
29
|
+
|
|
30
|
+
/* ─── Output Settings ───────────────────────────────────────────────────── */
|
|
31
|
+
"noEmit": true, // Next.js handles all compilation
|
|
32
|
+
"skipLibCheck": true, // Skip .d.ts checking for performance
|
|
33
|
+
"incremental": true, // Enable incremental type checking
|
|
34
|
+
"tsBuildInfoFile": "./.cache/tsconfig.tsbuildinfo", // Keep build artifacts out of root
|
|
35
|
+
|
|
36
|
+
/* ─── Next.js Plugin ────────────────────────────────────────────────────────── */
|
|
37
|
+
"plugins": [
|
|
38
|
+
{
|
|
39
|
+
"name": "next" // Enhanced autocomplete & type checking
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
|
|
43
|
+
/* ─── Relaxed Checks for Next.js Patterns ────────────────────────────── */
|
|
44
|
+
// Allow dot notation for dynamic route params and config objects
|
|
45
|
+
"noPropertyAccessFromIndexSignature": false
|
|
46
|
+
}
|
|
47
|
+
}
|
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": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
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,7 +22,7 @@
|
|
|
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": {
|
package/react-library.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
-
"display": "React Library Configuration",
|
|
4
|
-
"extends": "./base.json",
|
|
5
|
-
|
|
6
|
-
/* ═══════════════════════════════════════════════════════════════════════════════════
|
|
7
|
-
* @sicoti/tsconfig - React Library Preset
|
|
8
|
-
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
9
|
-
*
|
|
10
|
-
* Optimized for React component libraries consumed by other applications.
|
|
11
|
-
*
|
|
12
|
-
* Key characteristics:
|
|
13
|
-
* - Browser APIs (DOM libs) for component development
|
|
14
|
-
* - React 17+ JSX runtime (automatic import)
|
|
15
|
-
* - Declaration files & source maps for consumers
|
|
16
|
-
* - Relaxed unused checks for flexible component exports
|
|
17
|
-
*
|
|
18
|
-
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
19
|
-
|
|
20
|
-
"compilerOptions": {
|
|
21
|
-
/* ─── Runtime Environment ───────────────────────────────────────────────────── */
|
|
22
|
-
"lib": ["DOM", "DOM.Iterable", "ESNext"], // Browser APIs + Modern JavaScript
|
|
23
|
-
"target": "ESNext", // Modern bundlers handle transpilation
|
|
24
|
-
|
|
25
|
-
/* ─── JSX Handling ──────────────────────────────────────────────────────────── */
|
|
26
|
-
"jsx": "react-jsx", // New React 17+ JSX transform
|
|
27
|
-
|
|
28
|
-
/* ─── Output Settings ───────────────────────────────────────────────────── */
|
|
29
|
-
"noEmit": false, // Emit compiled output
|
|
30
|
-
"declaration": true, // Generate .d.ts for consumers
|
|
31
|
-
"declarationMap": true, // Source maps for declarations
|
|
32
|
-
"skipLibCheck": true, // Skip .d.ts checking for performance
|
|
33
|
-
"incremental": true, // Faster rebuilds
|
|
34
|
-
"tsBuildInfoFile": "./.cache/tsconfig.tsbuildinfo", // Keep build artifacts out of root
|
|
35
|
-
|
|
36
|
-
/* ─── Relaxed Checks for Component Libraries ────────────────────────── */
|
|
37
|
-
// Libraries may export components that appear unused locally
|
|
38
|
-
"noUnusedLocals": false,
|
|
39
|
-
"noUnusedParameters": false,
|
|
40
|
-
"noPropertyAccessFromIndexSignature": false
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig.json",
|
|
3
|
+
"display": "React Library Configuration",
|
|
4
|
+
"extends": "./base.json",
|
|
5
|
+
|
|
6
|
+
/* ═══════════════════════════════════════════════════════════════════════════════════
|
|
7
|
+
* @sicoti/tsconfig - React Library Preset
|
|
8
|
+
* ═══════════════════════════════════════════════════════════════════════════════════
|
|
9
|
+
*
|
|
10
|
+
* Optimized for React component libraries consumed by other applications.
|
|
11
|
+
*
|
|
12
|
+
* Key characteristics:
|
|
13
|
+
* - Browser APIs (DOM libs) for component development
|
|
14
|
+
* - React 17+ JSX runtime (automatic import)
|
|
15
|
+
* - Declaration files & source maps for consumers
|
|
16
|
+
* - Relaxed unused checks for flexible component exports
|
|
17
|
+
*
|
|
18
|
+
* ═══════════════════════════════════════════════════════════════════════════════════ */
|
|
19
|
+
|
|
20
|
+
"compilerOptions": {
|
|
21
|
+
/* ─── Runtime Environment ───────────────────────────────────────────────────── */
|
|
22
|
+
"lib": ["DOM", "DOM.Iterable", "ESNext"], // Browser APIs + Modern JavaScript
|
|
23
|
+
"target": "ESNext", // Modern bundlers handle transpilation
|
|
24
|
+
|
|
25
|
+
/* ─── JSX Handling ──────────────────────────────────────────────────────────── */
|
|
26
|
+
"jsx": "react-jsx", // New React 17+ JSX transform
|
|
27
|
+
|
|
28
|
+
/* ─── Output Settings ───────────────────────────────────────────────────── */
|
|
29
|
+
"noEmit": false, // Emit compiled output
|
|
30
|
+
"declaration": true, // Generate .d.ts for consumers
|
|
31
|
+
"declarationMap": true, // Source maps for declarations
|
|
32
|
+
"skipLibCheck": true, // Skip .d.ts checking for performance
|
|
33
|
+
"incremental": true, // Faster rebuilds
|
|
34
|
+
"tsBuildInfoFile": "./.cache/tsconfig.tsbuildinfo", // Keep build artifacts out of root
|
|
35
|
+
|
|
36
|
+
/* ─── Relaxed Checks for Component Libraries ────────────────────────── */
|
|
37
|
+
// Libraries may export components that appear unused locally
|
|
38
|
+
"noUnusedLocals": false,
|
|
39
|
+
"noUnusedParameters": false,
|
|
40
|
+
"noPropertyAccessFromIndexSignature": false
|
|
41
|
+
}
|
|
42
|
+
}
|