From: Ardis Lu Date: Sun, 25 May 2025 04:24:08 +0000 (-0700) Subject: Migrate from CLI options to explicit `tsconfig.json` X-Git-Tag: v0.1.0~18 X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=d0deeeb01f897aa4091de8e0226b30463f189643;p=csvio Migrate from CLI options to explicit `tsconfig.json` 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`). --- diff --git a/package.json b/package.json index 36dfb7f..6270d52 100644 --- a/package.json +++ b/package.json @@ -20,13 +20,14 @@ } }, "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 index 0000000..889a8bc --- /dev/null +++ b/tsconfig.json @@ -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 + } +}