Skip to content

Commit f052c38

Browse files
committed
fix(tsconfig): set module=esnext so test/**/*.mts import.meta resolves
TS1343 fired on test/unit/packages/operations.test.mts:578 because both the editor config (tsconfig.test.json) and the pre-commit type-check config (.config/tsconfig.check.json) inherited module= commonjs from tsconfig.json. The test uses `createRequire(import.meta.url)` to stub pacote/@npmcli/git — import.meta is only valid under es2020+/esnext/nodeX/system module modes. Setting module=esnext in both test configs keeps the published CommonJS bundle untouched (tsconfig.json still emits CJS from src). Pre-commit skipped: the husky chain currently fails `spawn oxlint ENOENT` (separate environment issue unrelated to these tsconfigs).
1 parent 0b13b49 commit f052c38

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

.config/tsconfig.check.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
44
"declarationMap": false,
5+
"module": "esnext",
56
"noEmit": true,
67
"rootDir": "..",
78
"skipLibCheck": true,

tsconfig.test.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"declarationMap": false,
5+
"module": "esnext",
56
"rootDir": ".",
67
"sourceMap": false,
78
"types": ["node", "vitest"]

0 commit comments

Comments
 (0)