chore: Upgrade eslint from v9.x to v10.x#5005
Open
seanrmilligan wants to merge 10 commits into
Open
Conversation
added 9 commits
July 15, 2026 10:24
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades the repo’s linting toolchain from ESLint v9 to v10 by migrating to the new flat config format (eslint.config.mjs), updating related devDependencies/scripts, and applying the auto-fixable formatting changes required to satisfy the new lint rules across src/, test/, and etc/.
Changes:
- Migrate ESLint configuration to flat config (
eslint.config.mjs) and fold.eslintignorebehavior into config ignores. - Upgrade ESLint and related plugins/config packages in
package.json/package-lock.json, and update lint scripts accordingly. - Apply widespread formatting/cleanup changes to satisfy ESLint v10 (mostly whitespace/typing tweaks), plus a few small refactors.
Reviewed changes
Copilot reviewed 93 out of 96 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/tools/unifed-utils.test.ts | Lint-driven spacing adjustment |
| test/unit/timeout.test.ts | Lint-driven spacing adjustment |
| test/unit/sdam/topology.test.ts | Lint refactor; introduces a test logic bug (see comments) |
| test/unit/sdam/server_selection.test.ts | Lint-driven spacing adjustment |
| test/unit/sdam/server_description.test.ts | Lint-driven spacing adjustment |
| test/unit/sdam/monitor.test.ts | Lint-driven spacing adjustment |
| test/unit/operations/list_collections.test.js | Lint-driven spacing adjustment |
| test/unit/operations/indexes.test.ts | Lint-driven spacing adjustment |
| test/unit/operations/client_bulk_write/command_builder.test.ts | Lint-driven spacing adjustment |
| test/unit/operations/aggregate.test.ts | Lint-driven spacing adjustment |
| test/unit/mongo_logger.test.ts | Lint-driven spacing adjustment + comment formatting |
| test/unit/mongo_client.test.ts | Lint-driven spacing adjustment |
| test/unit/error.test.ts | Lint-driven spacing adjustment |
| test/unit/cursor/aggregation_cursor.test.ts | Lint-driven spacing adjustment |
| test/unit/connection_string.test.ts | Lint-driven spacing adjustment |
| test/unit/commands.test.ts | Lint-driven spacing adjustment |
| test/unit/cmap/stream_description.test.js | Remove now-unneeded eslint disables + spacing |
| test/unit/cmap/handshake/client_metadata.test.ts | Lint-driven spacing adjustment |
| test/unit/cmap/connection_pool_events.test.ts | Lint-driven spacing adjustment |
| test/unit/client-side-encryption/providers/credentialsProvider.test.ts | Lint-driven spacing adjustment |
| test/unit/client-side-encryption/errors.test.ts | Lint-driven spacing adjustment |
| test/unit/client-side-encryption/client_encryption.test.ts | Lint-driven spacing adjustment |
| test/unit/change_stream.test.ts | Lint-driven spacing adjustment |
| test/unit/assorted/sessions_collection.test.js | Lint-driven spacing adjustment |
| test/unit/assorted/sessions_client.test.js | Lint-driven spacing adjustment |
| test/unit/assorted/collations.test.js | Lint-driven spacing adjustment |
| test/types/sessions.test-d.ts | Update tsd test typing to satisfy lint/type rules |
| test/tools/unified-spec-runner/schema.ts | Type formatting simplification |
| test/tools/mongodb-mock/src/server.js | Formatting of bitwise expressions |
| test/mongodb_bundled.ts | Use Error(..., { cause }) for improved error chaining |
| test/manual/tls_support.test.ts | Lint-driven spacing adjustment |
| test/lambda/mongodb/app.mjs | Disable no-console; simplify handler JSDoc/signature |
| test/integration/transactions/transactions.test.ts | Lint-driven spacing adjustment |
| test/integration/sessions/sessions.test.ts | Lint-driven spacing adjustment |
| test/integration/server-discovery-and-monitoring/topology_description.test.ts | Lint-driven spacing adjustment |
| test/integration/server-discovery-and-monitoring/server_discovery_and_monitoring.prose.test.ts | Lint-driven spacing adjustment |
| test/integration/retryable-writes/retryable_writes.spec.test.ts | Lint-driven spacing adjustment |
| test/integration/retryable-writes/non-server-retryable_writes.test.ts | Lint-driven spacing adjustment |
| test/integration/read-write-concern/write_concern.test.ts | Lint-driven spacing adjustment |
| test/integration/node-specific/resource_clean_up.test.ts | Lint-driven spacing adjustment |
| test/integration/node-specific/mongo_client.test.ts | Lint-driven spacing adjustment |
| test/integration/node-specific/cursor_async_iterator.test.js | Lint-driven spacing adjustment |
| test/integration/node-specific/client_encryption.test.ts | Lint-driven spacing adjustment |
| test/integration/node-specific/bson-options/utf8_validation.test.ts | Cleanup unused client variable/close logic + spacing |
| test/integration/node-specific/bson-options/use_bigint_64.test.ts | Lint-driven spacing adjustment |
| test/integration/node-specific/auto_encrypter.test.ts | Lint-driven spacing adjustment |
| test/integration/node-specific/abstract_cursor.test.ts | Lint-driven spacing adjustment |
| test/integration/node-specific/abort_signal.test.ts | Remove unused cursor variable/cleanup |
| test/integration/mongodb-handshake/mongodb-handshake.test.ts | Lint-driven spacing adjustment |
| test/integration/mongodb-handshake/mongodb-handshake.prose.test.ts | Lint-driven spacing adjustment |
| test/integration/index_management.test.ts | Lint-driven spacing adjustment |
| test/integration/crud/misc_cursors.test.ts | Minor refactor (left const) + spacing |
| test/integration/crud/bulk.test.ts | Minor refactor (bulk const) + spacing |
| test/integration/connections-survive-step-down/connections_survive_step_down.prose.test.ts | Lint-driven spacing adjustment |
| test/integration/connection-monitoring-and-pooling/rtt_pinger.test.ts | Lint-driven spacing adjustment |
| test/integration/connection-monitoring-and-pooling/connection.test.ts | Remove unused testClient close logic |
| test/integration/connection-monitoring-and-pooling/connection_pool.test.ts | Remove unused Db usage/import + spacing |
| test/integration/command-logging-and-monitoring/command_logging_and_monitoring.prose.test.ts | Lint-driven spacing adjustment |
| test/integration/client-side-operations-timeout/node_csot.test.ts | Lint-driven spacing adjustment |
| test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts | Lint-driven spacing adjustment |
| test/integration/client-side-encryption/driver.test.ts | Lint-driven spacing adjustment |
| test/integration/client-side-encryption/client_side_encryption.prose.test.ts | Lint-driven spacing adjustment |
| src/utils.ts | Type formatting + loop formatting tweak |
| src/sort.ts | Type formatting simplification |
| src/sdam/topology.ts | Minor refactor of auth() overload handling + formatting |
| src/sdam/monitor.ts | Interface formatting change |
| src/operations/list_collections.ts | Interface formatting change |
| src/operations/indexes.ts | Type/interface formatting change |
| src/operations/find.ts | Interface formatting change |
| src/operations/command.ts | Interface formatting change |
| src/mongo_types.ts | Type formatting changes |
| src/mongo_logger.ts | Type annotation tweak for local variable |
| src/mongo_client.ts | Interface formatting change |
| src/deps.ts | Simplify optional dependency loader return path |
| src/db.ts | Generic constraint formatting |
| src/cursor/list_collections_cursor.ts | Generic constraint formatting |
| src/cursor/client_bulk_write_cursor.ts | Interface formatting change |
| src/cursor/abstract_cursor.ts | Class generic formatting |
| src/connection_string.ts | Formatting-only change to option validator |
| src/cmap/connection.ts | Local variable initialization cleanup |
| src/cmap/commands.ts | Remove unused index update |
| src/cmap/auth/scram.ts | Preserve original error via cause when in FIPS mode |
| src/cmap/auth/mongodb_aws.ts | Import ordering adjustment |
| src/client-side-encryption/client_encryption.ts | map() formatting change |
| src/change_stream.ts | Interface/type formatting changes |
| src/bulk/common.ts | Union type formatting simplification |
| src/bson.ts | Interface formatting change |
| package.json | Upgrade ESLint to v10 + related deps; update lint scripts for flat config |
| package-lock.json | Lockfile updates for upgraded lint toolchain |
| etc/sdam_viz.js | Format long require destructuring |
| etc/docs/template/static/s/js/searchtools.js | Large formatting-only pass (prettier/lint) |
| etc/docs/template/static/s/js/frontpage.js | Formatting-only pass (prettier/lint) |
| etc/crawfish.mjs | Import ordering change |
| eslint.config.mjs | New flat ESLint config (requires fixes; see comments) |
| .eslintignore | Removed (replaced by flat-config ignores) |
Comment on lines
102
to
106
| mockServer.setMessageHandler(request => { | ||
| const doc = request.document; | ||
|
|
||
| let initialHelloSent = false; | ||
| const initialHelloSent = false; | ||
| if (isHello(doc) && !initialHelloSent) { |
Comment on lines
+190
to
+197
| { | ||
| files: ['**/*.mjs'], | ||
|
|
||
| languageOptions: { | ||
| ecmaVersion: 5, | ||
| sourceType: 'module' | ||
| } | ||
| }, |
Comment on lines
+235
to
+238
| 'no-console': 'off', | ||
| 'no-restricted-syntax': 'off', | ||
| 'typescript-eslint/ban-ts-comment': 'off', | ||
| 'no-restricted-imports': 'off', |
nbbeeken
reviewed
Jul 16, 2026
| } | ||
|
|
||
| auth(credentials?: MongoCredentials, callback?: Callback): void { | ||
| if (typeof credentials === 'function') ((callback = credentials), (credentials = undefined)); |
Contributor
There was a problem hiding this comment.
omg callback code in 2026 😨
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.
Description
Summary of Changes
Migrate the existing lint config:
eslint.config.mjsnpx @eslint/migrate-config .eslintrc.jsonnpm install globals @eslint/js @eslint/eslintrc -Drm .eslintignore(it was folded into the neweslint.config.mjsFix new eslint v10.x violations:
npm run fix:eslintDouble check the following
npm run check:lint)type(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript