Repository navigation
chore: bump stack to TypeScript 7, oxlint and @swc/jest - #26
Conversation
…st to @swc/jest - Replace eslint/typescript-eslint with oxlint (config migrated via @oxlint/migrate) - Replace ts-jest with @swc/jest (ts-jest does not support TypeScript 7) - Transform ESM-only nock 15 and its deps in jest - Adapt oauth2 tests to nock 15 reply callback API - Remove unused ts-node, nodemon and quicktype - Add explicit node types to tsconfig (TS 6+ default types: [])
There was a problem hiding this comment.
Note
Reviewed — No blocking findings · 🔵 2 minor points
🔍 Full review · 10 files reviewed
🔵 Minor points
package.json:53— The PR is described as a dev-stack bump, but it also raises the only runtime dependency,dotenv, from^17.3to^18.0.10(lockfile: 17.4.2 → 18.0.10). The description does not mention this, and dotenv is installed for every consumer of the published package. dotenv 18 ships a new bundled CJS build (dist/index.cjs), adds adotenvCLI bin, and changes howconfig()logs: unlessquietis set, it prints◇ injected env (N) from …throughconsole.error.src/app.tscallsdotenv.config()without options, so it now writes that line to stderr. A major-version change to a shipped dependency should be stated, or done in its own PR.jest.config.js:9— Jest no longer readstsconfig.test.json: the oldtsconfig: 'tsconfig.test.json'option was removed, and the swc config sets its own options. No npm script or workflow references the file either, so it is now dead configuration. Itstypes: ["jest", "node"]andisolatedModulessettings suggest it still controls how tests are compiled, but it does not. Also, swc only strips types, so test files are never type-checked. The PR admitstsc -p tsconfig.test.jsonalready fails, and no CI job runs it, so type errors in tests now go unnoticed.
Verification
.oxlintrc.jsonports the old src override:no-unused-varsoff,explicit-function-return-typeandno-explicit-anyas warn,no-consolewarn,prefer-const/no-varerror, and the same ignore paths.- The removed
@typescript-eslint/no-var-requiresrule is covered bytypescript/no-require-imports: errorin the new config. - No README, workflow or script references
lint:es,fix:es,eslint,ts-jest,ts-node,nodemonorquicktypeany more;src/app.ts'seslint-disablecomment is a directive oxlint also honours. - nock 15 needs Node >=22.20.0, which is covered by the CI matrix (22.x/24.x/26.x) and by the Node 22 used in compare-signatures.
- The rewritten nock reply callbacks read the fetch
Requestwithreq.headers.getandawait req.text(), and the refresh-fallback test still tells requests apart by checking the body forrefresh_token.
Two CI jobs in develop.yml cover this change: the Code Quality job runs npm run lint:all (now oxlint plus prettier), and the test matrix runs npm run test:unit through @swc/jest on Node 22, 24 and 26. The only test changes are the nock 15 callback updates in oauth2-client.test.ts and the Mock generics in environments.test.ts. No job type-checks the tests, and the docs and coverage steps are disabled (if: false).
Review details
- Commit: 29fa04e
- Model: claude-opus-5-5
Review 1 of 10 for this pull request · View the full run
…otenv 17 - Restore nock after each test file: it patches shared Node core modules and leaked interception into the next suite of the same worker (CI oauth2-client failures) - Add lint:types (tsc -p tsconfig.test.json) to lint:all and fix test type errors - Revert dotenv to ^17.3 (runtime dependency, out of scope for a dev-stack bump) - Bump @types/node to ^26.6.6 and oxlint to ^1.94.0
- Code Quality has no generated client (src/api, src/model are gitignored), so the test type-check moves out of lint:all into test:types, run after spec:generate - tsconfig.test.json: disable incremental so it no longer shares dist/.tsbuildinfo with the build (stale cache produced bogus missing-export errors)
Upsun SDK checker reportDisplay raw output |
There was a problem hiding this comment.
Note
Reviewed — No blocking findings · ⚪ 1 nitpick
🔍 Full review · 16 files reviewed
⚪ Nitpick
scripts/help.sh:12— The newtest:typesentry is inserted betweenlint:oxandlint:prettier, breaking the alphabetical ordering the rest of the help list follows.
Verification
- package.json and the lockfile keep dotenv at ^17.3 / 17.4.2, so the runtime dependency is unchanged.
- No file outside package-lock.json still references lint:es, fix:es, ts-jest, ts-node, nodemon or quicktype; remaining
eslint-disablecomments are honoured by oxlint. - The
src/**/*.tsoverride in .oxlintrc.json reproduces every rule from the deleted eslint.config.js src block; no-var-requires is covered bytypescript/no-require-imports, set to error for all files, and tests/** stays ignored. - tsconfig.test.json sets incremental:false and noEmit and adds jest to the types list, so
test:typesno longer writes to dist/.tsbuildinfo, which the build shares. - tests/setup.ts calls
nock.restore()in afterAll; each test file loads a fresh nock module, which re-activates interception on import.
The develop.yml test job now runs npm run test:types after spec:generate on Node 22/24/26, and the Code Quality job runs npm run lint:all (oxlint + prettier); the swc/nock 15 jest setup is covered only by running the existing unit tests (npm run test:unit). No test checks that the transformIgnorePatterns whitelist covers every ESM-only dependency of nock 15.
Review details
- Commit: 952536e
- Model: claude-opus-5-5
Review 2 of 10 for this pull request · View the full run
Bump the dev stack. TypeScript 7 broke
npm install(ts-jestandtypescript-eslintrequire TS < 7).Changes
.oxlintrc.jsonmigrated via@oxlint/migrate, same rules). Scriptslint:es/fix:es→lint:ox/fix:ox.jest.mockhoisting kept).npm run test:types(tsc -p tsconfig.test.json), run in the test job right afterspec:generate(the generated client is not committed, so it cannot run in Code Quality). Pre-existing type errors in tests were fixed.transformIgnorePatterns. Tests adapted to the nock 15 reply callback API (single fetchRequest), andtests/setup.tsrestores nock after each file (it patches shared Node core modules and leaked into the next suite of the same worker).tsconfig.json: explicit"types": ["node"](TS 6+ defaults to[]).tsconfig.test.json:incremental: falseso it no longer sharesdist/.tsbuildinfowith the build.@types/node^26.6.6,oxlint^1.94.0,jest,nock,prettier,typescript^7.0.2.ts-node,nodemon,quicktype(no reference in scripts/workflows).Runtime dependency unchanged:
dotenvstays on^17.3(a dotenv 18 bump, which logs to stderr unlessquiet, belongs in its own PR). No generated files (src/api,src/model) changed.Validation
npm run lint:all,npm run test:types,npm run build,npm test(693 tests, repeated runs with 2 workers) pass after merging currentmain.require/ dynamic import, and TS consumers (nodenextESM/CJS,bundler,preserve) with tsc 7 strict,skipLibCheck: false.Notes
@swc/corepostinstall by default (works anyway;npm install-scripts approve @swc/coreif needed).