-
Notifications
You must be signed in to change notification settings - Fork 1.8k
chore(NODE-6939): update typescript to 5.8.3 #4526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -529,7 +529,7 @@ SINGLETON_TASKS.push( | |||
tags: ['lint-checks'], | |||
commands: [ | |||
updateExpansions({ | |||
NODE_LTS_VERSION: LOWEST_LTS, | |||
NODE_LTS_VERSION: LATEST_LTS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this change since the updated eslint related dependencies will not work on Node 16 (structuredClone
isn't available). I figure it was ok to run our lint tasks on latest LTS since it's dev-only and our regular Node 16 tests are all still passing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So long as we still unit test on lowest, I agree that is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small changes
package-lock.json
Outdated
@@ -60,7 +60,7 @@ | |||
"source-map-support": "^0.5.21", | |||
"ts-node": "^10.9.2", | |||
"tsd": "^0.31.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AC says to update tsd as well
@@ -143,17 +143,15 @@ export class WriteConcern { | |||
const parentOpts: WriteConcern | WriteConcernSettings | undefined = | |||
inherit instanceof WriteConcern ? inherit : inherit.writeConcern; | |||
|
|||
const mergedOpts = { ...parentOpts, ...opts } as WriteConcernSettings; | |||
const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const { | |
const mergedOpts: WriteConcernSettings = { ...parentOpts, ...opts }; |
avoid casting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed to cast here as the parentOps and opts had potential undefined values.
@@ -605,6 +605,7 @@ function setOption( | |||
if (values[0] == null) { | |||
break; | |||
} | |||
// eslint-disable-next-line @typescript-eslint/no-base-to-string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest: add a comment explaining why we want to ignore this lint warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comment.
src/operations/distinct.ts
Outdated
@@ -96,7 +96,7 @@ export class DistinctOperation extends CommandOperation<any[]> { | |||
|
|||
const result = await super.executeCommand(server, session, cmd, timeoutContext); | |||
|
|||
return this.explain ? result : result.values; | |||
return this.explain ? (result as any[]) : result.values; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return this.explain ? (result as any[]) : result.values; | |
// @ts-expect-error Explain always returns a document | |
return this.explain ? result : result.values; |
Instead of hiding the casting away the here, we should make it clear we expect this TS error and explain why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
Description
Updates typescript to 5.8.3
What is changing?
erasableSyntaxOnly
option.Is there new documentation needed for these changes?
None
What is the motivation for this change?
NODE-6939
Release Highlight
Fill in title or leave empty for no highlight
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript