3 ms·
Am I right to assume that Prettier runs single-threaded? I was never able to find an option to parallelize (and I assume it is paralellizable). Being able to sp
by justusw 4y ago
Am I right to assume that Prettier runs single-threaded? I was never able to find an option to parallelize (and I assume it is paralellizable). Being able to speed up Prettier would improve my workflow by a lot.
- ajgrover 4y agoThere are third party options you could try like this one (no personal experience): https://github.com/microsoft/parallel-prettier https://github.com/microsoft/parallel-prettier Alternatively, it’s pretty common to only run prettier on changed files using lint-staged or pretty-quick.
- esprehn 4y agoYou can run it through jest: https://github.com/keplersj/jest-runner-prettier https://github.com/keplersj/jest-runner-prettier Or run it through eslint through jest (which is what we do): https://github.com/jest-community/jest-runner-eslint https://github.com/jest-community/jest-runner-eslint https://www.npmjs.com/package/eslint-plugin-prettier https://www.npmjs.com/package/eslint-plugin-prettier Either way gets you parallelism from jest. Personally I like the approach of using jest for all the "match files and run actions" logic (tests, lint etc) and then eslint for all the kinds of linting and formatting. We then configure VSCode to lint autofix on save and get a really nice experience.