Repository navigation
deps(js): take TypeScript 6, and the TS5107 that hides 64 errors behind 1 - #338
Merged
Merged
Conversation
Dependabot's #309 bumped eslint to 10.x alone. That could not be merged: eslint 10 does not read package.json's `eslintConfig` block at all, so the bump would have silently discarded every rule this SDK lints with — including the config fix that had just landed for the same file — and left `npm run lint` either erroring or running with defaults, depending on how it was invoked. So the block moves to sdks/javascript/eslint.config.js, as a port and not a rewrite: same five rules, same severities. Three translation points are recorded in the file, because none of them is visible from a version diff — flat config has no `extends`, `env` splits into `globals` plus `ecmaVersion`, and `.eslintignore` is no longer read so `dist/**` has to be an `ignores` entry or the emitted JavaScript gets linted as source. typescript-eslint 8 then found two real defects, because it defaults `caughtErrors: 'all'` and reports every discarded catch binding. Six of the eight sites were deliberate and are renamed `_error`. The other two threw a new error while dropping the cause of the original: - findBinary() reported every execSync('which objectfs') failure as "not found in PATH", which sends the reader to the wrong place when the cause was a permissions failure or an unwritable cwd. - prepareMountPoint() reported every `access` rejection as "insufficient permissions", including ENOENT for a mount point that does not exist. Both now include the cause. Test files are linted now, which they were not before, and that found a third thing: index.test.ts disabled `@typescript-eslint/no-var-requires`, a rule typescript-eslint 8 renamed to `no-require-imports`, so the directive had been suppressing nothing. Verified: `npm run lint` 0 errors / 19 warnings (all no-explicit-any, `warn` by design), `npm run build` emits dist/, `npm test` 65/65. The config itself was mutation-checked — an unused binding and a formatting violation were introduced and both reported as errors, so the rules are enforced rather than merely present.
… deps/eslint-10-flat-config
…nd 1 Closes #328. typescript ^5->^6, typedoc ^0.24->^0.28.20, jest and @types/jest ^29->^30, plus two tsconfig keys. ts-jest stays at ^29.1.0 — its 29.4.12 already peers <7, so it admits 6. The first key is the trap. TS6 deprecates moduleResolution: "node" and raises TS5107, but TS5107 is a CONFIG-level error, so tsc exits before typechecking any source. It reports 1 error, which reads like a nearly-clean bump; 64 wait behind it, all @types/node no longer being auto-included. Both keys mutation-checked rather than assumed: removing ignoreDeprecations gives exactly the 1 TS5107; removing types:[node] gives 64 across six codes (29 TS2584, 18 TS2591, 10 TS2304, 4 TS7006, 2 TS2339, 1 TS2503). #328 predicted 63 from a scratch copy — the real number here is 64. moduleResolution deliberately does not move: it cannot move alone (TS5110), and moving it with module makes ts-jest warn TS151002 on every suite. Verified from a clean npm ci, since sdk-metrics installs that way: tsc 0 errors, 65 tests in 4 suites, lint 0 errors / 19 warnings, and npm run docs — the one step of the four CI does not gate. Running that ungated step found a second thing. markdownFiles() walked the filesystem while its doc comment said 'tracked', so TypeDoc's output was scanned as repository documentation; it copies CONTRIBUTING.md into docs/media/ where the copy's relative links resolve against the wrong base. Now git ls-files, which inherits .gitignore and cannot drift from it. Same 38 real documents; the two dropped are generated, TypeDoc's copy and a .pytest_cache README the old walk had also been reading.
Three conflicts, all the same shape: #335 (eslint 10) merged to main, and this branch was cut from #335's tip, so package.json, its lockfile and CHANGELOG all carry both sets of changes. Ours in every case — main's side is the pre-bump value this PR exists to replace. Verified the merged manifest keeps both stacks: typescript ^6, typedoc ^0.28.20, jest and @types/jest ^30 from here; eslint ^10.8.0, typescript-eslint ^8.66.0, globals ^17.9.0 from #335. Lockfile confirmed in sync via npm install --package-lock-only producing no further diff. Re-ran the gates from a clean npm ci after resolving, not before: tsc 0 errors, 65 tests, lint 0 errors / 19 warnings.
Two golangci-lint findings on the git ls-files switch, both real:
noctx — os/exec.Command must not be called, use CommandContext. t.Context()
ties the subprocess to the test's lifetime, so a hung git cannot
outlive the test that spawned it.
modernize — ranging over strings.SplitSeq avoids materializing the whole slice.
Neither suppressed. Verified with the command CI runs,
golangci-lint run --new-from-merge-base=origin/main: 0 issues.
Also documents why -z is there: a path may contain a newline, and git ls-files
without -z quotes those instead of emitting them, which would need unquoting to
match the filesystem.
scttfrdmn
enabled auto-merge (squash)
August 4, 2026 04:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #328.
Base is
deps/eslint-10-flat-config(#335), notmain— both PRs changesdks/javascript/package.jsonand its lockfile, and #335 is already on its third CHANGELOG conflict resolution. This retargets tomainautomatically when #335 merges.The change
typescript^5→^6,typedoc^0.24→^0.28.20,jestand@types/jest^29→^30, plus twotsconfig.jsonkeys.ts-jeststays at ^29.1.0 — its 29.4.12 already peers<7, so it admits 6.The trap, which is the reason this is worth a careful PR
TypeScript 6 deprecates
moduleResolution: "node"and raises TS5107. But TS5107 is a config-level error, sotscexits before typechecking any source. It reports 1 error — which reads like a nearly-clean bump. 64 wait behind it. A partial fix here looks like a regression rather than progress.The 64 are all
@types/nodefailing to resolve; TypeScript 6 no longer auto-includes it. Bumping@types/nodedoes not help —typesVersions-only, noexportsmap.Mutation-verified, not assumed
tsc --noEmitignoreDeprecationstypes: ["node"]#328 predicted 63 from a scratch copy. The real number here is 64. Small, but it is the difference between a measured claim and a carried-over one.
moduleResolutiondeliberately does not move: it cannot move alone (TS5110 —modulemust move too), and moving both makests-jestwarn TS151002 on every suite. Keepingmodule: commonjsand acknowledging the deprecation is the quieter option; both keys carry comments saying so, sincetsconfig.jsonis JSONC and takes real comments.Gates, from a clean
npm cisdk-metricsinstalls withnpm ci, so verifying against my incrementally-updatednode_moduleswould not have proven anything. Fromrm -rf node_modules && npm ci:tsc --noEmit→ 0 errorsnpm test→ 65 passed, 4 suitesnpm run lint→ 0 errors, 19 warnings (allno-explicit-any,warnby design)npm run docs→html generated— the one step of the four CI does not gate, andtypedocmoved four minors, so Bump the JavaScript SDK to TypeScript 6: two tsconfig keys, and the TS5107 that hides 63 errors behind 1 #328 asked for it to be run by handRunning that ungated step found a second, unrelated defect
markdownFiles()ininternal/config/docs_test.gosaid "every tracked markdown file" in its doc comment and then walked the filesystem with a skip-list. So TypeDoc's output was scanned as repository documentation — and TypeDoc copiesCONTRIBUTING.mdintodocs/media/, where the copy's relative links resolve against the wrong base directory.TestDocumentedLinksResolvefailed on a link that is correct in the original file.Now
git ls-files, which inherits.gitignoreand cannot drift from it, where a skip-list can only ever name generators someone has already run — the same shape as every other "nothing had run this" finding in this release./sdks/javascript/docs/is gitignored too.Coverage is unchanged where it matters: 38 tracked documents checked, same as before. The two files dropped are both generated — TypeDoc's copy and a
.pytest_cache/README.mdthe old walk had also been reading. Mutation-checked by appending a deliberate broken link toREADME.mdand confirming the test still fails on it.