question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reduce disk churn for ESLint upgrades

See original GitHub issue

The version of ESLint you are using. 7.19.0 and earlier upgrades to, for example, 7.13.0

The problem you want to solve. ESLint upgrades cause significant file changes in node_modules. We have hit this problem multiple times, some statistics:

  • 7.14.0 -> 7.19.0 (5 minor versions)
3796 files changed, 162528 insertions(+), 5876 deletions(-)

https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2692306

  • 6.8.0 -> 7.13.0 (1 major version, 13 minor versions)
8913 files changed, 125261 insertions (+), 241831 deletions (-)

https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2534873

  • 6.0.1 -> 6.8.0 (7 minor versions)
634 files changed, 47325 insertions (+), 9376 deletions (-)

https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2137384

As an effect of these ESLint upgrades, checking out repositories becomes a lot slower and disk churn increases significantly for all contributors and bots.

Please note that we are required to check in our node_modules for security and stability reasons. We are not allowed to make calls to external repositories in our testing infrastructure, which means we have to include the files in our repository. That said, even if you wouldn’t check in your files, the effects on files changed and disk operations remain. E.g. if you gitignore your node_modules, ESLint upgrades would still cause significant disk churn.

Your take on the correct solution to problem. Reduce the disk churn either by dropping dependencies that cause excessive disk usage and drop dependencies that are commonly duplicated in node_modules trees. For example, in nearly all of our upgrades, we are observing multiple copies of lodash in among others @eslint/eslintrc or AST-like packages like es-abstract.

Are you willing to submit a pull request to implement this change? I don’t think this is something I can do as an external contributor, but feel free to led me/the community know if there are dependencies that could be pruned and usages can be migrated to reduce overall disk usage.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:13
  • Comments:44 (43 by maintainers)

github_iconTop GitHub Comments

4reactions
TimvdLippecommented, Jun 28, 2021

Good news! Removing Lodash removed 44k lines in NodeJS: https://github.com/nodejs/node/pull/38764

2reactions
stephenwadecommented, May 6, 2021

I’ve submitted #14287 to update table and remove lodash.

node_modules size comparison:

~/git/eslint-test-master$ echo '{ "dependencies": { "eslint": "eslint/eslint" } }' > package.json
~/git/eslint-test-master$ npm install >/dev/null
~/git/eslint-test-master$ du -sh node_modules
22M	node_modules

~/git/eslint-test-stephenwade$ echo '{ "dependencies": { "eslint": "stephenwade/eslint#remove-lodash-3" } }' > package.json
~/git/eslint-test-stephenwade$ npm install >/dev/null
~/git/eslint-test-stephenwade$ du -sh node_modules
17M	node_modules

~/git$ diff -U0 <(cd eslint-test-master; du -hd1 node_modules) <(cd eslint-test-stephenwade; du -hd1 node_modules) | grep "^[-+]\d"
-4.9M	node_modules/lodash
-16K	node_modules/escape-string-regexp
+20K	node_modules/escape-string-regexp
+28K	node_modules/deep-extend
-240K	node_modules/@babel
+256K	node_modules/@babel
-22M	node_modules
+17M	node_modules
Read more comments on GitHub >

github_iconTop Results From Across the Web

Nicholas C. Zakas on Twitter: " If you want to grow your open ...
An example from ESLint that addressed something not on our radar: github.com. Reduce disk churn for ESLint upgrades · Issue #14098 · eslint/eslint....
Read more >
Rules for Configuring ESLint to Optimize Code Review - Medium
This will prevent ESLint from looking for further config files up the hierarchy on disk or within the user's directory. All that's needed...
Read more >
How to disable eslint rule max line length for paragraph in ...
Original Answer. AFAIK, there is no way to apply eslint rules to the template, and specifically to one line in a template. I...
Read more >
Migrating to v7.0.0 - ESLint - Pluggable JavaScript Linter
To address: Make sure you upgrade to at least Node.js 10.12.0 when using ESLint v7.0.0. One important thing to double check is the...
Read more >
Monitoring churn patterns on virtual machines - Azure
For Azure virtual machines (Windows or Linux). If your machine is hosted in Azure and is using a managed or unmanaged disk for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found