prettier-eslint-cli: slow performance. How long should it take?
prettier-eslint-cli
version: 4.1.1prettier
version: 0.22.0eslint
version: 4.2.0
Relevant code/config.
What you did:
prettier-eslint file.js
What happened:
the prettier command takes less than a second and the prettier-eslint command takes about 4-5 seconds on the same file. Is this a normal execution time?
Reproduction:
– paste your link here –
Problem description:
Suggested solution:
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 2
- Comments: 15 (3 by maintainers)
Stale issue
While investigating a slow performance of eslint, I found that the most time of what it takes is
prettier/prettier
:TIMING=1 yarn lint
For anyone looking for workarounds, if you just run
prettier
directly instead of running it through ESLint, it runs dramatically faster.This is what I do in
package.json
, using TypeScript withcreate-react-app
:something is eating my machine:
in my case, it was extrimly slow because I worked in a monorepo (with yarn) and each package had huge node_module.
I forced that all packages has the exact same version of all dependnecies so all the packages’s node_module folders become almost empty (all the installations moved to the root node_module).
I reduced the lint duration from 316 seconds to 50 seconds.
still slow as hell but good enough for now.
Seeing similar