@coldsmirk/tsconfig 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Venus
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,68 @@
1
+ # @coldsmirk/tsconfig
2
+
3
+ Opinionated base TypeScript configs — strict, `bundler` module resolution, ESM-first.
4
+
5
+ Three variants, matched to the project shapes used here:
6
+
7
+ - **`@coldsmirk/tsconfig/base`** — framework-neutral, `bundler` module resolution. For bundler-driven projects (Vite, tsdown, …). No `lib: DOM`, no `jsx`.
8
+ - **`@coldsmirk/tsconfig/node`** — extends `base`, swaps to `nodenext` module resolution. For Node libraries emitted directly by `tsc` (no bundler), where `bundler` resolution would let invalid imports compile but break at runtime.
9
+ - **`@coldsmirk/tsconfig/react`** — extends `base`, adds `lib: ["ESNext", "DOM", "DOM.Iterable"]` and `jsx: "react-jsx"`.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pnpm add -D @coldsmirk/tsconfig typescript
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ A bundler-driven project (Vite, tsdown, …) — `tsconfig.json`:
20
+
21
+ ```jsonc
22
+ {
23
+ "extends": "@coldsmirk/tsconfig/base",
24
+ "compilerOptions": {
25
+ "outDir": "dist",
26
+ "noEmit": true // tsc type-checks; the bundler emits
27
+ },
28
+ "include": ["src"]
29
+ }
30
+ ```
31
+
32
+ A Node library emitted by `tsc` directly (no bundler):
33
+
34
+ ```jsonc
35
+ {
36
+ "extends": "@coldsmirk/tsconfig/node",
37
+ "compilerOptions": {
38
+ "outDir": "dist",
39
+ "declaration": true // /node already sets nodenext resolution
40
+ },
41
+ "include": ["src"]
42
+ }
43
+ ```
44
+
45
+ A React project:
46
+
47
+ ```jsonc
48
+ {
49
+ "extends": "@coldsmirk/tsconfig/react",
50
+ "compilerOptions": {
51
+ "types": ["vite/client"]
52
+ },
53
+ "include": ["src"]
54
+ }
55
+ ```
56
+
57
+ ## What stays in your project
58
+
59
+ The base intentionally **does not** set anything path-, environment-, or build-target-specific — keep these local because they differ per repo:
60
+
61
+ - `outDir` / `rootDir` / `include` / `paths` / `baseUrl`
62
+ - `target` override (the base targets `esnext`)
63
+ - `customConditions` (e.g. `["source"]`), `types` (e.g. `["node", "vitest/globals"]`)
64
+ - `noEmit` vs emit settings, `composite`/`declaration` for project references
65
+
66
+ ## License
67
+
68
+ MIT
package/base.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "@coldsmirk/tsconfig/base",
4
+ "compilerOptions": {
5
+ "target": "esnext",
6
+ "module": "esnext",
7
+ "moduleResolution": "bundler",
8
+ "moduleDetection": "force",
9
+ "lib": [
10
+ "ESNext"
11
+ ],
12
+ "useDefineForClassFields": true,
13
+ "resolveJsonModule": true,
14
+ "allowImportingTsExtensions": false,
15
+ "verbatimModuleSyntax": true,
16
+ "isolatedModules": true,
17
+ "erasableSyntaxOnly": true,
18
+ "forceConsistentCasingInFileNames": true,
19
+ "strict": true,
20
+ "noImplicitOverride": true,
21
+ "noImplicitReturns": true,
22
+ "noFallthroughCasesInSwitch": true,
23
+ "noUncheckedIndexedAccess": true,
24
+ "noUnusedLocals": true,
25
+ "noUnusedParameters": true,
26
+ "allowUnreachableCode": false,
27
+ "allowUnusedLabels": false,
28
+ "noUncheckedSideEffectImports": true,
29
+ "noErrorTruncation": true,
30
+ "skipLibCheck": true
31
+ }
32
+ }
package/node.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "@coldsmirk/tsconfig/node",
4
+ "extends": "./base.json",
5
+ "compilerOptions": {
6
+ "module": "nodenext",
7
+ "moduleResolution": "nodenext"
8
+ }
9
+ }
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@coldsmirk/tsconfig",
3
+ "version": "0.1.0",
4
+ "description": "Opinionated TypeScript configs: strict, ESM-first. `/base` (bundler resolution), `/node` (nodenext), and `/react` (base + JSX + DOM).",
5
+ "keywords": [
6
+ "tsconfig",
7
+ "typescript",
8
+ "tsconfig-base"
9
+ ],
10
+ "homepage": "https://github.com/coldsmirk/canon/tree/main/packages/tsconfig#readme",
11
+ "bugs": "https://github.com/coldsmirk/canon/issues",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/coldsmirk/canon.git",
15
+ "directory": "packages/tsconfig"
16
+ },
17
+ "license": "MIT",
18
+ "author": {
19
+ "name": "Venus"
20
+ },
21
+ "type": "commonjs",
22
+ "exports": {
23
+ "./base": "./base.json",
24
+ "./node": "./node.json",
25
+ "./package.json": "./package.json",
26
+ "./react": "./react.json"
27
+ },
28
+ "files": [
29
+ "base.json",
30
+ "node.json",
31
+ "react.json"
32
+ ],
33
+ "engines": {
34
+ "node": ">=22"
35
+ },
36
+ "publishConfig": {
37
+ "access": "public"
38
+ }
39
+ }
package/react.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "@coldsmirk/tsconfig/react",
4
+ "extends": "./base.json",
5
+ "compilerOptions": {
6
+ "lib": ["ESNext", "DOM", "DOM.Iterable"],
7
+ "jsx": "react-jsx"
8
+ }
9
+ }