@enormora/tsconfig 0.0.1 → 0.0.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mathias Schreck
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/base.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "compilerOptions": {
3
+ "strict": true,
4
+ "exactOptionalPropertyTypes": true,
5
+ "noUncheckedIndexedAccess": true,
6
+ "noPropertyAccessFromIndexSignature": true,
7
+ "noImplicitOverride": true,
8
+ "noImplicitReturns": true,
9
+ "noFallthroughCasesInSwitch": true,
10
+ "noUnusedLocals": true,
11
+ "noUnusedParameters": true,
12
+ "allowUnreachableCode": false,
13
+ "allowUnusedLabels": false,
14
+ "noUncheckedSideEffectImports": true,
15
+ "skipLibCheck": false,
16
+ "forceConsistentCasingInFileNames": true,
17
+ "isolatedModules": true,
18
+ "verbatimModuleSyntax": true,
19
+ "erasableSyntaxOnly": true,
20
+ "moduleDetection": "force",
21
+ "types": [],
22
+ "libReplacement": false,
23
+ "module": "NodeNext",
24
+ "moduleResolution": "NodeNext",
25
+ "target": "ES2025",
26
+ "lib": [
27
+ "ES2025"
28
+ ],
29
+ "composite": true,
30
+ "declaration": true,
31
+ "declarationMap": true,
32
+ "sourceMap": true,
33
+ "noEmitOnError": true,
34
+ "allowImportingTsExtensions": true,
35
+ "rewriteRelativeImportExtensions": true,
36
+ "resolveJsonModule": true
37
+ }
38
+ }
package/browser.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "./base.json",
3
+ "compilerOptions": {
4
+ "lib": [
5
+ "ES2025",
6
+ "DOM",
7
+ "DOM.Iterable"
8
+ ]
9
+ }
10
+ }
package/package.json CHANGED
@@ -1,7 +1,24 @@
1
1
  {
2
- "name": "@enormora/tsconfig",
3
- "version": "0.0.1",
4
- "description": "Placeholder claiming the npm package name \"@enormora/tsconfig\" so a trusted publisher can be configured. See https://github.com/npm/cli/issues/8544.",
5
- "license": "MIT",
6
- "deprecated": "Placeholder published as a workaround so a Trusted Publisher could be configured. See https://github.com/npm/cli/issues/8544."
7
- }
2
+ "author": "Mathias Schreck <schreck.mathias@gmail.com>",
3
+ "description": "Strict TypeScript project-reference presets",
4
+ "exports": {
5
+ "./base.json": "./base.json",
6
+ "./browser.json": "./browser.json",
7
+ "./worker.json": "./worker.json"
8
+ },
9
+ "keywords": [
10
+ "project-references",
11
+ "strict",
12
+ "tsconfig",
13
+ "typescript"
14
+ ],
15
+ "license": "MIT",
16
+ "name": "@enormora/tsconfig",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/enormora/tsconfigs"
20
+ },
21
+ "sideEffects": false,
22
+ "type": "module",
23
+ "version": "0.0.2"
24
+ }
package/readme.md CHANGED
@@ -1,7 +1,89 @@
1
- # @enormora/tsconfig
1
+ # Enormora TypeScript configurations
2
2
 
3
- This version is a placeholder published only to claim the npm name `@enormora/tsconfig` so a Trusted Publisher
4
- can subsequently be configured for it. It contains no real package content and is published already
5
- deprecated.
3
+ Strict presets for TypeScript 6.0 and 7.0 projects using project references.
4
+ Every preset builds JavaScript, declarations, and source maps. Every preset uses `NodeNext` module resolution.
6
5
 
7
- Workaround context: https://github.com/npm/cli/issues/8544
6
+ ## Choose an environment
7
+
8
+ | Preset | Use it for | Available globals |
9
+ | --------------------------------------- | --------------------------------------------- | ------------------------------ |
10
+ | `@enormora/tsconfig/base.json` | Code shared between environments | Standard ECMAScript APIs |
11
+ | `@enormora/tsconfig/browser.json` | Browser application code | ECMAScript and DOM APIs |
12
+ | `@enormora/tsconfig/worker.json` | Browser worker code | ECMAScript and worker APIs |
13
+ | `@enormora/tsconfig-node/tsconfig.json` | Node.js libraries, services, tools, and tests | ECMAScript and Node.js 26 APIs |
14
+
15
+ Install `typescript` and the package containing your chosen preset as development dependencies.
16
+ The Node package installs its Node declarations automatically and includes its shared base configuration.
17
+ Its current release targets Node.js 26. Changing the supported Node major is a breaking package change.
18
+
19
+ Set `"type": "module"` in the consuming package for ESM. Use explicit relative import extensions, such as `./answer.ts`.
20
+ The compiler rewrites relative TypeScript extensions to JavaScript extensions when emitting output.
21
+ Aliases and package specifiers are not rewritten.
22
+
23
+ Browser and worker presets change the available APIs, not module resolution. JSX and framework settings remain consumer-owned.
24
+ All presets target ECMAScript 2025. They do not provide polyfills.
25
+
26
+ ## Source and test projects
27
+
28
+ Use an empty root `tsconfig.json` to list the projects:
29
+
30
+ ```json
31
+ {
32
+ "files": [],
33
+ "references": [{ "path": "./source/tsconfig.sources.json" }, { "path": "./source/tsconfig.unit-tests.json" }]
34
+ }
35
+ ```
36
+
37
+ For a Node project, `source/tsconfig.sources.json` can contain:
38
+
39
+ ```json
40
+ {
41
+ "extends": "@enormora/tsconfig-node/tsconfig.json",
42
+ "compilerOptions": {
43
+ "rootDir": "..",
44
+ "outDir": "../target/build",
45
+ "tsBuildInfoFile": "../target/buildcache/sources.tsbuildinfo"
46
+ },
47
+ "include": ["./**/*.ts"],
48
+ "exclude": ["./**/*.test.ts"]
49
+ }
50
+ ```
51
+
52
+ The test project selects the tests and references the source project:
53
+
54
+ ```json
55
+ {
56
+ "extends": "@enormora/tsconfig-node/tsconfig.json",
57
+ "compilerOptions": {
58
+ "rootDir": "..",
59
+ "outDir": "../target/build",
60
+ "tsBuildInfoFile": "../target/buildcache/unit-tests.tsbuildinfo"
61
+ },
62
+ "references": [{ "path": "./tsconfig.sources.json" }],
63
+ "include": ["./**/*.test.ts"]
64
+ }
65
+ ```
66
+
67
+ Build the graph with `tsc --build --stopBuildOnErrors`. Each leaf project inherits `composite: true`.
68
+ The empty solution config needs no compiler options. Give each leaf a unique build-cache path.
69
+ Only exclude files that overlap your includes, such as colocated tests in the source project above.
70
+
71
+ For a browser/server application, choose the browser preset for client code, the Node preset for server code and Node-based tests,
72
+ and the base preset for shared modules. Reference the shared project from the client and server projects.
73
+
74
+ ## Build behavior
75
+
76
+ The same preset works for applications and libraries. There are no separate app, library, or checking presets.
77
+ Declarations support project references; declaration maps support navigation across project boundaries.
78
+ `isolatedDeclarations` is not required for ordinary declaration generation.
79
+
80
+ If another tool emits JavaScript, set `emitDeclarationOnly: true` locally to retain declaration output for downstream references.
81
+ Use `noEmit: true` only for standalone checks, not projects consumed by other projects in the graph.
82
+ Node can also execute erasable TypeScript source directly; it ignores compiler settings at runtime.
83
+
84
+ Strict checking includes exact optional properties, checked indexed access, explicit index-signature access,
85
+ override checks, checked side-effect imports, unused-code checks, and declaration checking.
86
+ Enums and parameter properties are rejected. Unreachable code, unused labels, switch fallthrough, and incomplete returns are errors.
87
+
88
+ `types` and `lib` arrays replace inherited arrays. When overriding Node types, retain `"@enormora/tsconfig-node"`.
89
+ Imported packages may introduce additional global declarations.
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
3
+ "bomFormat": "CycloneDX",
4
+ "specVersion": "1.6",
5
+ "version": 1,
6
+ "metadata": {
7
+ "tools": {
8
+ "components": [
9
+ {
10
+ "type": "application",
11
+ "name": "packtory",
12
+ "version": "0.0.125"
13
+ }
14
+ ]
15
+ },
16
+ "component": {
17
+ "type": "library",
18
+ "name": "@enormora/tsconfig",
19
+ "version": "0.0.2",
20
+ "bom-ref": "pkg:npm/@enormora/tsconfig@0.0.2",
21
+ "purl": "pkg:npm/@enormora/tsconfig@0.0.2"
22
+ }
23
+ },
24
+ "components": [],
25
+ "dependencies": [
26
+ {
27
+ "ref": "pkg:npm/@enormora/tsconfig@0.0.2"
28
+ }
29
+ ]
30
+ }
package/worker.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "./base.json",
3
+ "compilerOptions": {
4
+ "lib": [
5
+ "ES2025",
6
+ "WebWorker",
7
+ "WebWorker.Iterable"
8
+ ]
9
+ }
10
+ }