Skip to content
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

BREAKING: Bump all ESLint dependencies #351

Merged
merged 8 commits into from
Jun 4, 2024
Merged

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Mar 27, 2024

This bumps all ESLint and related dependencies to the latest version which has support for Node 16. When we drop support for Node 16, some dependencies can be bumped again.

The exceptions are:

  • eslint-plugin-import, which has a regression since >=27.0.0. I'm planning to swap it out with eslint-plugin-import-x (a fork of eslint-plugin-import) since it has significantly better performance regardless.
  • Prettier and related dependencies, which has breaking changes which are incompatible with @metamask/auto-changelog.

Closes #349.
Closes #338.

Breaking changes

  • @typescript-eslint/eslint-plugin now requires a boolean for parserOptions.project, instead of a path to tsconfig.json.
  • @typescript-eslint/eslint-plugin now requires strictNullChecks to be enabled.

Copy link

socket-security bot commented Mar 27, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@es-joy/[email protected] None 0 113 kB brettz9
npm/@eslint/[email protected] filesystem, unsafe +1 785 kB eslintbot
npm/@isaacs/[email protected] None 0 27.8 kB isaacs
npm/@lavamoat/[email protected] None 0 19.8 kB boneskull
npm/@lavamoat/[email protected] environment 0 45.8 kB boneskull
npm/@npmcli/[email protected] environment, network 0 17.7 kB npm-cli-ops
npm/@npmcli/[email protected] filesystem 0 26.5 kB lukekarrys
npm/@npmcli/[email protected] filesystem 0 21.8 kB npm-cli-ops
npm/@npmcli/[email protected] filesystem 0 37 kB npm-cli-ops
npm/@npmcli/[email protected] environment, shell 0 12.2 kB npm-cli-ops
npm/@npmcli/[email protected] environment 0 18.4 kB npm-cli-ops
npm/@pkgjs/[email protected] None 0 74.2 kB oss-bot
npm/@pkgr/[email protected] None 0 8.54 kB jounqin
npm/@typescript-eslint/[email protected] Transitive: environment +5 4.54 MB jameshenry
npm/@typescript-eslint/[email protected] None +1 173 kB jameshenry
npm/@typescript-eslint/[email protected] None 0 109 kB jameshenry
npm/@ungap/[email protected] None 0 26.2 kB webreflection
npm/[email protected] None 0 4.83 kB lukekarrys
npm/[email protected] network 0 38.8 kB fengmk2
npm/[email protected] filesystem 0 20.6 kB npm-cli-ops
npm/[email protected] unsafe 0 4.51 kB sindresorhus
npm/[email protected] filesystem +2 756 kB npm-cli-ops
npm/[email protected] None 0 366 kB yavorskiys
npm/[email protected] None 0 15.9 kB simenb
npm/[email protected] None 0 13.6 kB komagata
npm/[email protected] filesystem 0 48.6 kB ota-meshi
npm/[email protected] None 0 396 kB eslint-community-bot
npm/[email protected] None +3 2.26 MB gajus
npm/[email protected] filesystem 0 1.38 MB gajus
npm/[email protected] None 0 94 kB lo1tuma
npm/[email protected] filesystem +1 400 kB weiran.zsd
npm/[email protected] None +1 106 kB eslintbot
npm/[email protected] None 0 37.3 kB sssayegh
npm/[email protected] shell 0 60.4 kB isaacs
npm/[email protected] filesystem 0 14.4 kB npm-cli-ops
npm/[email protected] None 0 4.54 kB sindresorhus
npm/[email protected] filesystem, unsafe 0 101 kB hirokiosame
npm/[email protected] None 0 152 kB sindresorhus
npm/[email protected] None 0 8.77 kB ljharb
npm/[email protected] None 0 26.7 kB npm-cli-ops
npm/[email protected] None 0 177 kB beaugunderson
npm/[email protected] None 0 3.88 kB sindresorhus
npm/[email protected] environment 0 253 kB isaacs
npm/[email protected] None 0 46.9 kB andyperlitch
npm/[email protected] network 0 52.8 kB npm-cli-ops
npm/[email protected] None 0 4.96 kB isaacs
npm/[email protected] environment, network 0 46.8 kB npm-cli-ops
npm/[email protected] None 0 286 kB isaacs
npm/[email protected] environment, shell +2 2.64 MB lukekarrys
npm/[email protected] None 0 26.2 kB npm-cli-ops
npm/[email protected] None 0 28.3 kB npm-cli-ops
npm/[email protected] None 0 6.21 kB npm-cli-ops
npm/[email protected] None 0 19.1 kB npm-cli-ops
npm/[email protected] None 0 16.4 kB npm-cli-ops
npm/[email protected] filesystem 0 529 kB isaacs
npm/[email protected] None 0 5.21 kB lukekarrys
npm/[email protected] None 0 15 kB hirokiosame
npm/[email protected] None 0 23.4 kB kemitchell
npm/[email protected] None 0 12.3 kB kemitchell
npm/[email protected] None 0 38.7 kB npm-cli-ops
npm/[email protected] None 0 0 B
npm/[email protected] None 0 0 B
npm/[email protected] None 0 828 kB joshuakgoldberg
npm/[email protected] None 0 3.41 kB lukekarrys
npm/[email protected] None 0 2.58 kB lukekarrys
npm/[email protected] None 0 123 kB ctavan
npm/[email protected] None 0 16.6 kB kemitchell
npm/[email protected] None 0 7.88 kB lukekarrys
npm/[email protected] environment Transitive: filesystem +1 50.5 kB npm-cli-ops
npm/[email protected] None 0 0 B

🚮 Removed packages: npm/@es-joy/[email protected], npm/@eslint/[email protected], npm/@lavamoat/[email protected], npm/@lavamoat/[email protected], npm/@nicolo-ribaudo/[email protected], npm/@npmcli/[email protected], npm/@npmcli/[email protected], npm/@npmcli/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@typescript-eslint/[email protected], npm/@typescript-eslint/[email protected], npm/@typescript-eslint/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

Copy link

socket-security bot commented Mar 27, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package Note
New author npm/[email protected]
Shell access npm/[email protected]
Shell access npm/[email protected]
New author npm/[email protected]
New author npm/[email protected]
New author npm/[email protected]
New author npm/[email protected]
Network access npm/@npmcli/[email protected]
Network access npm/@npmcli/[email protected]
Network access npm/@npmcli/[email protected]
Network access npm/@npmcli/[email protected]
Network access npm/@npmcli/[email protected]

View full report↗︎

Next steps

What is new author?

A new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.

Scrutinize new collaborator additions to packages because they now have the ability to publish code into your dependency tree. Packages should avoid frequent or unnecessary additions or changes to publishing rights.

What is shell access?

This module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.

Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced.

What is network access?

This module accesses the network.

Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

"eslint-plugin-import": "~2.26.0",
"eslint-plugin-jsdoc": "^39.6.2 || ^41 || ^43.0.7",
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure why we used this range before, but I replaced it with the latest (Node.js 16-compatible) version. I can revert if there's a good reason to have this range.

cc @legobeat

Copy link
Contributor

@legobeat legobeat Apr 15, 2024

Choose a reason for hiding this comment

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

Comment on lines -101 to -106
'max-statements-per-line': [
'error',
{
max: 1,
},
],
Copy link
Member Author

Choose a reason for hiding this comment

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

Our validation script was complaining about this being handled by Prettier.

Comment on lines +389 to +395
'jsdoc/tag-lines': [
'error',
'any',
{
startLines: 1,
},
],
Copy link
Member Author

Choose a reason for hiding this comment

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

AFAIK this matches the previous behaviour, where one line between the description and the first tag is required.

Comment on lines -35 to -36
// Should be disabled per Prettier
'@typescript-eslint/no-extra-semi': 'off',
Copy link
Member Author

Choose a reason for hiding this comment

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

Our validation script was complaining about this being handled by Prettier.

@@ -1,3 +1,6 @@
{
"compilerOptions": {
"strictNullChecks": true
Copy link
Member Author

@Mrtenz Mrtenz Mar 27, 2024

Choose a reason for hiding this comment

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

This is now required by @typescript-eslint/eslint-plugin when type checking is enabled. I think most of our repos use strict which also enables this anyway.

@Mrtenz Mrtenz changed the title Bump all ESLint dependencies BREAKING: Bump all ESLint dependencies Mar 27, 2024
@Mrtenz Mrtenz marked this pull request as ready for review March 27, 2024 13:03
@Mrtenz Mrtenz requested a review from a team as a code owner March 27, 2024 13:03
@Mrtenz Mrtenz requested review from mcmire and legobeat March 27, 2024 13:03
@mcmire
Copy link
Contributor

mcmire commented Mar 27, 2024

Thanks so much for doing this work, this is super helpful. I'll try to take a look soon.

@Mrtenz Mrtenz force-pushed the mrtenz/bump-dependencies branch from 69a7ea5 to 4eb7750 Compare March 28, 2024 11:35
@Mrtenz Mrtenz requested review from a team as code owners March 28, 2024 11:35
@Mrtenz Mrtenz removed the request for review from a team March 28, 2024 11:36
@Mrtenz
Copy link
Member Author

Mrtenz commented Apr 13, 2024

Bumping to Prettier v3 will require some more changes, so we may want to do that separately.

  • Jest currently does not support Prettier v3 for snapshots.
  • auto-changelog and create-release-branch break because the API is now async.
  • Potentially more issues that I haven't found yet.

Copy link

@kanthesha kanthesha left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Question about upgrading Prettier, but everything else looks pretty good to me.

packages/base/package.json Outdated Show resolved Hide resolved
packages/base/package.json Outdated Show resolved Hide resolved
packages/base/package.json Outdated Show resolved Hide resolved
@desi desi requested a review from a team May 23, 2024 19:18
@mcmire
Copy link
Contributor

mcmire commented May 28, 2024

@Mrtenz Ping on this PR when you get a chance.

@Mrtenz Mrtenz force-pushed the mrtenz/bump-dependencies branch from 6cfabce to 7e7a6f6 Compare May 29, 2024 06:48
@Mrtenz
Copy link
Member Author

Mrtenz commented May 29, 2024

@mcmire @legobeat I reverted the Prettier changes. Unsure what the other decisions are regarding the changes, though.

Copy link
Contributor

@legobeat legobeat left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Looks great!

@mcmire mcmire merged commit 7fe37fe into main Jun 4, 2024
15 checks passed
@mcmire mcmire deleted the mrtenz/bump-dependencies branch June 4, 2024 16:59
@legobeat legobeat mentioned this pull request Jun 4, 2024
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.

Bump to eslint-plugin-jsdoc >= 44.0.0 Bump typescript-eslint to v6
4 participants