From 1320ad87e9e0bddab3afc73d7ce33698f28ac0c7 Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Thu, 14 Nov 2024 11:17:37 -0700 Subject: [PATCH] chore(NODE-6488): specify target=es2021 for ts compilation tests (#4303) --- .evergreen/run-typescript.sh | 6 +++++- README.md | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.evergreen/run-typescript.sh b/.evergreen/run-typescript.sh index dd37a8717e9..0d952980166 100755 --- a/.evergreen/run-typescript.sh +++ b/.evergreen/run-typescript.sh @@ -44,8 +44,12 @@ if [ "$TS_CHECK" == "COMPILE_DRIVER" ]; then npm run build:ts elif [ "$TS_CHECK" == "CHECK_TYPES" ]; then echo "checking driver types" + if [ "$TS_VERSION" == "4.4" ]; then # check compilation - node $TSC mongodb.d.ts + node $TSC mongodb.d.ts --module commonjs --target es2021 + else + node $TSC mongodb.d.ts --module node16 --target es2021 + fi else "Invalid value $TS_CHECK for TS_CHECK environment variable." exit 1 diff --git a/README.md b/README.md index 30daa919d39..67d285ae8b1 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,8 @@ This is the lowest typescript version guaranteed to work with our driver: older Since typescript [does not restrict breaking changes to major versions](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes), we consider this support best effort. If you run into any unexpected compiler failures against our supported TypeScript versions, please let us know by filing an issue on our [JIRA](https://jira.mongodb.org/browse/NODE). +Additionally, our Typescript types are compatible with the ECMAScript standard for our minimum supported Node version. Currently, our Typescript targets es2021. + ## Installation The recommended way to get started using the Node.js 5.x driver is by using the `npm` (Node Package Manager) to install the dependency in your project.