@zilero/tsconfigs 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +21 -0
- package/README.md +135 -0
- package/package.json +55 -0
- package/tsconfig.base.json +42 -0
- package/tsconfig.next.json +41 -0
- package/tsconfig.node.json +41 -0
- package/tsconfig.react.json +41 -0
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 Aleksandr
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,135 @@
|
|
1
|
+
# 🎯 @zilero/tsconfig
|
2
|
+
|
3
|
+
<p align="center">
|
4
|
+
<a href="https://github.com/Zilero232/dev-config-hub">
|
5
|
+
<img src="https://img.shields.io/github/actions/workflow/status/Zilero232/dev-config-hub/integrate.yaml?label=CI&logo=GitHub" alt="CI status">
|
6
|
+
</a>
|
7
|
+
<a href="https://www.npmjs.com/package/@zilero/tsconfig">
|
8
|
+
<img src="https://img.shields.io/npm/dm/@zilero/tsconfig?logo=NPM" alt="npm downloads">
|
9
|
+
</a>
|
10
|
+
<a href="https://github.com/Zilero232/cli">
|
11
|
+
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="npm license">
|
12
|
+
</a>
|
13
|
+
<a href="https://github.com/Zilero232/dev-config-hub/tree/main/tools/tsconfigs">
|
14
|
+
<img src="https://img.shields.io/npm/v/@zilero/tsconfig?label=version" alt="version">
|
15
|
+
</a>
|
16
|
+
</p>
|
17
|
+
|
18
|
+
> ✨ Opinionated TypeScript configurations for modern development
|
19
|
+
|
20
|
+
## ✨ Features
|
21
|
+
|
22
|
+
- 📦 Multiple presets for different environments
|
23
|
+
- 🎯 Strict type checking enabled
|
24
|
+
- 🔧 Modern ECMAScript features
|
25
|
+
- 🚀 Optimized for React and Next.js
|
26
|
+
- 💪 Node.js support
|
27
|
+
- 🎭 Path aliases support
|
28
|
+
- 📊 Incremental compilation
|
29
|
+
|
30
|
+
## 📥 Installation
|
31
|
+
|
32
|
+
### Using npm
|
33
|
+
|
34
|
+
```bash
|
35
|
+
npm install --save-dev @zilero/tsconfig
|
36
|
+
```
|
37
|
+
### Using yarn
|
38
|
+
|
39
|
+
```bash
|
40
|
+
yarn add -D @zilero/tsconfig
|
41
|
+
```
|
42
|
+
|
43
|
+
### Using pnpm
|
44
|
+
|
45
|
+
```bash
|
46
|
+
pnpm install -D @zilero/tsconfig
|
47
|
+
```
|
48
|
+
|
49
|
+
## ⚙️ Configuration Details
|
50
|
+
|
51
|
+
### Base Configuration
|
52
|
+
|
53
|
+
```json
|
54
|
+
{
|
55
|
+
"extends": "@zilero/tsconfig/tsconfig.base.json",
|
56
|
+
}
|
57
|
+
```
|
58
|
+
|
59
|
+
### React Configuration
|
60
|
+
|
61
|
+
```json
|
62
|
+
{
|
63
|
+
"extends": "@zilero/tsconfig/tsconfig.react.json",
|
64
|
+
}
|
65
|
+
```
|
66
|
+
|
67
|
+
### Next.js Configuration
|
68
|
+
|
69
|
+
```json
|
70
|
+
{
|
71
|
+
"extends": "@zilero/tsconfig/tsconfig.next.json",
|
72
|
+
}
|
73
|
+
```
|
74
|
+
|
75
|
+
### Node Configuration
|
76
|
+
|
77
|
+
```json
|
78
|
+
{
|
79
|
+
"extends": "@zilero/tsconfig/tsconfig.node.json",
|
80
|
+
}
|
81
|
+
```
|
82
|
+
|
83
|
+
Add scripts to your `package.json`:
|
84
|
+
|
85
|
+
```json
|
86
|
+
"scripts": {
|
87
|
+
"test": "vitest",
|
88
|
+
"test:ui": "vitest --ui",
|
89
|
+
"test:coverage": "vitest run --coverage",
|
90
|
+
"test:ci": "vitest run --coverage --reporter=json --reporter=junit"
|
91
|
+
}
|
92
|
+
```
|
93
|
+
|
94
|
+
## 🤝 Contributing
|
95
|
+
|
96
|
+
We'd love for you to contribute to `@zilero/tsconfig`! Whether it's reporting bugs, suggesting features, or submitting pull requests, your help is always appreciated.
|
97
|
+
|
98
|
+
### How to contribute:
|
99
|
+
|
100
|
+
1. Fork the repository.
|
101
|
+
2. Create a new branch (`git checkout -b feature/your-feature`).
|
102
|
+
3. Make your changes.
|
103
|
+
4. Commit your changes (`git commit -am 'Add new feature'`).
|
104
|
+
5. Push to the branch (`git push origin feature/your-feature`).
|
105
|
+
6. Open a pull request.
|
106
|
+
|
107
|
+
## 📜 Code of Conduct
|
108
|
+
|
109
|
+
Please follow our [Code of Conduct](CODE_OF_CONDUCT.md) when participating in this project to ensure a welcoming and productive atmosphere.
|
110
|
+
|
111
|
+
## 🔒 Security Policy
|
112
|
+
|
113
|
+
Security is our priority. If you encounter any issues, please read our full [Security Policy](SECURITY.md) to report vulnerabilities safely and responsibly.
|
114
|
+
|
115
|
+
## 👥 Team
|
116
|
+
|
117
|
+
These folks keep the project moving and are resources for help.
|
118
|
+
|
119
|
+
<table>
|
120
|
+
<tbody>
|
121
|
+
<tr>
|
122
|
+
<td align="center" valign="top" width="11%">
|
123
|
+
<a href="https://career.habr.com/zilero">
|
124
|
+
<img src="https://avatars.githubusercontent.com/u/68345676?s=400&u=eb7df22c29a8aca48def78ec54a7526601c9fd8f&v=4" width="100" height="100" alt="Artemev Alexandr - Avatar">
|
125
|
+
<br />
|
126
|
+
Artemev A. A.
|
127
|
+
</a>
|
128
|
+
</td>
|
129
|
+
</tr>
|
130
|
+
</tbody>
|
131
|
+
</table>
|
132
|
+
|
133
|
+
## 📄 License
|
134
|
+
|
135
|
+
License `@zilero/tsconfig` is licensed under the [MIT License](LICENSE).
|
package/package.json
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
{
|
2
|
+
"name": "@zilero/tsconfigs",
|
3
|
+
"icon": "🔷",
|
4
|
+
"displayName": "✨ Zilero TypeScript Config",
|
5
|
+
"description": "🔷 Opinionated TypeScript configuration for modern development",
|
6
|
+
"license": "MIT",
|
7
|
+
"version": "1.0.0",
|
8
|
+
"keywords": [
|
9
|
+
"typescript",
|
10
|
+
"tsconfig",
|
11
|
+
"config",
|
12
|
+
"configuration",
|
13
|
+
"preset",
|
14
|
+
"react",
|
15
|
+
"next",
|
16
|
+
"node",
|
17
|
+
"strict",
|
18
|
+
"modern"
|
19
|
+
],
|
20
|
+
"author": {
|
21
|
+
"name": "Artemev Alexandr",
|
22
|
+
"url": "https://github.com/Zilero232",
|
23
|
+
"email": "sasha.artemev.1002@mail.ru"
|
24
|
+
},
|
25
|
+
"bugs": {
|
26
|
+
"url": "https://github.com/Zilero232/dev-config-hub/issues"
|
27
|
+
},
|
28
|
+
"homepage": "https://github.com/Zilero232/dev-config-hub",
|
29
|
+
"repository": {
|
30
|
+
"url": "https://github.com/Zilero232/dev-config-hub"
|
31
|
+
},
|
32
|
+
"publishConfig": {
|
33
|
+
"access": "public"
|
34
|
+
},
|
35
|
+
"files": [
|
36
|
+
"tsconfig.base.json",
|
37
|
+
"tsconfig.react.json",
|
38
|
+
"tsconfig.next.json",
|
39
|
+
"tsconfig.node.json"
|
40
|
+
],
|
41
|
+
"peerDependencies": {
|
42
|
+
"typescript": "^5.0.0"
|
43
|
+
},
|
44
|
+
"dependencies": {
|
45
|
+
"@types/node": "^20.10.5",
|
46
|
+
"@types/react": "^18.2.45",
|
47
|
+
"@types/react-dom": "^18.2.18"
|
48
|
+
},
|
49
|
+
"scripts": {
|
50
|
+
"type-check": "tsc --noEmit",
|
51
|
+
"type-check:watch": "tsc --noEmit --watch",
|
52
|
+
"build:types": "tsc --declaration --emitDeclarationOnly",
|
53
|
+
"check:project": "tsc --project tsconfig.json --noEmit"
|
54
|
+
}
|
55
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"extends": "@zilero/tsconfigs/base",
|
3
|
+
"compilerOptions": {
|
4
|
+
// Basic compiler options
|
5
|
+
"target": "esnext", // Specifies the ECMAScript version to use for the compiler.
|
6
|
+
"lib": ["dom", "dom.iterable", "esnext"], // Includes type definitions for DOM, DOM iterables, and the latest ECMAScript.
|
7
|
+
"allowJs": true, // Allows JavaScript files to be compiled alongside TypeScript.
|
8
|
+
"skipLibCheck": true, // Skips type checking for library files.
|
9
|
+
"esModuleInterop": true, // Enables compatibility support for ES modules.
|
10
|
+
"allowSyntheticDefaultImports": true, // Allows synthetic default imports if a library exports them.
|
11
|
+
|
12
|
+
// Strict Type-Checking Options
|
13
|
+
"strict": true, // Enables all strict type-checking options.
|
14
|
+
"noImplicitAny": true, // Raises an error on expressions and declarations with an implied 'any' type.
|
15
|
+
"noImplicitThis": true, // Raises an error when 'this' expressions are of type 'any'.
|
16
|
+
"strictNullChecks": true, // Ensures strict null checking mode.
|
17
|
+
"strictFunctionTypes": true, // Ensures function parameter bivariance is checked strictly.
|
18
|
+
"strictPropertyInitialization": true, // Ensures class properties are initialized in the constructor.
|
19
|
+
"noImplicitReturns": true, // Raises an error for functions that do not return a value in all code paths.
|
20
|
+
"noImplicitOverride": true, // Ensures that 'override' is used when a method in a subclass overrides a method in a superclass.
|
21
|
+
"noPropertyAccessFromIndexSignature": true, // Prevents access to properties on objects with index signatures using dot notation.
|
22
|
+
"useUnknownInCatchVariables": true, // Ensures that catch clause variables are of type 'unknown' instead of 'any'.
|
23
|
+
"exactOptionalPropertyTypes": true, // Ensures that optional properties are only assignable to undefined or their type.
|
24
|
+
|
25
|
+
// Module Resolution and Compilation Settings
|
26
|
+
"module": "esnext", // Specifies the module format to use in the project.
|
27
|
+
"moduleResolution": "node", // Determines module resolution strategy similar to Node.js.
|
28
|
+
"isolatedModules": true, // Ensures each file is compiled in isolation for better compatibility with build tools.
|
29
|
+
"resolveJsonModule": true, // Allows importing JSON files as modules.
|
30
|
+
"noEmit": true, // Disables emitting compiled files.
|
31
|
+
"jsx": "react", // Sets JSX support to use React.
|
32
|
+
|
33
|
+
// Additional Settings
|
34
|
+
"sourceMap": true, // Generates source map files for debugging.
|
35
|
+
"noUnusedLocals": true, // Raises an error if there are unused local variables.
|
36
|
+
"noUnusedParameters": true, // Raises an error if there are unused function parameters.
|
37
|
+
"noFallthroughCasesInSwitch": true, // Raises an error if a switch case falls through without a break or return.
|
38
|
+
"forceConsistentCasingInFileNames": true, // Enforces consistent casing in file names.
|
39
|
+
"downlevelIteration": true, // Enables full ES6 iteration support in ES5.
|
40
|
+
"skipDefaultLibCheck": true // Skips type checking for default library files (like lib.d.ts).
|
41
|
+
}
|
42
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
// Basic compiler options
|
4
|
+
"target": "esnext", // Specifies the ECMAScript version to use for the compiler.
|
5
|
+
"lib": ["dom", "dom.iterable", "esnext"], // Includes type definitions for DOM, DOM iterables, and the latest ECMAScript.
|
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.
|
10
|
+
|
11
|
+
// Strict Type-Checking Options
|
12
|
+
"strict": true, // Enables all strict type-checking options.
|
13
|
+
"noImplicitAny": true, // Raises an error on expressions and declarations with an implied 'any' type.
|
14
|
+
"noImplicitThis": true, // Raises an error when 'this' expressions are of type 'any'.
|
15
|
+
"strictNullChecks": true, // Ensures strict null checking mode.
|
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.
|
23
|
+
|
24
|
+
// Module Resolution and Compilation Settings
|
25
|
+
"module": "esnext", // Specifies the module format to use in the project.
|
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.
|
31
|
+
|
32
|
+
// Additional Settings
|
33
|
+
"sourceMap": true, // Generates source map files for debugging.
|
34
|
+
"noUnusedLocals": true, // Raises an error if there are unused local variables.
|
35
|
+
"noUnusedParameters": true, // Raises an error if there are unused function parameters.
|
36
|
+
"noFallthroughCasesInSwitch": true, // Raises an error if a switch case falls through without a break or return.
|
37
|
+
"forceConsistentCasingInFileNames": true, // Enforces consistent casing in file names.
|
38
|
+
"downlevelIteration": true, // Enables full ES6 iteration support in ES5.
|
39
|
+
"skipDefaultLibCheck": true // Skips type checking for default library files (like lib.d.ts).
|
40
|
+
}
|
41
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
// Basic compiler options
|
4
|
+
"target": "esnext", // Specifies the ECMAScript version to use for the compiler.
|
5
|
+
"lib": ["dom", "dom.iterable", "esnext"], // Includes type definitions for DOM, DOM iterables, and the latest ECMAScript.
|
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.
|
10
|
+
|
11
|
+
// Strict Type-Checking Options
|
12
|
+
"strict": true, // Enables all strict type-checking options.
|
13
|
+
"noImplicitAny": true, // Raises an error on expressions and declarations with an implied 'any' type.
|
14
|
+
"noImplicitThis": true, // Raises an error when 'this' expressions are of type 'any'.
|
15
|
+
"strictNullChecks": true, // Ensures strict null checking mode.
|
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.
|
23
|
+
|
24
|
+
// Module Resolution and Compilation Settings
|
25
|
+
"module": "esnext", // Specifies the module format to use in the project.
|
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.
|
31
|
+
|
32
|
+
// Additional Settings
|
33
|
+
"sourceMap": true, // Generates source map files for debugging.
|
34
|
+
"noUnusedLocals": true, // Raises an error if there are unused local variables.
|
35
|
+
"noUnusedParameters": true, // Raises an error if there are unused function parameters.
|
36
|
+
"noFallthroughCasesInSwitch": true, // Raises an error if a switch case falls through without a break or return.
|
37
|
+
"forceConsistentCasingInFileNames": true, // Enforces consistent casing in file names.
|
38
|
+
"downlevelIteration": true, // Enables full ES6 iteration support in ES5.
|
39
|
+
"skipDefaultLibCheck": true // Skips type checking for default library files (like lib.d.ts).
|
40
|
+
}
|
41
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
// Basic compiler options
|
4
|
+
"target": "esnext", // Specifies the ECMAScript version to use for the compiler.
|
5
|
+
"lib": ["dom", "dom.iterable", "esnext"], // Includes type definitions for DOM, DOM iterables, and the latest ECMAScript.
|
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.
|
10
|
+
|
11
|
+
// Strict Type-Checking Options
|
12
|
+
"strict": true, // Enables all strict type-checking options.
|
13
|
+
"noImplicitAny": true, // Raises an error on expressions and declarations with an implied 'any' type.
|
14
|
+
"noImplicitThis": true, // Raises an error when 'this' expressions are of type 'any'.
|
15
|
+
"strictNullChecks": true, // Ensures strict null checking mode.
|
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.
|
23
|
+
|
24
|
+
// Module Resolution and Compilation Settings
|
25
|
+
"module": "esnext", // Specifies the module format to use in the project.
|
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.
|
31
|
+
|
32
|
+
// Additional Settings
|
33
|
+
"sourceMap": true, // Generates source map files for debugging.
|
34
|
+
"noUnusedLocals": true, // Raises an error if there are unused local variables.
|
35
|
+
"noUnusedParameters": true, // Raises an error if there are unused function parameters.
|
36
|
+
"noFallthroughCasesInSwitch": true, // Raises an error if a switch case falls through without a break or return.
|
37
|
+
"forceConsistentCasingInFileNames": true, // Enforces consistent casing in file names.
|
38
|
+
"downlevelIteration": true, // Enables full ES6 iteration support in ES5.
|
39
|
+
"skipDefaultLibCheck": true // Skips type checking for default library files (like lib.d.ts).
|
40
|
+
}
|
41
|
+
}
|