Skip to content

build(deps): modernize the TypeScript tree (TS 6.0.3, lockfile) — supersedes #28 - #31

Merged
docxology merged 1 commit into
mainfrom
fix/typescript-deps-lock
Nov 13, 2026
Merged

docxology merged 1 commit into
mainfrom
fix/typescript-deps-lock

Conversation

@docxology

Copy link
Copy Markdown
Collaborator

Supersedes #28.

Why #28 could not land

0_CONTEXT/Computer_Languages/TypeScript had no lockfile, so Dependabot resolved the
group at install time. The proposed set pairs TypeScript 7.0.2 with
@typescript-eslint 8.72.2, whose published peer range is
typescript >=4.8.4 <6.1.0. npm install therefore fails ERESOLVE, and forcing
it with --legacy-peer-deps then fails tsc (TS5108: Option 'moduleResolution=node10' has been removed) and crashes ts-node on TS 7.

This PR is the companion migration: the tree is modernised within the ranges the
published plugins actually support. It does not adopt TypeScript 7. No
--legacy-peer-deps, --force, or overrides entry is used.

Version selection (read from npm, 2026-11-12)

$ npm view @typescript-eslint/parser version peerDependencies
8.72.2
{ "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
  "typescript": ">=4.8.4 <6.1.0" }

$ npm view @typescript-eslint/eslint-plugin version peerDependencies
8.72.2
{ "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
  "typescript": ">=4.8.4 <6.1.0",
  "@typescript-eslint/parser": "^8.72.2" }

8.72.2 is the newest published plugin set. The newest stable TypeScript inside
<6.1.0 is 6.0.3, so typescript is pinned to ~6.0.3.

ts-jest 29.4.15 was added because it is the published transform that peers
typescript >=4.3 <7 and jest ^29 || ^30. ts-node 10.9.2 does not run on the
selected compiler generation, so the ESM dev/demo entries use tsx 4.23.15.

Dependency changes

Package Before After
typescript ^5.1.6 (resolved 5.9.3) ~6.0.3
eslint ^8.45.0 ^10.14.0
@typescript-eslint/{parser,eslint-plugin} ^6.2.0 ^8.72.2
@types/node ^20.4.5 ^26.6.6
mathjs ^11.9.1 ^15.2.0
plotly.js ^2.25.2 ^4.3.0
jest ^29.6.1 ^30.5.2
ts-jest — ^29.4.15
tsx — ^4.23.15
ts-node ^10.9.1 removed
engines.node >=16.0.0 >=22.13.0 (plotly.js 4 / eslint 10 floors)

Lockfile and install path

  • Added package-lock.json (lockfileVersion 3), resolving the exact published set.
  • run.sh now runs npm ci and fails if the lockfile is missing; it no longer
    installs a global tsc.
  • The absence of a lockfile is the reason Dependabot's set was unsatisfiable:
    each group entry was resolved independently with no fixed tree to validate.

Compiler / lint configuration

  • tsconfig.json: module and moduleResolution are now NodeNext (the sources
    already import with explicit .js extensions under "type": "module");
    node10/node is gone.
  • TypeScript 6 defaults types to [], so "types": ["node", "jest"] is explicit.
  • Added eslint.config.js, a flat config for ESLint 10 using the installed
    @typescript-eslint parser/plugin and its recommended rules.
  • npm run lint is now eslint . (the old shell glob missed src/ root files).
  • Added src/index.ts, the entry point package.json#main and npm start already
    pointed at but which did not exist.

Baseline diagnostics: 54 → 0

At base (c309595) tsc --noEmit reported 54 errors in 3 files. All were
fixed in source; none are suppressed with @ts-ignore, and skipLibCheck was
already true at base and was not widened.

  • types.ts: removed a declare module 'mathjs' block that redeclared Matrix.size
    incompatibly, imported the previously-missing ActiveInferenceAgent type, and
    made the two mutated BeliefState fields non-readonly.
  • ActiveInferenceAgent.ts: narrowed unknown catch values, guarded
    noUncheckedIndexedAccess lookups (transition matrix, vector width, best EFE),
    and converted mathjs scalar results to numbers.
  • ant-colony-demo.ts: added checked cell accessors instead of raw
    grid[y][x] indexing, replaced Record<string, any> statistics with concrete
    interfaces, typed the belief row, and used the same error narrowing.

Evidence (local commands, all exit 0)

npm ci                 # 601 packages, no ERESOLVE
npm run type-check     # tsc --noEmit, 0 diagnostics
npm run build          # emits dist/
npm run lint           # eslint .
npm test               # 4 passed, 1 suite
npm run demo           # tsx demo path
bash run.sh            # npm ci + build + npm start, full demo

npm test previously matched zero files. It now runs four tests covering
posterior normalisation, an in-range perception-action step with history,
finite free-energy components, and invalid configuration rejection.

Hosted Actions are billing-locked and were not used as evidence.

Dependabot's grouped bump proposed TypeScript 7 with @typescript-eslint 8,
which cannot resolve: the published peer range is >=4.8.4 <6.1.0. The tree
had no lockfile, so Dependabot resolved an unsatisfiable set at install time.

- select TypeScript 6.0.3, the newest release inside the peer range
- upgrade eslint to 10, @typescript-eslint to 8.72.2, @types/node to 26,
  mathjs to 15, plotly.js to 4, jest to 30 with ts-jest ESM transform
- replace ts-node with tsx for the ESM dev/demo entry points
- commit package-lock.json and use npm ci in run.sh
- move tsconfig to NodeNext plus TS6 explicit types; add eslint flat config
- fix all 54 pre-existing diagnostics; add src/index.ts entry point
- add four agent tests (jest previously matched zero files)
@docxology
docxology merged commit 06987c7 into main Nov 13, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant