Skip to content

Pin typescript to ~5.3.3 for parser compatibility#85

Merged
corinnejean merged 1 commit into
developfrom
bugfix/pin-typescript-parser-compat
Jul 16, 2026
Merged

Pin typescript to ~5.3.3 for parser compatibility#85
corinnejean merged 1 commit into
developfrom
bugfix/pin-typescript-parser-compat

Conversation

@corinnejean

Copy link
Copy Markdown
Contributor

Problem

Linting started failing across all consuming projects — including repos with no code changes — with:

TypeError: Failed to load parser '@typescript-eslint/parser' declared in '--config':
Cannot read properties of undefined (reading 'BarBarToken')
    at .../springroll-automated-qa/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js:35:16

Root cause

springroll-automated-qa bundles @typescript-eslint/parser@5.x (via ^5.47.0), which only supports TypeScript < 5.4. But typescript was never pinned, so it was pulled in transitively. When TypeScript 7.0 was published to npm, every fresh install (npm i -g springroll-automated-qa in lint.sh) resolved to it. The v5 parser's typescript-estree reads ts.SyntaxKind.BarBarToken, which no longer exists in TS 7 → crash on load, before any project code is even parsed.

Nothing changed in the consuming games — the trigger was purely the upstream TypeScript release combined with our floating dependency.

Note: pinning typescript in a consuming project's package.json does not fix this, because srlint runs as a global install and resolves typescript from its own node_modules. The fix has to live here.

Fix

Pin typescript to ~5.3.3 (the newest release within the bundled parser's supported range) as a direct dependency, so the whole tree — including typescript-estree — resolves to a compatible version.

Verification

Reproduced the crash against a real game repo, then confirmed with this build:

  • srlint -p src/ on the affected game repo → exit 0, no crash (was crashing on load before).
  • Sanity-checked that linting still works: a file with var, ==, and for...of is correctly flagged (no-var, eqeqeq, no-restricted-syntax) — so this restores real linting, not a silent pass.
  • Lockfile diff is minimal: typescript moves from a floating 5.6.3 (peer) to a pinned 5.3.3.

🤖 Generated with Claude Code

The bundled @typescript-eslint/parser@5.x only supports TypeScript
< 5.4. TypeScript was unpinned, so fresh installs pulled in TS 7.0,
causing every lint run to crash with:

  TypeError: Failed to load parser '@typescript-eslint/parser'
  ... Cannot read properties of undefined (reading 'BarBarToken')

This broke linting across all consuming projects with no code
changes on their end. Pinning typescript to ~5.3.3 keeps it within
the parser's supported range.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@corinnejean
corinnejean merged commit 14e4de1 into develop Jul 16, 2026
5 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.

2 participants