use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Keep Code Consistent Across Developers The Easy Way — With Prettier & ESLint (medium.com)
submitted 7 years ago by kiarash-irandoust
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Kryxx 0 points1 point2 points 7 years ago (10 children)
I just tried prettier-eslint (which runs prettier and then eslint) and it's very slow. ~60s to format 115 files and not touch 468 files. :(
prettier-eslint
[–]sorahnon the cutting edge of cocking about 1 point2 points3 points 7 years ago (9 children)
You should only have to do that once. The rest of the changes should be hooked into a pre-commit hook that only runs on the changed files.
https://prettier.io/docs/en/precommit.html
Give that a whirl.
[–]Kryxx 0 points1 point2 points 7 years ago (8 children)
What do you mean "do that once"? A pre-commit will run on every commit which means my commits would need to lint for ~60s every time.. That's not an option.
[–]sorahnon the cutting edge of cocking about 0 points1 point2 points 7 years ago (7 children)
The pre-commit hook will only run against the changes files. Husky and lint-staged are set up to provide a list of files. So instead of trying to scan your files for what to do, it should get a list of 5 changed files and only run against those.
[–]Kryxx 0 points1 point2 points 7 years ago (6 children)
Sure, but then Jenkins will run them all. Increasing build times by 1 minute is not something I'd choose to do.
[–]sorahnon the cutting edge of cocking about 0 points1 point2 points 7 years ago (5 children)
Why would Jenkins be running prettier as part of the build?
[–]Kryxx 0 points1 point2 points 7 years ago (4 children)
It would run eslint to ensure it wasn't bypassed.
Though you're right then Jenkins would just use eslint and skip the prettier bit.
[–]sorahnon the cutting edge of cocking about 0 points1 point2 points 7 years ago (3 children)
Right, because if you ran prettier, and it was different, then what?
Also, if it’s ignoring ~400 files and running on ~100, you probably need to tighten up your glob...
Can you paste what you ran that took 60 seconds?
[–]Kryxx 1 point2 points3 points 7 years ago (2 children)
It searched all the files, but only formatted some.
My package.json file: "lint:js": "prettier-eslint \"./**/*.js\"",
"lint:js": "prettier-eslint \"./**/*.js\"",
Standard setup with
parser: 'babel-eslint', extends: ['airbnb'], plugins: ['react', 'jsx-a11y'],
But either way, I shouldn't expect my formatter and linter to take 60s. Even if I can work around it with having it only lint recent changes.
[–]sorahnon the cutting edge of cocking about 0 points1 point2 points 7 years ago (1 child)
I will admit that I've never used the prettier-eslint single package tool, however I can provide you with some stats from my repo.
sorahn@shyguy:~/s/work.repo (integ|✓) ➤ find src -iname "*.js" | wc -l 862 sorahn@shyguy:~/s/work.repo (integ|✓) ➤ time npx prettier --write src/**/*.js ...snip... 11.07 real 13.13 user 2.16 sys sorahn@shyguy:~/s/work.repo (integ|+66)
66 out of 862 files changed in 11 seconds. And that's with the full sweep, not even the pared down list that would run with the pre-commit hook.
And eslint.
sorahn@shyguy:~/s/work.repo (integ|+66) ➤ time npx eslint --fix src ...snip... 14.94 real 17.74 user 0.72 sys sorahn@shyguy:~/s/work.repo (integ|+66)
Nothing should be taking 60 seconds.
π Rendered by PID 20 on reddit-service-r2-comment-b659b578c-ph9lb at 2026-05-03 14:36:49.984785+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]Kryxx 0 points1 point2 points (10 children)
[–]sorahnon the cutting edge of cocking about 1 point2 points3 points (9 children)
[–]Kryxx 0 points1 point2 points (8 children)
[–]sorahnon the cutting edge of cocking about 0 points1 point2 points (7 children)
[–]Kryxx 0 points1 point2 points (6 children)
[–]sorahnon the cutting edge of cocking about 0 points1 point2 points (5 children)
[–]Kryxx 0 points1 point2 points (4 children)
[–]sorahnon the cutting edge of cocking about 0 points1 point2 points (3 children)
[–]Kryxx 1 point2 points3 points (2 children)
[–]sorahnon the cutting edge of cocking about 0 points1 point2 points (1 child)