Skip to content

fix(deps): revert typescript 7.0.2 -> 6.0.3 to fix broken ESLint - #3773

Open
aithal007 wants to merge 2 commits into
fosrl:mainfrom
aithal007:fix/typescript-eslint-ts7-incompatibility
Open

aithal007 wants to merge 2 commits into
fosrl:mainfrom
aithal007:fix/typescript-eslint-ts7-incompatibility

Conversation

@aithal007

Copy link
Copy Markdown

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

AI Disclosure

Claude Code (Anthropic) was used to trace the failure through the CI logs, git history, and typescript-eslint's own source to find the exact root cause, and to build and verify this fix. I directed the investigation and verified every claim myself, including bisecting the commit history, reproducing the crash locally, and confirming the fix with a clean ESLint/tsc run against the actual codebase.

Description

Summary

ESLint currently fails on every PR against main (and on main itself). The failure isn't a lint violation — it's a hard crash before any file is linted:

Error: typescript-eslint does not support TS 7.0.
    at Object.<anonymous> (node_modules/typescript-eslint/dist/index.js:52:11)

This is a runtime version guard inside typescript-eslint itself, distinct from npm's peer-dependency resolution, and it fires on every npx eslint invocation given the currently pinned versions.

Root cause (bisected via git history)

  1. c62fb6cbe ("Bump the npm-dependencies group... with 29 updates") bumped typescript 6.0.3 → 7.0.2 and typescript-eslint 8.68.0 → 8.70.0 in the same dependency-group update. typescript-eslint@8.70.0 doesn't support TS 7.0 yet — its own error message says to run it against the TS 6 API, and links the upstream issue tracking TS ≥7.1 support.
  2. 9d5dd526b ("Pin typescript"), 17 minutes later, reverted typescript back to 6.0.3 — this fixed it.
  3. 7ed646c02 ("Resolve eslint old ts issues and revert tanstack table") re-bumped typescript back to 7.0.2, alongside adding .npmrc's legacy-peer-deps=true with the comment "it works fine against it in practice." That re-introduced the crash.

The .npmrc addition doesn't (and can't) fix this: legacy-peer-deps only tells npm install to skip enforcing declared peer-dependency ranges (silencing an ERESOLVE warning at install time). It has no effect on typescript-eslint's own internal check, which runs later, at lint time, when the package loads and inspects the installed typescript version directly.

What changed

  • package.json: typescript 7.0.26.0.3 (the version already proven compatible by 9d5dd526b).
  • package-lock.json: regenerated for just this one package via npm install typescript@6.0.3 --package-lock-only. The entire diff is the removal of TypeScript 7's native per-platform compiler packages (@typescript/typescript-<platform>, new in TS 7, not present in 6.x) and their transitive deps — nothing else in the dependency tree changes.

.npmrc's legacy-peer-deps=true is left as-is; it isn't wrong on its own and removing it is out of scope for this fix.

Verification

  • npx eslint . --ext .js,.jsx,.ts,.tsx — was crashing before this change; now runs clean: 0 errors (4 pre-existing prefer-const warnings in unrelated files, untouched by this PR).
  • npx tsc --noEmit — passes with 0 errors on typescript@6.0.3, confirming nothing in the codebase relies on TS 7-only syntax or type-checker behavior.
  • Full OSS .test.ts suite — all pass except server/lib/traefik/traefikConfig.test.ts, which I confirmed fails identically on unmodified main (a pre-existing config-singleton initialization issue when that file is run standalone via tsx, unrelated to the TypeScript version — reproduced with this change stashed out).

How to test?

  1. npm install (picks up typescript@6.0.3 from the updated lockfile)
  2. npx eslint . --ext .js,.jsx,.ts,.tsx — should complete with 0 errors
  3. npx tsc --noEmit — should complete with 0 errors

🤖 Generated with Claude Code

`npx eslint . --ext .js,.jsx,.ts,.tsx` currently crashes on `main`:

    Error: typescript-eslint does not support TS 7.0.
        at Object.<anonymous> (node_modules/typescript-eslint/dist/index.js:52:11)

That's a hard runtime guard inside typescript-eslint@8.70.0 itself, thrown
when it loads and inspects the installed typescript version - it's a
separate check from npm's peer-dependency resolution.

Root cause: commit c62fb6c bumped both `typescript` (6.0.3 -> 7.0.2) and
`typescript-eslint` (8.68.0 -> 8.70.0) together. `typescript-eslint@8.70.0`
does not yet support TS 7.0 (its own error message points to running against
TS 6, and to the upstream issue tracking TS >=7.1 support). A same-day
follow-up (9d5dd52, "Pin typescript") reverted `typescript` back to 6.0.3
and fixed it, but a later commit (7ed646c, "Resolve eslint old ts issues")
re-bumped it back to 7.0.2 alongside an unrelated `.npmrc` change
(`legacy-peer-deps=true`), reintroducing the crash. That `.npmrc` addition
only silences `npm install`'s peer-dependency ERESOLVE warning; it cannot
suppress typescript-eslint's own internal version check, so it didn't (and
can't) fix this.

This reverts the `typescript` pin to 6.0.3, the last version confirmed
compatible with `typescript-eslint@8.70.0`, matching what 9d5dd52 already
established. `package-lock.json` is regenerated for just this one package via
`npm install typescript@6.0.3 --package-lock-only`; the diff is exactly the
removal of TS7's native per-platform compiler packages
(`@typescript/typescript-<platform>`, new in TS7, absent from 6.x), nothing
else changes.

Verified: `npx eslint . --ext .js,.jsx,.ts,.tsx` now runs clean (0 errors, 4
pre-existing unrelated warnings). `npx tsc --noEmit` also passes with no
errors, confirming nothing in this codebase relies on TS 7-only syntax. Ran
the full OSS `.test.ts` suite; all pass except one
(`server/lib/traefik/traefikConfig.test.ts`) that fails identically on
unmodified `main` - confirmed unrelated (a pre-existing config-initialization
issue when that file is run standalone, unrelated to TypeScript's version).

`.npmrc`'s `legacy-peer-deps=true` is left in place; it's not incorrect on
its own; and removing it is out of scope for this fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 16, 2026 08:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The lockfile has a critical native-package selection regression, and TypeScript remains unbounded in both manifests.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Reverts TypeScript to 6.0.3 to restore compatibility with typescript-eslint@8.70.0 and fix ESLint crashes.

Changes:

  • Updates the TypeScript dependency declaration.
  • Regenerates the lockfile and removes TypeScript 7 platform packages.
File summaries
File Summary Findings
package.json Changes TypeScript to the 6.0.3 line. Moderate: use exact 6.0.3 instead of ^6.0.3 (3 votes).
package-lock.json Resolves TypeScript 6.0.3 and updates dependency metadata. Critical: preserve sharp’s libc selectors (2 votes). Moderate: pin the root TypeScript specifier to 6.0.3 (1 vote).
Review details
  • Files reviewed: 1/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread package.json Outdated
"tsc-alias": "1.9.5",
"tsx": "4.23.13",
"typescript": "7.0.2",
"typescript": "^6.0.3",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks — you're right, and this wasn't intentional. npm install typescript@6.0.3 --package-lock-only applied npm's default save-prefix behind the scenes, so both package.json and the lockfile's root spec ended up as ^6.0.3 instead of the exact 6.0.3 I meant to pin. Since typescript-eslint@8.70.0's own peer range is <6.1.0, that range would have let a future install silently drift to an incompatible 6.1.x+ and reintroduce this exact crash.

Fixed in d0dbe8c — re-ran with --save-exact, so both package.json and the lockfile's root spec now pin exactly 6.0.3. Re-verified npx eslint . --ext .js,.jsx,.ts,.tsx still runs with 0 errors.

`npm install typescript@6.0.3 --package-lock-only` (used in the previous
commit) applies npm's default save-prefix, which wrote `^6.0.3` to both
package.json and the lockfile's root spec instead of an exact `6.0.3`. That
range permits any future 6.x (including 6.1.0+), but
typescript-eslint@8.70.0's own declared peer range is `<6.1.0`
(package-lock.json's typescript-eslint entry) - so a future fresh install or
lockfile refresh could silently resolve a 6.1.0+ typescript and reintroduce
the exact crash this fix addresses. Re-ran with --save-exact to pin exactly
6.0.3 in both manifests, matching what's actually resolved and tested.

Re-verified: `npx eslint . --ext .js,.jsx,.ts,.tsx` still 0 errors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

2 participants