Skip to content

fix(lint): decide the TypeScript 7 parser from every TypeScript in the repository — 3.9.2 - #333

Merged
piwi3910 merged 3 commits into
mainfrom
fix/ts7-subdirectory-typescript
Oct 26, 2026
Merged

piwi3910 merged 3 commits into
mainfrom
fix/ts7-subdirectory-typescript

Conversation

@piwi3910

Copy link
Copy Markdown
Contributor

Bug

3.9.0 (#324/#325) installs procoder's own typescript-eslint beside TypeScript 6 when the project's TypeScript is past tsESLintMaxMajor, because npm refuses typescript-eslint into a TS 7 project. TypescriptEslintFor(root) decided that from root/node_modules/typescript only.

In a repo laid out like Kuvryn Orbit (Go backend at the root, the app in web/ with TypeScript 7.0.2 at web/node_modules/typescript, nothing at the root) doctor reported GAP typescript-eslint (repo) missing ... manual: npm i -D typescript-eslint, and init would run the project-local install npm rejects with ERESOLVE. resolvedTSESLint had the same root-only view, so the owned copy was never resolved for the repo either.

Fix

  • anyTSPastRange(root) walks the repo (not into node_modules or dot directories, depth-bounded) for any installed TypeScript past the range. Any such location selects TypescriptEslintTS7.
  • TypescriptEslintFor (doctor, init, tools via cmd/procoder) and resolvedTSESLint (doctor, tools.Resolve) use it.
  • Lint time: tsESLintEntry already resolved per file (tsMajor walks up from the file, so web/src/a.ts finds web/node_modules/typescript). lintTSBaseline built one config from files[0] only; it now probes for a file past the range, so a mixed run uses the owned parser.

Test

TestTypescriptInASubdirectoryDecidesTheParser (internal/lint/ts7_test.go): TS 7 only under web/, TS 7 beside a TS 5 location, and TS 6 in a subdirectory. Failed on the old code (all three assertions on init choice, doctor resolution), passes now.

Not covered by a new test: the lintTSBaseline mixed-files probe. The full suite passed except TestSessionStartStaysInsideTheBudget, a 3s timing budget that tripped while the machine was loaded and passed on rerun.

@piwi3910 piwi3910 changed the title fix(lint): decide the TypeScript 7 parser from every TypeScript in the repository fix(lint): decide the TypeScript 7 parser from every TypeScript in the repository — 3.9.2 Oct 26, 2026
@piwi3910
piwi3910 merged commit 4e6476e into main Oct 26, 2026
12 checks passed
@piwi3910
piwi3910 deleted the fix/ts7-subdirectory-typescript branch October 26, 2026 11:23
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