Skip to content

deps(js): take eslint 10 by moving the config where eslint 10 reads it - #335

Merged
scttfrdmn merged 5 commits into
mainfrom
deps/eslint-10-flat-config
Aug 4, 2026
Merged

scttfrdmn merged 5 commits into
mainfrom
deps/eslint-10-flat-config

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Replaces #309, which could not be merged as opened.

Why the version bump alone was not mergeable

eslint 10 does not read package.json's eslintConfig block. It requires a flat eslint.config.js. With the bump applied and no such file, npm run lint either errors out or lints with default rules depending on the invocation — and either way every rule this SDK is configured with is gone. That would have quietly undone the config fix #327 had just landed for this same file, where the block was read but named a preset that did not resolve.

Dependabot cannot produce this PR: it bumps versions, and this release changed where configuration lives.

What is here

sdks/javascript/eslint.config.js, a port of the old block — same five rules, same severities. Three translation points are recorded in the file, since none is visible from a version diff:

  • Flat config has no extends. eslint:recommended → js.configs.recommended; plugin:@typescript-eslint/recommended → spread of tseslint.configs.recommended. The string forms are not accepted anywhere.
  • env: {node, es6} was two things at once and splits into languageOptions.globals and ecmaVersion.
  • .eslintignore is no longer read, so dist/** must be an ignores entry or the emitted JavaScript gets linted as source.

eslint-config-prettier is spread after the recommended presets, not before — its only job is turning off the stylistic rules those presets enable, so anything after it re-enables them.

Two real defects the bump surfaced

typescript-eslint 8 defaults caughtErrors: 'all', so every discarded catch binding reports. Eight sites did. I inspected each rather than blanket-renaming, and two were throwing a new error while dropping the cause of the original:

site before after
client.ts findBinary() every execSync('which objectfs') failure reported as "not found in PATH" includes the underlying message — a missing which, a permissions failure, or an unwritable cwd all land here and none of them is a missing binary
mount.ts prepareMountPoint() every access rejection reported as "insufficient permissions" includes the errno — access rejects ENOENT for a path that is simply gone

The other six are genuinely ignored, each already sitting above a comment saying so, and are renamed _error / _unlinkError, which caughtErrorsIgnorePattern: '^_' exempts.

A third thing, from linting test files

Test files are linted now; they were not before. Nothing in this config is type-aware, so the usual reason to exclude them does not apply. Doing so found that index.test.ts carried eslint-disable-next-line @typescript-eslint/no-var-requires — a rule typescript-eslint 8 renamed to no-require-imports — so the directive had been suppressing nothing.

Verification

  • npm run lint → 0 errors, 19 warnings, all no-explicit-any, which the config sets to warn deliberately. Matches the pre-change baseline of 0 errors / 23 warnings; the 4 that dropped were "file ignored by pattern" notices, now that tests are linted.
  • npm run build → tsc clean, dist/ emitted.
  • npm test → 65/65, 4 suites.
  • Mutation-checked: introducing an unused binding and a formatting violation into src/errors.ts took it to 3 errors; reverting returned it to 0. The rules are enforced, not merely present.
  • package-lock.json regenerated and confirmed in sync (npm install --package-lock-only produces no further diff).
  • CHANGELOG reference links verified (used-not-defined: []) and markdownlint diagnostics identical to the base branch (361 each side).

Closes #309

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.
CHANGELOG conflict only: #334's docs-site and codeql-v4 entries landed in the
same 'Fixed' section this branch adds its #309 entry to. Both kept, in the
order main has them.
@scttfrdmn
scttfrdmn enabled auto-merge (squash) August 4, 2026 03:39
CHANGELOG conflict only, third time: #291 (okhttp) and the docs-platform
lockfile both landed entries in the same 'Fixed' section this branch adds #309
to. All kept, in main's order.
@scttfrdmn
scttfrdmn merged commit 28d20d0 into main Aug 4, 2026
25 checks passed
scttfrdmn added a commit that referenced this pull request Aug 4, 2026
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.
@scttfrdmn
scttfrdmn deleted the deps/eslint-10-flat-config branch September 20, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: sdk Client SDKs (Python, Java, JavaScript) dependencies Dependency updates (Dependabot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant