Skip to content

chore(NODE-4376): add typescript to eslint rules #505

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

Merged
merged 9 commits into from
Jul 1, 2022

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Jun 28, 2022

Description

What is changing?

NODE-4376

mongodb/node-mongodb-native#3304

Also updates a number of dependencies.

Is there new documentation needed for these changes?

What is the motivation for this change?

Driver tooling sync

Double check the following

  • Ran npm run lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: <type>(NODE-xxxx)<!>: <description>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@nbbeeken nbbeeken force-pushed the NODE-4321/ts-es-lint branch from 0c5fa90 to 5e70517 Compare June 28, 2022 21:56
@nbbeeken nbbeeken marked this pull request as ready for review June 29, 2022 18:36
@baileympearson baileympearson self-requested a review June 29, 2022 18:38
@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Jun 29, 2022
Copy link
Contributor

@baileympearson baileympearson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requesting changes for visibility

@nbbeeken nbbeeken requested a review from baileympearson June 29, 2022 19:05
"typedoc": "^0.21.2",
"typescript": "^4.0.2",
"tsd": "^0.21.0",
"typescript": "^4.7.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typedoc is intentionally removed here ✅

@@ -31,22 +30,23 @@
"@babel/plugin-external-helpers": "^7.10.4",
"@babel/preset-env": "^7.11.0",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@microsoft/api-extractor": "^7.11.2",
"@microsoft/api-extractor": "^7.28.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmed that no new prod dependencies are added

baileympearson
baileympearson previously approved these changes Jun 30, 2022
@nbbeeken nbbeeken changed the title chore(NODE-4321): add typescript to eslint rules chore(NODE-4376): add typescript to eslint rules Jun 30, 2022
Copy link
Contributor

@dariakp dariakp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we actually want to keep all these rules as best practices, can we provide context for the cases where we explicitly disable them as to why it's ok to disable them in that particular case? Otherwise if the instances are out of scope to fix, I would at least tag all those lines with a follow up node ticket

Copy link
Contributor

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don’t have much to comment on the added eslint-disable-next-line lines, they don’t seem to have obvious alternatives in the places where they are used afaict.

src/code.ts Outdated
@@ -52,7 +52,7 @@ export class Code {

inspect(): string {
const codeJson = this.toJSON();
return `new Code("${codeJson.code}"${
return `new Code("${codeJson.code.toString()}"${
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to do

Suggested change
return `new Code("${codeJson.code.toString()}"${
return `new Code("${String(codeJson.code)}"${

here as well, since there is no argument validation in the constructor and this handles null/undefined as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call!

@nbbeeken nbbeeken requested a review from addaleax July 1, 2022 14:52
@nbbeeken nbbeeken added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Jul 1, 2022
@nbbeeken nbbeeken requested a review from baileympearson July 1, 2022 15:20
@baileympearson baileympearson merged commit a2a81bc into main Jul 1, 2022
@baileympearson baileympearson deleted the NODE-4321/ts-es-lint branch July 1, 2022 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants