From 69001094c985879cd312f81f0358eed9c6530bda Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Wed, 30 Apr 2025 15:16:14 +0100 Subject: [PATCH 1/3] chore(NODE-6939): update typescript to 5.8.3 --- package-lock.json | 273 ++++++++++--------- package.json | 6 +- src/bulk/common.ts | 8 +- src/client-side-encryption/state_machine.ts | 13 +- src/cmap/commands.ts | 48 ++-- src/cmap/connection.ts | 2 +- src/cmap/handshake/client_metadata.ts | 6 +- src/cmap/wire_protocol/on_demand/document.ts | 35 ++- src/cmap/wire_protocol/responses.ts | 20 +- src/connection_string.ts | 1 + src/constants.ts | 1 - src/cursor/abstract_cursor.ts | 10 +- src/operations/aggregate.ts | 1 - src/operations/distinct.ts | 2 +- src/operations/rename.ts | 13 +- src/operations/run_command.ts | 21 +- src/operations/search_indexes/create.ts | 10 +- src/operations/search_indexes/drop.ts | 10 +- src/operations/search_indexes/update.ts | 13 +- src/utils.ts | 16 +- src/write_concern.ts | 6 +- test/benchmarks/driver_bench/tsconfig.json | 1 + tsconfig.json | 1 + 23 files changed, 290 insertions(+), 227 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1ab7dcb2860..c55e9826183 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,8 +31,8 @@ "@types/sinon": "^17.0.4", "@types/sinon-chai": "^4.0.0", "@types/whatwg-url": "^13.0.0", - "@typescript-eslint/eslint-plugin": "8.4.0", - "@typescript-eslint/parser": "8.4.0", + "@typescript-eslint/eslint-plugin": "8.31.1", + "@typescript-eslint/parser": "8.31.1", "chai": "^4.4.1", "chai-subset": "^1.6.0", "chalk": "^4.1.2", @@ -60,7 +60,7 @@ "source-map-support": "^0.5.21", "ts-node": "^10.9.2", "tsd": "^0.31.2", - "typescript": "5.5", + "typescript": "5.8.3", "typescript-cached-transpile": "^0.0.6", "v8-heapsnapshot": "^1.3.1", "yargs": "^17.7.2" @@ -2752,20 +2752,20 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.4.0.tgz", - "integrity": "sha512-rg8LGdv7ri3oAlenMACk9e+AR4wUV0yrrG+XKsGKOK0EVgeEDqurkXMPILG2836fW4ibokTB5v4b6Z9+GYQDEw==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.31.1.tgz", + "integrity": "sha512-oUlH4h1ABavI4F0Xnl8/fOtML/eu8nI2A1nYd+f+55XI0BLu+RIqKoCiZKNo6DtqZBEQm5aNKA20G3Z5w3R6GQ==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.4.0", - "@typescript-eslint/type-utils": "8.4.0", - "@typescript-eslint/utils": "8.4.0", - "@typescript-eslint/visitor-keys": "8.4.0", + "@typescript-eslint/scope-manager": "8.31.1", + "@typescript-eslint/type-utils": "8.31.1", + "@typescript-eslint/utils": "8.31.1", + "@typescript-eslint/visitor-keys": "8.31.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2776,24 +2776,21 @@ }, "peerDependencies": { "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.4.0.tgz", - "integrity": "sha512-NHgWmKSgJk5K9N16GIhQ4jSobBoJwrmURaLErad0qlLjrpP5bECYg+wxVTGlGZmJbU03jj/dfnb6V9bw+5icsA==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.31.1.tgz", + "integrity": "sha512-oU/OtYVydhXnumd0BobL9rkJg7wFJ9bFFPmSmB/bf/XWN85hlViji59ko6bSKBXyseT9V8l+CN1nwmlbiN0G7Q==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.4.0", - "@typescript-eslint/types": "8.4.0", - "@typescript-eslint/typescript-estree": "8.4.0", - "@typescript-eslint/visitor-keys": "8.4.0", + "@typescript-eslint/scope-manager": "8.31.1", + "@typescript-eslint/types": "8.31.1", + "@typescript-eslint/typescript-estree": "8.31.1", + "@typescript-eslint/visitor-keys": "8.31.1", "debug": "^4.3.4" }, "engines": { @@ -2804,22 +2801,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.4.0.tgz", - "integrity": "sha512-n2jFxLeY0JmKfUqy3P70rs6vdoPjHK8P/w+zJcV3fk0b0BwRXC/zxRTEnAsgYT7MwdQDt/ZEbtdzdVC+hcpF0A==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.31.1.tgz", + "integrity": "sha512-BMNLOElPxrtNQMIsFHE+3P0Yf1z0dJqV9zLdDxN/xLlWMlXK/ApEsVEKzpizg9oal8bAT5Sc7+ocal7AC1HCVw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.4.0", - "@typescript-eslint/visitor-keys": "8.4.0" + "@typescript-eslint/types": "8.31.1", + "@typescript-eslint/visitor-keys": "8.31.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2830,15 +2823,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.4.0.tgz", - "integrity": "sha512-pu2PAmNrl9KX6TtirVOrbLPLwDmASpZhK/XU7WvoKoCUkdtq9zF7qQ7gna0GBZFN0hci0vHaSusiL2WpsQk37A==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.31.1.tgz", + "integrity": "sha512-fNaT/m9n0+dpSp8G/iOQ05GoHYXbxw81x+yvr7TArTuZuCA6VVKbqWYVZrV5dVagpDTtj/O8k5HBEE/p/HM5LA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.4.0", - "@typescript-eslint/utils": "8.4.0", + "@typescript-eslint/typescript-estree": "8.31.1", + "@typescript-eslint/utils": "8.31.1", "debug": "^4.3.4", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2847,16 +2840,15 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/types": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.4.0.tgz", - "integrity": "sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.31.1.tgz", + "integrity": "sha512-SfepaEFUDQYRoA70DD9GtytljBePSj17qPxFHA/h3eg6lPTqGJ5mWOtbXCk1YrVU1cTJRd14nhaXWFu0l2troQ==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2867,19 +2859,20 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.4.0.tgz", - "integrity": "sha512-kJ2OIP4dQw5gdI4uXsaxUZHRwWAGpREJ9Zq6D5L0BweyOrWsL6Sz0YcAZGWhvKnH7fm1J5YFE1JrQL0c9dd53A==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.31.1.tgz", + "integrity": "sha512-kaA0ueLe2v7KunYOyWYtlf/QhhZb7+qh4Yw6Ni5kgukMIG+iP773tjgBiLWIXYumWCwEq3nLW+TUywEp8uEeag==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.4.0", - "@typescript-eslint/visitor-keys": "8.4.0", + "@typescript-eslint/types": "8.31.1", + "@typescript-eslint/visitor-keys": "8.31.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2888,10 +2881,8 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { @@ -2919,15 +2910,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.4.0.tgz", - "integrity": "sha512-swULW8n1IKLjRAgciCkTCafyTHHfwVQFt8DovmaF69sKbOxTSFMmIZaSHjqO9i/RV0wIblaawhzvtva8Nmm7lQ==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.31.1.tgz", + "integrity": "sha512-2DSI4SNfF5T4oRveQ4nUrSjUqjMND0nLq9rEkz0gfGr3tg0S5KB6DhwR+WZPCjzkZl3cH+4x2ce3EsL50FubjQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.4.0", - "@typescript-eslint/types": "8.4.0", - "@typescript-eslint/typescript-estree": "8.4.0" + "@typescript-eslint/scope-manager": "8.31.1", + "@typescript-eslint/types": "8.31.1", + "@typescript-eslint/typescript-estree": "8.31.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2937,17 +2928,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.4.0.tgz", - "integrity": "sha512-zTQD6WLNTre1hj5wp09nBIDiOc2U5r/qmzo7wxPn4ZgAjHql09EofqhF9WF+fZHzL5aCyaIpPcT2hyxl73kr9A==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.31.1.tgz", + "integrity": "sha512-I+/rgqOVBn6f0o7NDTmAPWWC6NuqhV174lfYvAm9fUaWeiefLdux9/YI3/nLugEn9L8fcSi0XmpKi/r5u0nmpw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.4.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.31.1", + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2957,6 +2949,19 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/accepts": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", @@ -8178,15 +8183,15 @@ } }, "node_modules/ts-api-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", - "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", "dev": true, "engines": { - "node": ">=16" + "node": ">=18.12" }, "peerDependencies": { - "typescript": ">=4.2.0" + "typescript": ">=4.8.4" } }, "node_modules/ts-node": { @@ -8334,9 +8339,9 @@ } }, "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -10825,77 +10830,77 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.4.0.tgz", - "integrity": "sha512-rg8LGdv7ri3oAlenMACk9e+AR4wUV0yrrG+XKsGKOK0EVgeEDqurkXMPILG2836fW4ibokTB5v4b6Z9+GYQDEw==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.31.1.tgz", + "integrity": "sha512-oUlH4h1ABavI4F0Xnl8/fOtML/eu8nI2A1nYd+f+55XI0BLu+RIqKoCiZKNo6DtqZBEQm5aNKA20G3Z5w3R6GQ==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.4.0", - "@typescript-eslint/type-utils": "8.4.0", - "@typescript-eslint/utils": "8.4.0", - "@typescript-eslint/visitor-keys": "8.4.0", + "@typescript-eslint/scope-manager": "8.31.1", + "@typescript-eslint/type-utils": "8.31.1", + "@typescript-eslint/utils": "8.31.1", + "@typescript-eslint/visitor-keys": "8.31.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.1" } }, "@typescript-eslint/parser": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.4.0.tgz", - "integrity": "sha512-NHgWmKSgJk5K9N16GIhQ4jSobBoJwrmURaLErad0qlLjrpP5bECYg+wxVTGlGZmJbU03jj/dfnb6V9bw+5icsA==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.31.1.tgz", + "integrity": "sha512-oU/OtYVydhXnumd0BobL9rkJg7wFJ9bFFPmSmB/bf/XWN85hlViji59ko6bSKBXyseT9V8l+CN1nwmlbiN0G7Q==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "8.4.0", - "@typescript-eslint/types": "8.4.0", - "@typescript-eslint/typescript-estree": "8.4.0", - "@typescript-eslint/visitor-keys": "8.4.0", + "@typescript-eslint/scope-manager": "8.31.1", + "@typescript-eslint/types": "8.31.1", + "@typescript-eslint/typescript-estree": "8.31.1", + "@typescript-eslint/visitor-keys": "8.31.1", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.4.0.tgz", - "integrity": "sha512-n2jFxLeY0JmKfUqy3P70rs6vdoPjHK8P/w+zJcV3fk0b0BwRXC/zxRTEnAsgYT7MwdQDt/ZEbtdzdVC+hcpF0A==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.31.1.tgz", + "integrity": "sha512-BMNLOElPxrtNQMIsFHE+3P0Yf1z0dJqV9zLdDxN/xLlWMlXK/ApEsVEKzpizg9oal8bAT5Sc7+ocal7AC1HCVw==", "dev": true, "requires": { - "@typescript-eslint/types": "8.4.0", - "@typescript-eslint/visitor-keys": "8.4.0" + "@typescript-eslint/types": "8.31.1", + "@typescript-eslint/visitor-keys": "8.31.1" } }, "@typescript-eslint/type-utils": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.4.0.tgz", - "integrity": "sha512-pu2PAmNrl9KX6TtirVOrbLPLwDmASpZhK/XU7WvoKoCUkdtq9zF7qQ7gna0GBZFN0hci0vHaSusiL2WpsQk37A==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.31.1.tgz", + "integrity": "sha512-fNaT/m9n0+dpSp8G/iOQ05GoHYXbxw81x+yvr7TArTuZuCA6VVKbqWYVZrV5dVagpDTtj/O8k5HBEE/p/HM5LA==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "8.4.0", - "@typescript-eslint/utils": "8.4.0", + "@typescript-eslint/typescript-estree": "8.31.1", + "@typescript-eslint/utils": "8.31.1", "debug": "^4.3.4", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.1" } }, "@typescript-eslint/types": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.4.0.tgz", - "integrity": "sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.31.1.tgz", + "integrity": "sha512-SfepaEFUDQYRoA70DD9GtytljBePSj17qPxFHA/h3eg6lPTqGJ5mWOtbXCk1YrVU1cTJRd14nhaXWFu0l2troQ==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.4.0.tgz", - "integrity": "sha512-kJ2OIP4dQw5gdI4uXsaxUZHRwWAGpREJ9Zq6D5L0BweyOrWsL6Sz0YcAZGWhvKnH7fm1J5YFE1JrQL0c9dd53A==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.31.1.tgz", + "integrity": "sha512-kaA0ueLe2v7KunYOyWYtlf/QhhZb7+qh4Yw6Ni5kgukMIG+iP773tjgBiLWIXYumWCwEq3nLW+TUywEp8uEeag==", "dev": true, "requires": { - "@typescript-eslint/types": "8.4.0", - "@typescript-eslint/visitor-keys": "8.4.0", + "@typescript-eslint/types": "8.31.1", + "@typescript-eslint/visitor-keys": "8.31.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.1" }, "dependencies": { "brace-expansion": { @@ -10919,25 +10924,33 @@ } }, "@typescript-eslint/utils": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.4.0.tgz", - "integrity": "sha512-swULW8n1IKLjRAgciCkTCafyTHHfwVQFt8DovmaF69sKbOxTSFMmIZaSHjqO9i/RV0wIblaawhzvtva8Nmm7lQ==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.31.1.tgz", + "integrity": "sha512-2DSI4SNfF5T4oRveQ4nUrSjUqjMND0nLq9rEkz0gfGr3tg0S5KB6DhwR+WZPCjzkZl3cH+4x2ce3EsL50FubjQ==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.4.0", - "@typescript-eslint/types": "8.4.0", - "@typescript-eslint/typescript-estree": "8.4.0" + "@typescript-eslint/scope-manager": "8.31.1", + "@typescript-eslint/types": "8.31.1", + "@typescript-eslint/typescript-estree": "8.31.1" } }, "@typescript-eslint/visitor-keys": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.4.0.tgz", - "integrity": "sha512-zTQD6WLNTre1hj5wp09nBIDiOc2U5r/qmzo7wxPn4ZgAjHql09EofqhF9WF+fZHzL5aCyaIpPcT2hyxl73kr9A==", + "version": "8.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.31.1.tgz", + "integrity": "sha512-I+/rgqOVBn6f0o7NDTmAPWWC6NuqhV174lfYvAm9fUaWeiefLdux9/YI3/nLugEn9L8fcSi0XmpKi/r5u0nmpw==", "dev": true, "requires": { - "@typescript-eslint/types": "8.4.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.31.1", + "eslint-visitor-keys": "^4.2.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true + } } }, "accepts": { @@ -14722,9 +14735,9 @@ "dev": true }, "ts-api-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", - "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", "dev": true, "requires": {} }, @@ -14829,9 +14842,9 @@ } }, "typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true }, "typescript-cached-transpile": { diff --git a/package.json b/package.json index cf24afbbe9b..38652e6a40f 100644 --- a/package.json +++ b/package.json @@ -79,8 +79,8 @@ "@types/sinon": "^17.0.4", "@types/sinon-chai": "^4.0.0", "@types/whatwg-url": "^13.0.0", - "@typescript-eslint/eslint-plugin": "8.4.0", - "@typescript-eslint/parser": "8.4.0", + "@typescript-eslint/eslint-plugin": "8.31.1", + "@typescript-eslint/parser": "8.31.1", "chai": "^4.4.1", "chai-subset": "^1.6.0", "chalk": "^4.1.2", @@ -108,7 +108,7 @@ "source-map-support": "^0.5.21", "ts-node": "^10.9.2", "tsd": "^0.31.2", - "typescript": "5.5", + "typescript": "5.8.3", "typescript-cached-transpile": "^0.0.6", "v8-heapsnapshot": "^1.3.1", "yargs": "^17.7.2" diff --git a/src/bulk/common.ts b/src/bulk/common.ts index 782b4041e39..6acd1ba13c4 100644 --- a/src/bulk/common.ts +++ b/src/bulk/common.ts @@ -894,16 +894,14 @@ export abstract class BulkOperationBase { /** @internal */ s: BulkOperationPrivate; operationId?: number; + private collection: Collection; /** * Create a new OrderedBulkOperation or UnorderedBulkOperation instance * @internal */ - constructor( - private collection: Collection, - options: BulkWriteOptions, - isOrdered: boolean - ) { + constructor(collection: Collection, options: BulkWriteOptions, isOrdered: boolean) { + this.collection = collection; // determine whether bulkOperation is ordered or unordered this.isOrdered = isOrdered; diff --git a/src/client-side-encryption/state_machine.ts b/src/client-side-encryption/state_machine.ts index 51f0dfd699e..fd5a393ea84 100644 --- a/src/client-side-encryption/state_machine.ts +++ b/src/client-side-encryption/state_machine.ts @@ -186,10 +186,13 @@ export type StateMachineOptions = { */ // TODO(DRIVERS-2671): clarify CSOT behavior for FLE APIs export class StateMachine { - constructor( - private options: StateMachineOptions, - private bsonOptions = pluckBSONSerializeOptions(options) - ) {} + private options: StateMachineOptions; + private bsonOptions: BSONSerializeOptions; + + constructor(options: StateMachineOptions, bsonOptions = pluckBSONSerializeOptions(options)) { + this.options = options; + this.bsonOptions = bsonOptions; + } /** * Executes the state machine according to the specification @@ -275,7 +278,7 @@ export class StateMachine { // See docs on EMPTY_V result = EMPTY_V ??= serialize({ v: [] }); } - for await (const key of keys) { + for (const key of keys) { context.addMongoOperationResponse(serialize(key)); } diff --git a/src/cmap/commands.ts b/src/cmap/commands.ts index f14c3f5de4c..bdd080a37bf 100644 --- a/src/cmap/commands.ts +++ b/src/cmap/commands.ts @@ -76,12 +76,10 @@ export class OpQueryRequest { partial: boolean; /** moreToCome is an OP_MSG only concept */ moreToCome = false; + databaseName: string; + query: Document; - constructor( - public databaseName: string, - public query: Document, - options: OpQueryOptions - ) { + constructor(databaseName: string, query: Document, options: OpQueryOptions) { // Basic options needed to be passed in // TODO(NODE-3483): Replace with MongoCommandError const ns = `${databaseName}.$cmd`; @@ -97,7 +95,9 @@ export class OpQueryRequest { throw new MongoRuntimeError('Namespace cannot contain a null character'); } - // Basic options + // Basic optionsa + this.databaseName = databaseName; + this.query = query; this.ns = ns; // Additional options @@ -496,17 +496,18 @@ export class OpMsgRequest { checksumPresent: boolean; moreToCome: boolean; exhaustAllowed: boolean; + databaseName: string; + command: Document; + options: OpQueryOptions; - constructor( - public databaseName: string, - public command: Document, - public options: OpQueryOptions - ) { + constructor(databaseName: string, command: Document, options: OpQueryOptions) { // Basic options needed to be passed in if (command == null) throw new MongoInvalidArgumentError('Query document must be specified for query'); - // Basic options + // Basic optionsa + this.databaseName = databaseName; + this.command = command; this.command.$db = databaseName; // Ensure empty options @@ -730,10 +731,19 @@ const COMPRESSION_DETAILS_SIZE = 9; // originalOpcode + uncompressedSize, compre * An OP_COMPRESSED request wraps either an OP_QUERY or OP_MSG message. */ export class OpCompressedRequest { + private command: WriteProtocolMessageType; + private options: { zLibCompressionLevel: number; agreedCompressor: CompressorName }; + constructor( - private command: WriteProtocolMessageType, - private options: { zlibCompressionLevel: number; agreedCompressor: CompressorName } - ) {} + command: WriteProtocolMessageType, + options: { zlibCompressionLevel: number; agreedCompressor: CompressorName } + ) { + this.command = command; + this.options = { + zLibCompressionLevel: options.zlibCompressionLevel, + agreedCompressor: options.agreedCompressor + }; + } // Return whether a command contains an uncompressible command term // Will return true if command contains no uncompressible command terms @@ -752,7 +762,13 @@ export class OpCompressedRequest { const originalCommandOpCode = concatenatedOriginalCommandBuffer.readInt32LE(12); // Compress the message body - const compressedMessage = await compress(this.options, messageToBeCompressed); + const compressedMessage = await compress( + { + zlibCompressionLevel: this.options.zLibCompressionLevel, + agreedCompressor: this.options.agreedCompressor + }, + messageToBeCompressed + ); // Create the msgHeader of OP_COMPRESSED const msgHeader = Buffer.alloc(MESSAGE_HEADER_SIZE); msgHeader.writeInt32LE( diff --git a/src/cmap/connection.ts b/src/cmap/connection.ts index c1cbf68b2d9..ace5e905b58 100644 --- a/src/cmap/connection.ts +++ b/src/cmap/connection.ts @@ -864,7 +864,7 @@ export class CryptoConnection extends Connection { ns: MongoDBNamespace, cmd: Document, options?: CommandOptions, - responseType?: T | undefined + responseType?: T ): Promise { const { autoEncrypter } = this; if (!autoEncrypter) { diff --git a/src/cmap/handshake/client_metadata.ts b/src/cmap/handshake/client_metadata.ts index 1e825ed2bf7..9a633a72aac 100644 --- a/src/cmap/handshake/client_metadata.ts +++ b/src/cmap/handshake/client_metadata.ts @@ -53,7 +53,11 @@ export class LimitedSizeDocument { private document = new Map(); /** BSON overhead: Int32 + Null byte */ private documentSize = 5; - constructor(private maxSize: number) {} + private maxSize: number; + + constructor(maxSize: number) { + this.maxSize = maxSize; + } /** Only adds key/value if the bsonByteLength is less than MAX_SIZE */ public ifItFitsItSits(key: string, value: Record | string): boolean { diff --git a/src/cmap/wire_protocol/on_demand/document.ts b/src/cmap/wire_protocol/on_demand/document.ts index 98189b399c0..2454b034f3b 100644 --- a/src/cmap/wire_protocol/on_demand/document.ts +++ b/src/cmap/wire_protocol/on_demand/document.ts @@ -14,14 +14,13 @@ import { toUTF8 } from '../../../bson'; -// eslint-disable-next-line no-restricted-syntax -const enum BSONElementOffset { - type = 0, - nameOffset = 1, - nameLength = 2, - offset = 3, - length = 4 -} +const BSONElementOffset = { + type: 0, + nameOffset: 1, + nameLength: 2, + offset: 3, + length: 4 +} as const; /** @internal */ export type JSTypeOf = { @@ -67,17 +66,23 @@ export class OnDemandDocument { /** All bson elements in this document */ private readonly elements: ReadonlyArray; + /** BSON bytes, this document begins at offset */ + protected readonly bson: Uint8Array; + /** The start of the document */ + private readonly offset: number; + /** If this is an embedded document, indicates if this was a BSON array */ + public readonly isArray: boolean; constructor( - /** BSON bytes, this document begins at offset */ - protected readonly bson: Uint8Array, - /** The start of the document */ - private readonly offset = 0, - /** If this is an embedded document, indicates if this was a BSON array */ - public readonly isArray = false, + bson: Uint8Array, + offset = 0, + isArray = false, /** If elements was already calculated */ elements?: BSONElement[] ) { + this.bson = bson; + this.offset = offset; + this.isArray = isArray; this.elements = elements ?? parseToElementsToArray(this.bson, offset); } @@ -262,7 +267,7 @@ export class OnDemandDocument { public get( name: string | number, as: T, - required?: boolean | undefined + required?: boolean ): JSTypeOf[T] | null; /** `required` will make `get` throw if name does not exist or is null/undefined */ diff --git a/src/cmap/wire_protocol/responses.ts b/src/cmap/wire_protocol/responses.ts index bacf6d648be..d5549aea545 100644 --- a/src/cmap/wire_protocol/responses.ts +++ b/src/cmap/wire_protocol/responses.ts @@ -20,14 +20,14 @@ import { type OnDemandDocumentDeserializeOptions } from './on_demand/document'; -// eslint-disable-next-line no-restricted-syntax -const enum BSONElementOffset { - type = 0, - nameOffset = 1, - nameLength = 2, - offset = 3, - length = 4 -} +const BSONElementOffset = { + type: 0, + nameOffset: 1, + nameLength: 2, + offset: 3, + length: 4 +} as const; + /** * Accepts a BSON payload and checks for na "ok: 0" element. * This utility is intended to prevent calling response class constructors @@ -77,7 +77,7 @@ export class MongoDBResponse extends OnDemandDocument { public override get( name: string | number, as: T, - required?: false | undefined + required?: false ): JSTypeOf[T] | null; public override get( name: string | number, @@ -87,7 +87,7 @@ export class MongoDBResponse extends OnDemandDocument { public override get( name: string | number, as: T, - required?: boolean | undefined + required?: boolean ): JSTypeOf[T] | null { try { return super.get(name, as, required); diff --git a/src/connection_string.ts b/src/connection_string.ts index 09e4e280a34..e07783e3758 100644 --- a/src/connection_string.ts +++ b/src/connection_string.ts @@ -605,6 +605,7 @@ function setOption( if (values[0] == null) { break; } + // eslint-disable-next-line @typescript-eslint/no-base-to-string mongoOptions[name] = String(values[0]); break; case 'record': diff --git a/src/constants.ts b/src/constants.ts index 623b6c919b1..abb69509f94 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ export const SYSTEM_NAMESPACE_COLLECTION = 'system.namespaces'; export const SYSTEM_INDEX_COLLECTION = 'system.indexes'; export const SYSTEM_PROFILE_COLLECTION = 'system.profile'; diff --git a/src/cursor/abstract_cursor.ts b/src/cursor/abstract_cursor.ts index 791fab6f584..af688ebfb62 100644 --- a/src/cursor/abstract_cursor.ts +++ b/src/cursor/abstract_cursor.ts @@ -1213,11 +1213,13 @@ configureResourceManagement(AbstractCursor.prototype); * All timeout behavior is exactly the same as the wrapped timeout context's. */ export class CursorTimeoutContext extends TimeoutContext { - constructor( - public timeoutContext: TimeoutContext, - public owner: symbol | AbstractCursor - ) { + timeoutContext: TimeoutContext; + owner: symbol | AbstractCursor; + + constructor(timeoutContext: TimeoutContext, owner: symbol | AbstractCursor) { super(); + this.timeoutContext = timeoutContext; + this.owner = owner; } override get serverSelectionTimeout(): Timeout | null { return this.timeoutContext.serverSelectionTimeout; diff --git a/src/operations/aggregate.ts b/src/operations/aggregate.ts index ab367a16a94..a11365a9e89 100644 --- a/src/operations/aggregate.ts +++ b/src/operations/aggregate.ts @@ -12,7 +12,6 @@ import { type CollationOptions, CommandOperation, type CommandOperationOptions } import { Aspect, defineAspects, type Hint } from './operation'; /** @internal */ -// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion export const DB_AGGREGATE_COLLECTION = 1 as const; const MIN_WIRE_VERSION_$OUT_READ_CONCERN_SUPPORT = 8; diff --git a/src/operations/distinct.ts b/src/operations/distinct.ts index 5c2c6c6a23d..51c746d65ea 100644 --- a/src/operations/distinct.ts +++ b/src/operations/distinct.ts @@ -96,7 +96,7 @@ export class DistinctOperation extends CommandOperation { const result = await super.executeCommand(server, session, cmd, timeoutContext); - return this.explain ? result : result.values; + return this.explain ? (result as any[]) : result.values; } } diff --git a/src/operations/rename.ts b/src/operations/rename.ts index 883be282b64..62659a7bafb 100644 --- a/src/operations/rename.ts +++ b/src/operations/rename.ts @@ -17,12 +17,15 @@ export interface RenameOptions extends CommandOperationOptions { /** @internal */ export class RenameOperation extends CommandOperation { - constructor( - public collection: Collection, - public newName: string, - public override options: RenameOptions - ) { + collection: Collection; + newName: string; + override options: RenameOptions; + + constructor(collection: Collection, newName: string, options: RenameOptions) { super(collection, options); + this.collection = collection; + this.newName = newName; + this.options = options; this.ns = new MongoDBNamespace('admin', '$cmd'); } diff --git a/src/operations/run_command.ts b/src/operations/run_command.ts index db5c5a7c169..4b967ee3cd5 100644 --- a/src/operations/run_command.ts +++ b/src/operations/run_command.ts @@ -26,12 +26,17 @@ export type RunCommandOptions = { /** @internal */ export class RunCommandOperation extends AbstractOperation { + command: Document; + override options: RunCommandOptions & { responseType?: MongoDBResponseConstructor }; + constructor( parent: Db, - public command: Document, - public override options: RunCommandOptions & { responseType?: MongoDBResponseConstructor } + command: Document, + options: RunCommandOptions & { responseType?: MongoDBResponseConstructor } ) { super(options); + this.command = command; + this.options = options; this.ns = parent.s.namespace.withCollection('$cmd'); } @@ -62,14 +67,22 @@ export class RunCommandOperation extends AbstractOperation { } export class RunAdminCommandOperation extends AbstractOperation { + command: Document; + override options: RunCommandOptions & { + noResponse?: boolean; + bypassPinningCheck?: boolean; + }; + constructor( - public command: Document, - public override options: RunCommandOptions & { + command: Document, + options: RunCommandOptions & { noResponse?: boolean; bypassPinningCheck?: boolean; } ) { super(options); + this.command = command; + this.options = options; this.ns = new MongoDBNamespace('admin', '$cmd'); } diff --git a/src/operations/search_indexes/create.ts b/src/operations/search_indexes/create.ts index 2870868bc91..95f91c2d19f 100644 --- a/src/operations/search_indexes/create.ts +++ b/src/operations/search_indexes/create.ts @@ -21,11 +21,13 @@ export interface SearchIndexDescription extends Document { /** @internal */ export class CreateSearchIndexesOperation extends AbstractOperation { - constructor( - private readonly collection: Collection, - private readonly descriptions: ReadonlyArray - ) { + private readonly collection: Collection; + private readonly descriptions: ReadonlyArray; + + constructor(collection: Collection, descriptions: ReadonlyArray) { super(); + this.collection = collection; + this.descriptions = descriptions; } override get commandName() { diff --git a/src/operations/search_indexes/drop.ts b/src/operations/search_indexes/drop.ts index 28870d3220e..3b87bfad442 100644 --- a/src/operations/search_indexes/drop.ts +++ b/src/operations/search_indexes/drop.ts @@ -8,11 +8,13 @@ import { AbstractOperation } from '../operation'; /** @internal */ export class DropSearchIndexOperation extends AbstractOperation { - constructor( - private readonly collection: Collection, - private readonly name: string - ) { + private readonly collection: Collection; + private readonly name: string; + + constructor(collection: Collection, name: string) { super(); + this.collection = collection; + this.name = name; } override get commandName() { diff --git a/src/operations/search_indexes/update.ts b/src/operations/search_indexes/update.ts index e8701d2802e..dfc2c848db3 100644 --- a/src/operations/search_indexes/update.ts +++ b/src/operations/search_indexes/update.ts @@ -7,12 +7,15 @@ import { AbstractOperation } from '../operation'; /** @internal */ export class UpdateSearchIndexOperation extends AbstractOperation { - constructor( - private readonly collection: Collection, - private readonly name: string, - private readonly definition: Document - ) { + private readonly collection: Collection; + private readonly name: string; + private readonly definition: Document; + + constructor(collection: Collection, name: string, definition: Document) { super(); + this.collection = collection; + this.name = name; + this.definition = definition; } override get commandName() { diff --git a/src/utils.ts b/src/utils.ts index 09e86b7349c..22cda4092ba 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -281,16 +281,16 @@ export function ns(ns: string): MongoDBNamespace { /** @public */ export class MongoDBNamespace { + db: string; + collection?: string; /** * Create a namespace object * * @param db - database name * @param collection - collection name */ - constructor( - public db: string, - public collection?: string - ) { + constructor(db: string, collection?: string) { + this.db = db; this.collection = collection === '' ? undefined : collection; } @@ -322,11 +322,11 @@ export class MongoDBNamespace { * used in scenarios where this can be guaranteed. */ export class MongoDBCollectionNamespace extends MongoDBNamespace { - constructor( - db: string, - override collection: string - ) { + override collection: string; + + constructor(db: string, collection: string) { super(db, collection); + this.collection = collection; } static override fromString(namespace?: string): MongoDBCollectionNamespace { diff --git a/src/write_concern.ts b/src/write_concern.ts index 6326f15d588..622460fa79a 100644 --- a/src/write_concern.ts +++ b/src/write_concern.ts @@ -143,6 +143,7 @@ export class WriteConcern { const parentOpts: WriteConcern | WriteConcernSettings | undefined = inherit instanceof WriteConcern ? inherit : inherit.writeConcern; + const mergedOpts = { ...parentOpts, ...opts } as WriteConcernSettings; const { w = undefined, wtimeout = undefined, @@ -150,10 +151,7 @@ export class WriteConcern { fsync = undefined, journal = undefined, wtimeoutMS = undefined - } = { - ...parentOpts, - ...opts - }; + } = mergedOpts; if ( w != null || wtimeout != null || diff --git a/test/benchmarks/driver_bench/tsconfig.json b/test/benchmarks/driver_bench/tsconfig.json index d7eb0f5c29e..f8e4d6d94cf 100644 --- a/test/benchmarks/driver_bench/tsconfig.json +++ b/test/benchmarks/driver_bench/tsconfig.json @@ -8,6 +8,7 @@ "verbatimModuleSyntax": true, "module": "NodeNext", "moduleResolution": "NodeNext", + "erasableSyntaxOnly": true, "skipLibCheck": true, // We don't make use of tslib helpers, all syntax used is supported by target engine "importHelpers": false, diff --git a/tsconfig.json b/tsconfig.json index 942a6b869ad..98c6b2e46af 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,7 @@ "module": "commonJS", "moduleResolution": "node", "skipLibCheck": true, + "erasableSyntaxOnly": true, "lib": [ "es2021", "ES2022.Error", From 890949973622f752117e0669d878d9f1e79e2bcf Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Wed, 30 Apr 2025 15:30:08 +0100 Subject: [PATCH 2/3] fix: run lint checks on latest lts --- .evergreen/config.yml | 2 +- .evergreen/generate_evergreen_tasks.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 3a2efd16c89..9db36c77ebe 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -2066,7 +2066,7 @@ tasks: type: setup params: updates: - - {key: NODE_LTS_VERSION, value: '16'} + - {key: NODE_LTS_VERSION, value: '22'} - {key: NPM_VERSION, value: '9'} - func: install dependencies - func: run lint checks diff --git a/.evergreen/generate_evergreen_tasks.js b/.evergreen/generate_evergreen_tasks.js index 8729800f08a..2c7c32ab7f0 100644 --- a/.evergreen/generate_evergreen_tasks.js +++ b/.evergreen/generate_evergreen_tasks.js @@ -529,7 +529,7 @@ SINGLETON_TASKS.push( tags: ['lint-checks'], commands: [ updateExpansions({ - NODE_LTS_VERSION: LOWEST_LTS, + NODE_LTS_VERSION: LATEST_LTS, NPM_VERSION: 9 }), { func: 'install dependencies' }, From 3dbcf58365129a47a8a0b69088423c02adca296b Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Wed, 30 Apr 2025 17:55:44 +0100 Subject: [PATCH 3/3] fix: comments --- package-lock.json | 16 ++++++++-------- package.json | 2 +- src/connection_string.ts | 2 ++ src/operations/distinct.ts | 3 ++- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index c55e9826183..1afff5ec029 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,7 +59,7 @@ "socks": "^2.8.1", "source-map-support": "^0.5.21", "ts-node": "^10.9.2", - "tsd": "^0.31.2", + "tsd": "^0.32.0", "typescript": "5.8.3", "typescript-cached-transpile": "^0.0.6", "v8-heapsnapshot": "^1.3.1", @@ -2518,9 +2518,9 @@ "dev": true }, "node_modules/@tsd/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/@tsd/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-saiCxzHRhUrRxQV2JhH580aQUZiKQUXI38FcAcikcfOomAil4G4lxT0RfrrKywoAYP/rqAdYXYmNRLppcd+hQQ==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/@tsd/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-oKarNCN1QUhG148M88mtZdOlBZWWGcInquef+U8QL7gwJkRuNo5WS45Fjsd+3hM9cDJWGpqSZ4Oo097KDx4IWA==", "dev": true, "engines": { "node": ">=14.17" @@ -8247,12 +8247,12 @@ } }, "node_modules/tsd": { - "version": "0.31.2", - "resolved": "https://registry.npmjs.org/tsd/-/tsd-0.31.2.tgz", - "integrity": "sha512-VplBAQwvYrHzVihtzXiUVXu5bGcr7uH1juQZ1lmKgkuGNGT+FechUCqmx9/zk7wibcqR2xaNEwCkDyKh+VVZnQ==", + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/tsd/-/tsd-0.32.0.tgz", + "integrity": "sha512-R5lBZCbxGBowOcW0gpQaiIjGYrG5NmU+PfFDKcc3zbtzWjML1o/zAwzdDnS2ZheSlPu9GW51azpFqEPUBq9DoQ==", "dev": true, "dependencies": { - "@tsd/typescript": "~5.4.3", + "@tsd/typescript": "~5.8.3", "eslint-formatter-pretty": "^4.1.0", "globby": "^11.0.1", "jest-diff": "^29.0.3", diff --git a/package.json b/package.json index 38652e6a40f..c121f5937a6 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "socks": "^2.8.1", "source-map-support": "^0.5.21", "ts-node": "^10.9.2", - "tsd": "^0.31.2", + "tsd": "^0.32.0", "typescript": "5.8.3", "typescript-cached-transpile": "^0.0.6", "v8-heapsnapshot": "^1.3.1", diff --git a/src/connection_string.ts b/src/connection_string.ts index e07783e3758..a32c1e155f1 100644 --- a/src/connection_string.ts +++ b/src/connection_string.ts @@ -605,6 +605,8 @@ function setOption( if (values[0] == null) { break; } + // The value should always be a string here, but since the array is typed as unknown + // there still needs to be an explicit cast. // eslint-disable-next-line @typescript-eslint/no-base-to-string mongoOptions[name] = String(values[0]); break; diff --git a/src/operations/distinct.ts b/src/operations/distinct.ts index 51c746d65ea..75a5b57a2c0 100644 --- a/src/operations/distinct.ts +++ b/src/operations/distinct.ts @@ -96,7 +96,8 @@ export class DistinctOperation extends CommandOperation { const result = await super.executeCommand(server, session, cmd, timeoutContext); - return this.explain ? (result as any[]) : result.values; + // @ts-expect-error Explain always returns a document + return this.explain ? result : result.values; } }