Don't know where to look?

You can search all my notes here

Speedup eslint

Sometimes it happens that eslint-times seems to get extremly long without any apparent reason. To the point where the command npx eslint . in the project-folder would simply hang, or run out of memory without ever returning any results.

One reason for this can be if you set up your project-structure simular to how I do it:

๐Ÿ“‚ project
|- ๐Ÿ“‚ node_modules
|- ๐Ÿ“‚ .parcel-cache
|- ๐Ÿ“‚ src
|- ๐Ÿ“‚ dist
|- package.json
|- .eslintrc

If you run eslint in a project like this, it will by default not look inside the node_modules-folder, because the code there is expected to be messy and you probably don’t care about that.

Sadly there is no way for eslint, to know that you also don’t care about the compiled code in dist or cache-directories like .parcel-cache. Therefore eslint will by default spend a long time inside these folders finding only errors that you don’t care about.

So if you are experiencing extremly long lint-times, make sure that you add all these folders to your .eslintignore:

.eslintignore
dist/
.parcel-cache/
node_modules/

Good luck!

Comments

Post-Meta
Included files
  • .eslintignore
  • readme.md
Download all