@zilero/tsconfigs 1.0.1 → 1.2.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/README.md +28 -20
- package/package.json +4 -4
- package/tsconfig.base.json +0 -1
- package/tsconfig.next.json +25 -34
- package/tsconfig.node.json +28 -34
- package/tsconfig.react.json +32 -34
package/README.md
CHANGED
|
@@ -34,68 +34,76 @@
|
|
|
34
34
|
### Using npm
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
npm install --save-dev @zilero/
|
|
37
|
+
npm install --save-dev @zilero/tsconfigs
|
|
38
38
|
```
|
|
39
39
|
### Using yarn
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
yarn add -D @zilero/
|
|
42
|
+
yarn add -D @zilero/tsconfigs
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
### Using pnpm
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
pnpm install -D @zilero/
|
|
48
|
+
pnpm install -D @zilero/tsconfigs
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
##
|
|
51
|
+
## 🚀 Quick start
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Create the `tsconfig.json` at the root of your project:
|
|
54
54
|
|
|
55
55
|
```json
|
|
56
56
|
{
|
|
57
|
-
"extends": "
|
|
57
|
+
"extends": "./node_modules/@zilero/tsconfigs/tsconfig.base.json",
|
|
58
|
+
"compilerOptions": {
|
|
59
|
+
}
|
|
58
60
|
}
|
|
59
61
|
```
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
## 📚 Available Configurations
|
|
64
|
+
|
|
65
|
+
- `tsconfig.base.json` - Base configuration for TypeScript projects
|
|
66
|
+
- `tsconfig.react.json` - Configuration for React applications
|
|
67
|
+
- `tsconfig.next.json` - Configuration for Next.js projects
|
|
68
|
+
- `tsconfig.node.json` - Configuration for Node.js applications
|
|
69
|
+
|
|
70
|
+
## ⚙️ Configuration Details
|
|
71
|
+
|
|
72
|
+
### Base Configuration
|
|
62
73
|
|
|
63
74
|
```json
|
|
64
75
|
{
|
|
65
|
-
"extends": "
|
|
76
|
+
"extends": "./node_modules/@zilero/tsconfigs/tsconfig.base.json",
|
|
66
77
|
}
|
|
67
78
|
```
|
|
68
79
|
|
|
69
|
-
###
|
|
80
|
+
### React Configuration
|
|
70
81
|
|
|
71
82
|
```json
|
|
72
83
|
{
|
|
73
|
-
"extends": "
|
|
84
|
+
"extends": "./node_modules/@zilero/tsconfigs/tsconfig.react.json",
|
|
74
85
|
}
|
|
75
86
|
```
|
|
76
87
|
|
|
77
|
-
###
|
|
88
|
+
### Next.js Configuration
|
|
78
89
|
|
|
79
90
|
```json
|
|
80
91
|
{
|
|
81
|
-
"extends": "
|
|
92
|
+
"extends": "./node_modules/@zilero/tsconfigs/tsconfig.next.json",
|
|
82
93
|
}
|
|
83
94
|
```
|
|
84
95
|
|
|
85
|
-
|
|
96
|
+
### Node Configuration
|
|
86
97
|
|
|
87
98
|
```json
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
"test:ui": "vitest --ui",
|
|
91
|
-
"test:coverage": "vitest run --coverage",
|
|
92
|
-
"test:ci": "vitest run --coverage --reporter=json --reporter=junit"
|
|
99
|
+
{
|
|
100
|
+
"extends": "./node_modules/@zilero/tsconfigs/tsconfig.node.json",
|
|
93
101
|
}
|
|
94
102
|
```
|
|
95
103
|
|
|
96
104
|
## 🤝 Contributing
|
|
97
105
|
|
|
98
|
-
We'd love for you to contribute to `@zilero/
|
|
106
|
+
We'd love for you to contribute to `@zilero/tsconfigs`! Whether it's reporting bugs, suggesting features, or submitting pull requests, your help is always appreciated.
|
|
99
107
|
|
|
100
108
|
### How to contribute:
|
|
101
109
|
|
|
@@ -134,4 +142,4 @@ These folks keep the project moving and are resources for help.
|
|
|
134
142
|
|
|
135
143
|
## 📄 License
|
|
136
144
|
|
|
137
|
-
License `@zilero/
|
|
145
|
+
License `@zilero/tsconfigs` is licensed under the [MIT License](LICENSE).
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName": "✨ Zilero TypeScript Config",
|
|
5
5
|
"description": "🔷 Opinionated TypeScript configuration for modern development",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"version": "1.0
|
|
7
|
+
"version": "1.2.0",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"typescript",
|
|
10
10
|
"tsconfig",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"typescript": "^5.0.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@types/node": "^
|
|
46
|
-
"@types/react": "^
|
|
47
|
-
"@types/react-dom": "^
|
|
45
|
+
"@types/node": "^22.13.9",
|
|
46
|
+
"@types/react": "^19.0.10",
|
|
47
|
+
"@types/react-dom": "^19.0.4"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"type-check": "tsc --noEmit",
|
package/tsconfig.base.json
CHANGED
package/tsconfig.next.json
CHANGED
|
@@ -1,41 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
// Basic
|
|
4
|
-
"target": "
|
|
5
|
-
"lib": ["dom", "dom.iterable", "esnext"], //
|
|
6
|
-
"allowJs": true, //
|
|
7
|
-
"skipLibCheck": true, //
|
|
8
|
-
"
|
|
9
|
-
"
|
|
3
|
+
// Basic Options
|
|
4
|
+
"target": "es5", // Specify ECMAScript target version
|
|
5
|
+
"lib": ["dom", "dom.iterable", "esnext"], // List of library files to include
|
|
6
|
+
"allowJs": true, // Allow JavaScript files to be compiled
|
|
7
|
+
"skipLibCheck": true, // Skip type checking of declaration files
|
|
8
|
+
"strict": true, // Enable all strict type-checking options
|
|
9
|
+
"forceConsistentCasingInFileNames": true, // Ensure consistent casing in file names
|
|
10
10
|
|
|
11
|
-
//
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"noImplicitReturns": true, // Raises an error for functions that do not return a value in all code paths.
|
|
19
|
-
"noImplicitOverride": true, // Ensures that 'override' is used when a method in a subclass overrides a method in a superclass.
|
|
20
|
-
"noPropertyAccessFromIndexSignature": true, // Prevents access to properties on objects with index signatures using dot notation.
|
|
21
|
-
"useUnknownInCatchVariables": true, // Ensures that catch clause variables are of type 'unknown' instead of 'any'.
|
|
22
|
-
"exactOptionalPropertyTypes": true, // Ensures that optional properties are only assignable to undefined or their type.
|
|
11
|
+
// Module Settings
|
|
12
|
+
"noEmit": true, // Do not emit outputs
|
|
13
|
+
"esModuleInterop": true, // Enable interoperability between CommonJS and ES Modules
|
|
14
|
+
"module": "esnext", // Specify module code generation
|
|
15
|
+
"moduleResolution": "node", // Resolve modules using Node.js style
|
|
16
|
+
"resolveJsonModule": true, // Include modules imported with .json extension
|
|
17
|
+
"isolatedModules": true, // Ensure each file can be safely transpiled
|
|
23
18
|
|
|
24
|
-
//
|
|
25
|
-
"
|
|
26
|
-
"moduleResolution": "node", // Determines module resolution strategy similar to Node.js.
|
|
27
|
-
"isolatedModules": true, // Ensures each file is compiled in isolation for better compatibility with build tools.
|
|
28
|
-
"resolveJsonModule": true, // Allows importing JSON files as modules.
|
|
29
|
-
"noEmit": true, // Disables emitting compiled files.
|
|
30
|
-
"jsx": "react", // Sets JSX support to use React.
|
|
19
|
+
// JSX Settings
|
|
20
|
+
"jsx": "preserve", // Preserve JSX for Next.js
|
|
31
21
|
|
|
32
|
-
//
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
// Incremental Compilation
|
|
23
|
+
"incremental": true, // Enable incremental compilation
|
|
24
|
+
|
|
25
|
+
// Next.js Plugin
|
|
26
|
+
"plugins": [
|
|
27
|
+
{
|
|
28
|
+
"name": "next"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
40
31
|
}
|
|
41
32
|
}
|
package/tsconfig.node.json
CHANGED
|
@@ -1,41 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
// Basic
|
|
4
|
-
"target": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"esModuleInterop": true, // Enables compatibility support for ES modules.
|
|
9
|
-
"allowSyntheticDefaultImports": true, // Allows synthetic default imports if a library exports them.
|
|
3
|
+
// Basic Options
|
|
4
|
+
"target": "es2022", // Specify ECMAScript target version
|
|
5
|
+
"module": "NodeNext", // Use Node.js module resolution
|
|
6
|
+
"moduleResolution": "NodeNext", // Modern Node.js module resolution
|
|
7
|
+
"lib": ["es2023"], // Include latest ECMAScript features
|
|
10
8
|
|
|
11
|
-
// Strict Type-Checking
|
|
12
|
-
"strict": true, //
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"strictFunctionTypes": true, // Ensures function parameter bivariance is checked strictly.
|
|
17
|
-
"strictPropertyInitialization": true, // Ensures class properties are initialized in the constructor.
|
|
18
|
-
"noImplicitReturns": true, // Raises an error for functions that do not return a value in all code paths.
|
|
19
|
-
"noImplicitOverride": true, // Ensures that 'override' is used when a method in a subclass overrides a method in a superclass.
|
|
20
|
-
"noPropertyAccessFromIndexSignature": true, // Prevents access to properties on objects with index signatures using dot notation.
|
|
21
|
-
"useUnknownInCatchVariables": true, // Ensures that catch clause variables are of type 'unknown' instead of 'any'.
|
|
22
|
-
"exactOptionalPropertyTypes": true, // Ensures that optional properties are only assignable to undefined or their type.
|
|
9
|
+
// Strict Type-Checking
|
|
10
|
+
"strict": true, // Enable all strict type checking options
|
|
11
|
+
"esModuleInterop": true, // Enable CommonJS/ES module interoperability
|
|
12
|
+
"skipLibCheck": true, // Skip type checking of declaration files
|
|
13
|
+
"forceConsistentCasingInFileNames": true, // Ensure consistent casing in file names
|
|
23
14
|
|
|
24
|
-
//
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"noEmit": true, // Disables emitting compiled files.
|
|
30
|
-
"jsx": "react", // Sets JSX support to use React.
|
|
15
|
+
// Additional Checks
|
|
16
|
+
"noUnusedLocals": true, // Report errors on unused locals
|
|
17
|
+
"noUnusedParameters": true, // Report errors on unused parameters
|
|
18
|
+
"noImplicitReturns": true, // Report error when not all code paths return
|
|
19
|
+
"noFallthroughCasesInSwitch": true, // Report errors for fallthrough cases in switch
|
|
31
20
|
|
|
32
|
-
//
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
21
|
+
// Module Resolution
|
|
22
|
+
"resolveJsonModule": true, // Enable importing .json files
|
|
23
|
+
"allowJs": true, // Allow JavaScript files to be compiled
|
|
24
|
+
"sourceMap": true, // Generate source maps for debugging
|
|
25
|
+
|
|
26
|
+
// Output Options
|
|
27
|
+
"outDir": "./dist", // Redirect output to the dist directory
|
|
28
|
+
"removeComments": true, // Remove comments in output
|
|
29
|
+
|
|
30
|
+
// Advanced Options
|
|
31
|
+
"allowSyntheticDefaultImports": true, // Allow default imports from modules with no default export
|
|
32
|
+
"experimentalDecorators": true, // Enable experimental support for decorators
|
|
33
|
+
"emitDecoratorMetadata": true // Emit decorator metadata
|
|
40
34
|
}
|
|
41
35
|
}
|
package/tsconfig.react.json
CHANGED
|
@@ -1,41 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
//
|
|
4
|
-
"
|
|
5
|
-
"lib": ["dom", "dom.iterable", "esnext"], //
|
|
6
|
-
"allowJs": true, // Allows JavaScript files to be compiled alongside TypeScript.
|
|
7
|
-
"skipLibCheck": true, // Skips type checking for library files.
|
|
8
|
-
"esModuleInterop": true, // Enables compatibility support for ES modules.
|
|
9
|
-
"allowSyntheticDefaultImports": true, // Allows synthetic default imports if a library exports them.
|
|
3
|
+
// React Specific
|
|
4
|
+
"jsx": "react-jsx", // Support JSX in .tsx files without importing React
|
|
5
|
+
"lib": ["dom", "dom.iterable", "esnext"], // Include DOM types and latest ECMAScript features
|
|
10
6
|
|
|
11
|
-
//
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"strictPropertyInitialization": true, // Ensures class properties are initialized in the constructor.
|
|
18
|
-
"noImplicitReturns": true, // Raises an error for functions that do not return a value in all code paths.
|
|
19
|
-
"noImplicitOverride": true, // Ensures that 'override' is used when a method in a subclass overrides a method in a superclass.
|
|
20
|
-
"noPropertyAccessFromIndexSignature": true, // Prevents access to properties on objects with index signatures using dot notation.
|
|
21
|
-
"useUnknownInCatchVariables": true, // Ensures that catch clause variables are of type 'unknown' instead of 'any'.
|
|
22
|
-
"exactOptionalPropertyTypes": true, // Ensures that optional properties are only assignable to undefined or their type.
|
|
7
|
+
// Basic Options
|
|
8
|
+
"target": "es5", // Compile to ES5 for broader browser support
|
|
9
|
+
"module": "esnext", // Use ES modules for tree shaking
|
|
10
|
+
"moduleResolution": "bundler", // Modern module resolution strategy
|
|
11
|
+
"allowJs": true, // Allow JavaScript files to be compiled
|
|
12
|
+
"skipLibCheck": true, // Skip type checking of declaration files
|
|
23
13
|
|
|
24
|
-
//
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"resolveJsonModule": true, // Allows importing JSON files as modules.
|
|
29
|
-
"noEmit": true, // Disables emitting compiled files.
|
|
30
|
-
"jsx": "react", // Sets JSX support to use React.
|
|
14
|
+
// Strict Type-Checking
|
|
15
|
+
"strict": true, // Enable all strict type checking options
|
|
16
|
+
"noImplicitAny": true, // Raise error on expressions with implied 'any' type
|
|
17
|
+
"strictNullChecks": true, // Enable strict null checks
|
|
31
18
|
|
|
32
|
-
//
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
19
|
+
// Module Resolution
|
|
20
|
+
"esModuleInterop": true, // Enable CommonJS/ES module interoperability
|
|
21
|
+
"allowSyntheticDefaultImports": true, // Allow default imports from modules
|
|
22
|
+
"resolveJsonModule": true, // Enable importing .json files
|
|
23
|
+
"isolatedModules": true, // Ensure each file can be safely transpiled
|
|
24
|
+
|
|
25
|
+
// Additional Checks
|
|
26
|
+
"noUnusedLocals": true, // Report errors on unused locals
|
|
27
|
+
"noUnusedParameters": true, // Report errors on unused parameters
|
|
28
|
+
"noFallthroughCasesInSwitch": true, // Report errors for fallthrough cases in switch
|
|
29
|
+
|
|
30
|
+
// Build Options
|
|
31
|
+
"noEmit": true, // Do not emit output (let build tools handle it)
|
|
32
|
+
"incremental": true, // Enable incremental compilation
|
|
33
|
+
"sourceMap": true, // Generate source maps for debugging
|
|
34
|
+
|
|
35
|
+
// Environment Compatibility
|
|
36
|
+
"forceConsistentCasingInFileNames": true, // Ensure consistent casing in file names
|
|
37
|
+
"skipDefaultLibCheck": true // Skip type checking of default library declarations
|
|
40
38
|
}
|
|
41
39
|
}
|