]> git.ardis.lu - csvio/commitdiff
Migrate from CLI options to explicit `tsconfig.json`
authorArdis Lu <ardisglu@gmail.com>
Sun, 25 May 2025 04:24:08 +0000 (21:24 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sun, 25 May 2025 04:24:08 +0000 (21:24 -0700)
This change makes it easier to use an explicit `lib` configuration and types, which resolves type issues resulting from subtle mismatches between implied type imports (e.g., some files importing `ReadableStream` from TS's built-in Web API types and others importing from Node.js's `streams/web`).

package.json
tsconfig.json [new file with mode: 0644]

index 36dfb7fca0c6ba2f1d74927c2df1169bf6faa1a0..6270d523b250986574a1a110a592aa0be53ee549 100644 (file)
     }
   },
   "scripts": {
-    "types": "tsc ./src/index.js --allowJs --declaration --emitDeclarationOnly --declarationMap --outFile ./types/index.d.ts",
+    "types": "tsc",
     "test": "node --test --test-skip-pattern=\"/^large:/\"",
     "test:large": "node --test --test-name-pattern=\"/^large:/\"",
     "test:coverage": "npm run test -- --experimental-test-coverage",
     "bench": "node ./benchmark/core.bench.js"
   },
   "devDependencies": {
+    "@types/node": "^22.15.21",
     "typescript": "^5.8.3"
   }
 }
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644 (file)
index 0000000..889a8bc
--- /dev/null
@@ -0,0 +1,14 @@
+{
+  "files": ["./src/index.js"],
+  "compilerOptions": {
+    "target": "ESNext",
+    "lib": ["ESNext"],
+    "module": "NodeNext",
+    "allowJs": true,
+    "declaration": true,
+    "declarationMap": true,
+    "emitDeclarationOnly": true,
+    "outFile": "./types/index.d.ts",
+    "strict": true
+  }
+}
This page took 0.039398 seconds and 4 git commands to generate.