Skip to content

Conversation

@avivkeller
Copy link
Member

@avivkelleravivkeller commented Aug 6, 2024

This PR removes eslint as a local dependency and switches to downloading it from npm. It will still be updated regularly via @dependabot.

Why?

  1. eslint is the only linter stored locally (besides cpplint, which has patches, unlike ESLint).
  2. There are multiple issues related to file paths being too long and tarballs failing to lint properly (see: Missing ./tools/node_modules/eslint/eslint.js on make test? #39709, make -s test-doc fails with Error: Cannot find module '/node-v14.4.0/tools/doc/../node_modules/eslint/node_modules/js-yaml' #34005, Erbium: test regression in tarball #32765, and others).

Why was eslint set up like this initially?

When eslint was first added to the repository in #1539 around 10 years, it replaced a (not as large, but still large) library, closure-lint. Since then, the library has almost 4x its size. At the time, there was no discussion (AFAICT) about keeping or removing the directory—it was simply included as it was.

Size-wise, this'll save ~40MB, which is a decent amount.


(I'll add more fixes as I find more issues)
Fixes#39709
Fixes#54231

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/actions
  • @nodejs/security-wg
  • @nodejs/tsc

@nodejs-github-botnodejs-github-bot added build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. labels Aug 6, 2024
@avivkeller
Copy link
MemberAuthor

avivkeller commented Aug 6, 2024

CC @nodejs/build @nodejs/linting

@avivkelleravivkeller changed the title build: don't sure eslint locallybuild: don't store eslint locallyAug 6, 2024
@avivkelleravivkeller added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Aug 6, 2024
@avivkeller
Copy link
MemberAuthor

Reviewers, please review the commit '(review changes)'. The first commit removes the node_modules directory and may be hard to review in the github UI.

@avivkeller
Copy link
MemberAuthor

Everything is passing! The failure is because of #54229. The original PR didn't see any objections, is this good to land in the coming days?

@codecov
Copy link

codecovbot commented Aug 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.33%. Comparing base (1bcdba2) to head (6b95bab).
Report is 289 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #54231 +/- ## ========================================== + Coverage 87.10% 87.33% +0.23%  ========================================== Files 647 648 +1 Lines 181693 182321 +628 Branches 34869 34972 +103 ========================================== + Hits 158256 159225 +969 + Misses 16733 16371 -362 - Partials 6704 6725 +21 

see 90 files with indirect coverage changes

@bnb
Copy link
Contributor

bnb commented Aug 7, 2024

I'm +1 to this approach, but feel like there's probably folks who have more domain knowledge about this who should actually be the ones to approve it.

@silverwind
Copy link
Contributor

I don't think there was any specific reason why those linters were checked into the repo besides maybe offline functionality, but I think that's likely no longer needed.

@avivkeller
Copy link
MemberAuthor

Great! I'm glad y'all are on board! Seeing as the linting is passing (except for the unrelated issue), all looks good in terms of land-ability.

Although, I assume this needs a CI to land.

@benjamingrbenjamingr added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 7, 2024
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 7, 2024
@nodejs-github-bot
Copy link
Collaborator

@avivkeller
Copy link
MemberAuthor

avivkeller commented Aug 7, 2024

CI is passing. 🎉
Linting is passing except for an unrelated failured that was patched in 7327e44.

@nodejs-github-bot
Copy link
Collaborator

@aduh95aduh95 added dont-land-on-v18.x dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. labels Aug 9, 2024
aduh95
aduh95 previously requested changes Aug 9, 2024
Copy link
Contributor

@aduh95aduh95 left a comment

Choose a reason for hiding this comment

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

Everytime I run e.g. make lint-js on this branch, it runs npm. Can you make it sure npm is run only when there were changes in the package-lock.json?

@silverwind
Copy link
Contributor

silverwind commented Aug 9, 2024

Everytime I run e.g. make lint-js on this branch, it runs npm. Can you make it sure npm is run only when there were changes in the package-lock.json?

FWIW, it's possible to achieve on-demand node_modules installation with Make by tracking the folder timestamp, but it's not a 100% thing as Make timestamp tracking works best with files. Here is how I do it in my projects:

node_modules: package-lock.json npm install --no-save @touch node_modules

@avivkelleravivkellerforce-pushed the eslint-not-local branch 2 times, most recently from b003520 to d9eb162CompareAugust 12, 2024 15:54
@avivkelleravivkeller requested a review from targosAugust 12, 2024 22:07
@avivkeller
Copy link
MemberAuthor

Any more changes needed?

@avivkeller
Copy link
MemberAuthor

avivkeller commented Aug 23, 2024

Thanks for approving! Does anyone else have any more feedback? It's been a while since any reviews.

@avivkeller
Copy link
MemberAuthor

No objections in a week, is this author ready?

@aduh95
Copy link
Contributor

*`author-ready` - A pull request is _author ready_ when:
* There is a CI run in progress or completed.
* There is at least one collaborator approval (or two TSC approvals for
semver-major pull requests).
* There are no outstanding review comments.
Please always add the `author ready` label to pull requests that qualify.
Please always remove it again as soon as the conditions are not met anymore,
such as if the CI run fails or a new outstanding review comment is posted.

so this is not author ready because there are no recent Jenkins CI run. If you start one, it would be.

@avivkelleravivkeller added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 1, 2024
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 1, 2024
@nodejs-github-bot
Copy link
Collaborator

@avivkelleravivkeller added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 1, 2024
@avivkeller
Copy link
MemberAuthor

avivkeller commented Sep 1, 2024

Per @aduh95's comment:

  • There is a CI run in progress or completed. 🟢
  • There is at least one collaborator approval.
  • There are no outstanding review comments.

@nodejs-github-bot
Copy link
Collaborator

@avivkeller
Copy link
MemberAuthor

The MacOS CI appears to have failed to start, could someone restart it?

As for the linked linux OpenSSL one, see #54737

@nodejs-github-bot
Copy link
Collaborator

@avivkeller
Copy link
MemberAuthor

FWIW CI is 🟢 (Yay!)

@aduh95aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 6, 2024
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 6, 2024
@nodejs-github-botnodejs-github-bot merged commit 437e168 into nodejs:mainSep 6, 2024
@nodejs-github-bot
Copy link
Collaborator

Landed in 437e168

aduh95 pushed a commit that referenced this pull request Sep 12, 2024
PR-URL: #54231 Reviewed-By: Antoine du Hamel <[email protected]>
@RafaelGSSRafaelGSS mentioned this pull request Sep 16, 2024
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
tpoisseau pushed a commit to tpoisseau/node that referenced this pull request Nov 21, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.buildIssues and PRs related to build files or the CI.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.dont-land-on-v20.xPRs that should not land on the v20.x-staging branch and should not be released in v20.x.metaIssues and PRs related to the general management of the project.needs-ciPRs that need a full CI run.review wantedPRs that need reviews.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing ./tools/node_modules/eslint/eslint.js on make test?

9 participants

@avivkeller@nodejs-github-bot@bnb@silverwind@aduh95@nschonni@targos@richardlau@benjamingr