@igorskyflyer/tsconfig 1.0.2 → 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/README.md +63 -31
- package/package.json +29 -24
- package/tsconfig.base.json +6 -1
- package/tsconfig.browser.json +6 -1
- package/tsconfig.node.json +3 -0
package/README.md
CHANGED
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
|
|
28
28
|
## Features
|
|
29
29
|
|
|
30
|
-
- 🔧
|
|
31
|
-
- 📦 Separate configs for
|
|
32
|
-
- 🎯 `ES2024` target -
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
30
|
+
- 🔧 Very strict TypeScript configuration by default (`strict: true` + modern strict options)
|
|
31
|
+
- 📦 Separate configs for Node.js and browser environments
|
|
32
|
+
- 🎯 `ES2024` target - modern and future-ready (requires Node ≥ 24)
|
|
33
|
+
- 🗺️ Full source maps + declaration maps for excellent debugging and type publishing
|
|
34
|
+
- ⚡ `verbatimModuleSyntax` + `isolatedDeclarations` for clean, modern module handling
|
|
35
|
+
- 🔍 Strong type safety with `exactOptionalPropertyTypes`, `noUncheckedIndexedAccess`, and more
|
|
36
|
+
- 🧩 Clean, reusable base - designed to be extended with minimal effort
|
|
37
37
|
|
|
38
38
|
<br>
|
|
39
39
|
|
|
@@ -42,23 +42,28 @@
|
|
|
42
42
|
Install it by executing any of the following, depending on the preferred package manager:
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
|
-
|
|
45
|
+
bun add @igorskyflyer/tsconfig -D
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
|
|
49
|
+
pnpm add @igorskyflyer/tsconfig -D
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
|
|
53
|
+
yarn add @igorskyflyer/tsconfig -D
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm i @igorskyflyer/tsconfig -D
|
|
54
58
|
```
|
|
55
59
|
|
|
56
60
|
<br>
|
|
57
61
|
|
|
58
|
-
Then extend the preferred config in
|
|
62
|
+
Then extend the preferred config in **tsconfig.json**:
|
|
59
63
|
|
|
60
|
-
**Node (default)
|
|
61
|
-
|
|
64
|
+
**Node (default)**
|
|
65
|
+
`tsconfig.json`
|
|
66
|
+
```json
|
|
62
67
|
{
|
|
63
68
|
"extends": "@igorskyflyer/tsconfig",
|
|
64
69
|
"include": ["src/**/*"],
|
|
@@ -70,8 +75,11 @@ Then extend the preferred config in `tsconfig.json`:
|
|
|
70
75
|
}
|
|
71
76
|
```
|
|
72
77
|
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
<br>
|
|
79
|
+
|
|
80
|
+
**Node (explicit)**
|
|
81
|
+
`tsconfig.json`
|
|
82
|
+
```json
|
|
75
83
|
{
|
|
76
84
|
"extends": "@igorskyflyer/tsconfig/node",
|
|
77
85
|
"include": ["src/**/*"],
|
|
@@ -83,8 +91,11 @@ Then extend the preferred config in `tsconfig.json`:
|
|
|
83
91
|
}
|
|
84
92
|
```
|
|
85
93
|
|
|
86
|
-
|
|
87
|
-
|
|
94
|
+
<br>
|
|
95
|
+
|
|
96
|
+
**Browser**
|
|
97
|
+
`tsconfig.json`
|
|
98
|
+
```json
|
|
88
99
|
{
|
|
89
100
|
"extends": "@igorskyflyer/tsconfig/browser",
|
|
90
101
|
"include": ["src/**/*"],
|
|
@@ -96,8 +107,11 @@ Then extend the preferred config in `tsconfig.json`:
|
|
|
96
107
|
}
|
|
97
108
|
```
|
|
98
109
|
|
|
99
|
-
|
|
100
|
-
|
|
110
|
+
<br>
|
|
111
|
+
|
|
112
|
+
**Base only**
|
|
113
|
+
`tsconfig.json`
|
|
114
|
+
```json
|
|
101
115
|
{
|
|
102
116
|
"extends": "@igorskyflyer/tsconfig/base",
|
|
103
117
|
"include": ["src/**/*"],
|
|
@@ -120,21 +134,27 @@ Then extend the preferred config in `tsconfig.json`:
|
|
|
120
134
|
All configs extend `base`, which defines the shared structure and strict rules.
|
|
121
135
|
|
|
122
136
|
### Base
|
|
137
|
+
`tsconfig.json`
|
|
123
138
|
```jsonc
|
|
124
139
|
{
|
|
125
140
|
"compilerOptions": {
|
|
126
|
-
"declaration": true,
|
|
127
|
-
"declarationMap": true,
|
|
128
|
-
"sourceMap": true,
|
|
129
|
-
"verbatimModuleSyntax": true,
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"
|
|
141
|
+
"declaration": true, // generate .d.ts files
|
|
142
|
+
"declarationMap": true, // generate .d.ts.map files
|
|
143
|
+
"sourceMap": true, // generate .js.map files
|
|
144
|
+
"verbatimModuleSyntax": true, // enforce explicit import/export types
|
|
145
|
+
"isolatedDeclarations": true, // require explicit types on all exports (faster .d.ts emit)
|
|
146
|
+
"strict": true, // enable all strict type checks
|
|
147
|
+
"exactOptionalPropertyTypes": true, // treat optional properties strictly (undefined vs missing)
|
|
148
|
+
"noFallthroughCasesInSwitch": true, // error on switch cases that fall through
|
|
149
|
+
"noUncheckedIndexedAccess": true, // index signatures include undefined
|
|
150
|
+
"noPropertyAccessFromIndexSignature": true, // prevent property access outside index signatures
|
|
151
|
+
"noUnusedLocals": true, // error on unused local variables
|
|
152
|
+
"noUnusedParameters": true, // error on unused function parameters
|
|
153
|
+
"noImplicitAny": true, // error on implicit 'any' types
|
|
154
|
+
"noImplicitReturns": true, // error on functions missing return statements
|
|
155
|
+
"skipLibCheck": true, // skip type-checking of declaration files
|
|
136
156
|
"forceConsistentCasingInFileNames": true, // enforce consistent file casing
|
|
137
|
-
"noEmitOnError": true
|
|
157
|
+
"noEmitOnError": true // don't emit files if there are type errors
|
|
138
158
|
}
|
|
139
159
|
}
|
|
140
160
|
```
|
|
@@ -142,12 +162,14 @@ All configs extend `base`, which defines the shared structure and strict rules.
|
|
|
142
162
|
### Node
|
|
143
163
|
|
|
144
164
|
Extends `base` and adds `Node` environment targeting:
|
|
165
|
+
`tsconfig.json`
|
|
145
166
|
```jsonc
|
|
146
167
|
{
|
|
147
168
|
"extends": "./tsconfig.base.json",
|
|
148
169
|
"compilerOptions": {
|
|
149
170
|
"target": "ES2024", // modern JS output
|
|
150
171
|
"lib": ["ES2024"], // modern built-in types
|
|
172
|
+
"types": ["node"], // Node.js global type definitions
|
|
151
173
|
"module": "NodeNext", // Node ESM-compatible modules
|
|
152
174
|
"moduleResolution": "NodeNext" // Node ESM module resolution
|
|
153
175
|
}
|
|
@@ -157,6 +179,7 @@ Extends `base` and adds `Node` environment targeting:
|
|
|
157
179
|
### Browser
|
|
158
180
|
|
|
159
181
|
Extends `base` and adds `browser` environment targeting:
|
|
182
|
+
`tsconfig.json`
|
|
160
183
|
```jsonc
|
|
161
184
|
{
|
|
162
185
|
"extends": "./tsconfig.base.json",
|
|
@@ -164,7 +187,12 @@ Extends `base` and adds `browser` environment targeting:
|
|
|
164
187
|
"target": "ES2024", // modern JS output
|
|
165
188
|
"lib": ["ES2024", "DOM", "DOM.Iterable"], // modern + DOM types
|
|
166
189
|
"module": "ESNext", // bundler-compatible modules
|
|
167
|
-
"moduleResolution": "Bundler" // bundler module resolution
|
|
190
|
+
"moduleResolution": "Bundler", // bundler module resolution
|
|
191
|
+
"allowImportingTsExtensions": true, // allow explicit .ts extensions in imports
|
|
192
|
+
"erasableSyntaxOnly": true, // ensure compatibility with type-stripping engines
|
|
193
|
+
"noEmit": true, // hand over file emission to the bundler
|
|
194
|
+
"declaration": false, // disable base declaration emit to prevent noEmit conflict
|
|
195
|
+
"declarationMap": false // disable base declaration maps
|
|
168
196
|
}
|
|
169
197
|
}
|
|
170
198
|
```
|
|
@@ -209,6 +237,10 @@ Licensed under the [**MIT license**](https://github.com/igorskyflyer/npm-tsconfi
|
|
|
209
237
|
|
|
210
238
|
## Related
|
|
211
239
|
|
|
240
|
+
This package is part of the [**dotfiles**](https://github.com/igorskyflyer/dotfiles) DX config suite - a curated index of independently installable configuration packages for linting, formatting, editing, JS/TS, React, Vue and many more.
|
|
241
|
+
|
|
242
|
+
### Other related packages
|
|
243
|
+
|
|
212
244
|
[**@igorskyflyer/duoscribi**](https://www.npmjs.com/package/@igorskyflyer/duoscribi)
|
|
213
245
|
|
|
214
246
|
> _✒ DúöScríbî allows you to convert letters with diacritics to regular letters. 🤓_
|
package/package.json
CHANGED
|
@@ -1,18 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@igorskyflyer/tsconfig",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "🔧 Opinionated, reusable TSConfig base for modern TypeScript projects
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "🔧 Opinionated, reusable TSConfig base for modern TypeScript projects. 🧠",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=24.0.0"
|
|
7
|
+
},
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./tsconfig.json",
|
|
10
|
+
"./base": "./tsconfig.base.json",
|
|
11
|
+
"./node": "./tsconfig.node.json",
|
|
12
|
+
"./browser": "./tsconfig.browser.json"
|
|
13
|
+
},
|
|
5
14
|
"files": [
|
|
6
15
|
"tsconfig.base.json",
|
|
7
16
|
"tsconfig.browser.json",
|
|
8
17
|
"tsconfig.json",
|
|
9
18
|
"tsconfig.node.json"
|
|
10
19
|
],
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"typescript": ">=6.0.0",
|
|
22
|
+
"@types/node": ">=24.0.0"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"private": false,
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"author": "Igor Dimitrijević <support@igorskyflyer.me> (https://github.com/igorskyflyer)",
|
|
30
|
+
"funding": "https://ko-fi.com/igorskyflyer",
|
|
31
|
+
"homepage": "https://github.com/igorskyflyer/npm-tsconfig",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/igorskyflyer/npm-tsconfig.git"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/igorskyflyer/npm-tsconfig/issues"
|
|
16
38
|
},
|
|
17
39
|
"keywords": [
|
|
18
40
|
"tsconfig",
|
|
@@ -29,23 +51,6 @@
|
|
|
29
51
|
"igor dimitrijević",
|
|
30
52
|
"igorskyflyer"
|
|
31
53
|
],
|
|
32
|
-
"license": "MIT",
|
|
33
|
-
"author": "Igor Dimitrijević <support@igorskyflyer.me> (https://github.com/igorskyflyer)",
|
|
34
|
-
"funding": "https://ko-fi.com/igorskyflyer",
|
|
35
|
-
"homepage": "https://github.com/igorskyflyer/npm-tsconfig",
|
|
36
|
-
"repository": {
|
|
37
|
-
"type": "git",
|
|
38
|
-
"url": "git+https://github.com/igorskyflyer/npm-tsconfig.git"
|
|
39
|
-
},
|
|
40
|
-
"bugs": {
|
|
41
|
-
"url": "https://github.com/igorskyflyer/npm-tsconfig/issues"
|
|
42
|
-
},
|
|
43
|
-
"peerDependencies": {
|
|
44
|
-
"typescript": ">=5.0.0"
|
|
45
|
-
},
|
|
46
|
-
"publishConfig": {
|
|
47
|
-
"access": "public"
|
|
48
|
-
},
|
|
49
54
|
"scripts": {
|
|
50
55
|
"pub": "git push origin main --tags"
|
|
51
56
|
}
|
package/tsconfig.base.json
CHANGED
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
"noImplicitReturns": true,
|
|
13
13
|
"skipLibCheck": true,
|
|
14
14
|
"forceConsistentCasingInFileNames": true,
|
|
15
|
-
"noEmitOnError": true
|
|
15
|
+
"noEmitOnError": true,
|
|
16
|
+
"exactOptionalPropertyTypes": true,
|
|
17
|
+
"noFallthroughCasesInSwitch": true,
|
|
18
|
+
"noUncheckedIndexedAccess": true,
|
|
19
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
20
|
+
"isolatedDeclarations": true
|
|
16
21
|
}
|
|
17
22
|
}
|
package/tsconfig.browser.json
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"DOM.Iterable"
|
|
10
10
|
],
|
|
11
11
|
"module": "ESNext",
|
|
12
|
-
"moduleResolution": "Bundler"
|
|
12
|
+
"moduleResolution": "Bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"erasableSyntaxOnly": true,
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
"declaration": false,
|
|
17
|
+
"declarationMap": false
|
|
13
18
|
}
|
|
14
19
|
}
|