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

build: don't store eslint locally #53974

Closed
wants to merge 4 commits into from

Conversation

RedYetiDev
Copy link
Member

@RedYetiDev RedYetiDev commented Jul 20, 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 isn't a huge much, but it's a decent amount.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

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

@nodejs-github-bot nodejs-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 Jul 20, 2024
@RedYetiDev
Copy link
Member Author

RedYetiDev commented Jul 20, 2024

Note that all linters passed in this PR, meaning that eslint is still working the exact same :-)

ref: https://github.com/nodejs/node/actions/runs/10022363992/job/27702051106?pr=53974

@mcollina
Copy link
Member

@nodejs/build is this ok for you?

@anonrig
Copy link
Member

anonrig commented Jul 20, 2024

iOS app and Safari crashes whenever I look into pull-requests like this. Please separate the change into multiple commits and add commit-queue-squash label in order to receive more reviews on pull-requests such as this.

It will still be updated regularly via https://github.com/dependabot.

Where do we see this change?

@RedYetiDev RedYetiDev added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Jul 21, 2024
@RedYetiDev
Copy link
Member Author

RedYetiDev commented Jul 21, 2024

I've split the PR into build: don't store eslint locally (Which removes the node_modules), and (actual changes) which is what is for review.

Where do we see this change?

@dependabot will, every month, check eslint for an update. If it finds one, it will open a PR (with a max of 10 open at a time) to merge the change. Examples of this with Github Actions can be seen via the following search query:
https://github.com/nodejs/node/issues?q=author%3Adependabot%5Bbot%5D

@RedYetiDev RedYetiDev force-pushed the no-local-eslint branch 2 times, most recently from 0c010bb to cbd78e2 Compare July 21, 2024 00:16
tools/eslint/package.json Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@bnb
Copy link
Contributor

bnb commented Jul 22, 2024

as long as this doesn't break build, huge +1 to getting this out of core

@richardlau richardlau added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 22, 2024
Makefile Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 22, 2024
@nodejs-github-bot
Copy link
Collaborator

@RedYetiDev
Copy link
Member Author

as long as this doesn't break build, huge +1 to getting this out of core

It doesn't AFAICT. Additionally, CI passing backs this up.

@RedYetiDev RedYetiDev closed this Aug 6, 2024
@RedYetiDev
Copy link
Member Author

Closing in favor of #54231

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants