Skip to content

eslint: enable recommended ruleset #3263

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 10 commits into from
Apr 12, 2025

Conversation

alxndrsn
Copy link
Contributor

@alxndrsn alxndrsn commented Jun 19, 2024

No description provided.

alxndrsn added 2 commits June 19, 2024 15:11
Also delete tests which have not been enabled since 2017.
@alxndrsn
Copy link
Contributor Author

@brianc is there anything I can do to help get this PR considered for review?

Copy link
Collaborator

@charmander charmander left a comment

Choose a reason for hiding this comment

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

I’d merge this if it were just the ESLint rule. Don’t want to combine two unrelated changes.

alxndrsn added 3 commits February 20, 2025 07:07
@alxndrsn
Copy link
Contributor Author

I’d merge this if it were just the ESLint rule. Don’t want to combine two unrelated changes.

Thanks for the feedback. I've reverted the unrelated changes.

@charmander
Copy link
Collaborator

Oh, I see there are no code changes associated with this. How about applying the entire ESLint recommended configuration, then?

@alxndrsn alxndrsn changed the title eslint: add rule: no-unreachable eslint: enable recommended ruleset Apr 6, 2025
@alxndrsn
Copy link
Contributor Author

alxndrsn commented Apr 6, 2025

How about applying the entire ESLint recommended configuration, then?

I've done this, and updated the PR title to reflect the change.

Eslint's ECMAScript version is bumped to 2020 as this was required to support globalThis (already in use before this PR), and 2020 seems to be fully supported by node 16, which is the oldest version supported in this repo's CI tests:

node:
- '16'
- '18'
- '20'
- '22'
- '23'

It's picked up some obvious errors, and some stuff which is more debatable.

Copy link
Collaborator

@charmander charmander left a comment

Choose a reason for hiding this comment

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

Thank you! It’s nice to see this change catching some important issues.

@@ -225,7 +225,7 @@ suite.test('sasl/scram', function () {
0x0d, // signature algorithm length
0x06, // ASN.1 OID
0x09, // OID length
0x2a, // OID: 1.2.840.113549.1.1.11 (RSASSA-PKCS1-v1_5 / SHA-256)
0x2a, // OID: 1.2.840.113549.1.1.11 (RSASSA-PKCS1-v1_5 / SHA-256)
Copy link
Collaborator

Choose a reason for hiding this comment

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

(note for other readers: the difference is a zero-width space after “SHA-256”)

@charmander
Copy link
Collaborator

Eslint's ECMAScript version is bumped to 2020 as this was required to support globalThis (already in use before this PR), and 2020 seems to be fully supported by node 16, which is the oldest version supported in this repo's CI tests:

You can define navigator as a global instead. Despite the lack of CI, pg 8 still supports Node 8(!).

@alxndrsn alxndrsn requested a review from hjr3 as a code owner April 11, 2025 08:28
@alxndrsn
Copy link
Contributor Author

You can define navigator as a global instead. Despite the lack of CI, pg 8 still supports Node 8(!).

Any thoughts on what to do with the existing globalThis in packages/pg/lib/crypto/utils-webcrypto.js? From the filename, maybe it doesn't get used in node, so a specific exception would be ok?

@charmander charmander merged commit 9b51037 into brianc:master Apr 12, 2025
6 checks passed
charmander added a commit to charmander/node-postgres that referenced this pull request Apr 12, 2025
charmander added a commit that referenced this pull request Apr 13, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…3419)

This hid the error fixed in #3263, for example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants