@2bad/tsconfig 3.0.1 → 4.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 +8 -7
- package/package.json +8 -3
- package/tsconfig.json +7 -5
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@ Shared [TypeScript config](https://www.typescriptlang.org/docs/handbook/tsconfig
|
|
|
8
8
|
$ npm install --save-dev @2bad/tsconfig
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
Requires TypeScript >= 5.8.
|
|
12
|
+
|
|
11
13
|
## Usage
|
|
12
14
|
|
|
13
15
|
`tsconfig.json`
|
|
@@ -17,25 +19,24 @@ $ npm install --save-dev @2bad/tsconfig
|
|
|
17
19
|
"extends": "@2bad/tsconfig",
|
|
18
20
|
"compilerOptions": {
|
|
19
21
|
"outDir": "build",
|
|
20
|
-
"
|
|
22
|
+
"types": ["node"]
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
The base sets `types` to `[]`, so list the ambient type packages your project needs (for example `["node"]`). This matches the TypeScript 7.0 default and keeps type resolution explicit.
|
|
28
|
+
|
|
29
|
+
For path mapping, inline the source directory into each `paths` entry. `baseUrl` is deprecated in TypeScript 6.0 and removed in 7.0, so it is no longer used.
|
|
26
30
|
|
|
27
31
|
```json
|
|
28
32
|
{
|
|
29
33
|
"extends": "@2bad/tsconfig",
|
|
30
34
|
"compilerOptions": {
|
|
31
35
|
"outDir": "build",
|
|
32
|
-
"
|
|
36
|
+
"types": ["node"],
|
|
33
37
|
"paths": {
|
|
34
|
-
"~/*": ["
|
|
38
|
+
"~/*": ["./source/*"]
|
|
35
39
|
}
|
|
36
|
-
},
|
|
37
|
-
"tsc-alias": {
|
|
38
|
-
"resolveFullPaths": true
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@2bad/tsconfig",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Shared TypeScript config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tsconfig",
|
|
@@ -29,10 +29,15 @@
|
|
|
29
29
|
"files": [
|
|
30
30
|
"tsconfig.json"
|
|
31
31
|
],
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"typescript": ">=5.8"
|
|
34
|
+
},
|
|
35
|
+
"packageManager": "npm@11.17.0",
|
|
32
36
|
"engines": {
|
|
33
|
-
"node": ">=
|
|
37
|
+
"node": ">=24"
|
|
34
38
|
},
|
|
35
39
|
"volta": {
|
|
36
|
-
"node": "
|
|
40
|
+
"node": "24.17.0",
|
|
41
|
+
"npm": "11.17.0"
|
|
37
42
|
}
|
|
38
43
|
}
|
package/tsconfig.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
12
|
|
|
13
13
|
/* Language and Environment */
|
|
14
|
-
"target": "
|
|
14
|
+
"target": "es2024", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
15
15
|
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
16
|
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
17
|
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
23
23
|
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
24
|
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
|
-
|
|
25
|
+
"moduleDetection": "force", /* Control what method is used to detect module-format JS files. */
|
|
26
26
|
|
|
27
27
|
/* Modules */
|
|
28
28
|
"module": "NodeNext", /* Specify what module code is generated. */
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
33
33
|
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
34
34
|
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
35
|
-
|
|
35
|
+
"types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
36
36
|
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
37
37
|
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
38
38
|
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
43
43
|
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
44
44
|
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
45
|
+
"noUncheckedSideEffectImports": true, /* Check side effect imports. */
|
|
45
46
|
|
|
46
47
|
/* JavaScript Support */
|
|
47
48
|
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
@@ -74,8 +75,9 @@
|
|
|
74
75
|
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
75
76
|
|
|
76
77
|
/* Interop Constraints */
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
"isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
79
|
+
"verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
|
80
|
+
"erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */
|
|
79
81
|
"allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
80
82
|
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
81
83
|
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|