New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Prettier #1945
Comments
YES |
Wow! How could we miss this! Awesome. |
Prettier is definitely the must. I will be more than happy to help with that. But probably let's discuss configuration first. I am used to using following config:
As you see, I am not a big fan of semicolons. I would rather removed them from ESLint config as well. So what do you think? Semicolons yes (👍 ) or no (👎 )? |
@dannytce i share your preferences, however it's so easy to expose configuration, let's use defaults (with semi) but leave options in userland so everyone can be happy |
on the codebase there are 2K+ of problems so we have to use "warn" instead of error and plan a fix rollout. in order to work with eslint we have to add eslint-plugin-prettier. ref: https://github.com/prettier/prettier ref: https://github.com/prettier/eslint-plugin-prettier close react-boilerplate#1945
Hi, |
Would definitely love to see this happen. I'd be willing to open a PR if nobody else has yet. |
I'm currently using react-boilerplate with prettier in 2 projects, here's my config. It looks like the current eslint configuration and it also adds the prettier to precommit and removes eslint from precommit. package.json
.eslintrc.js
This might help if someone is going to make a PR |
Prettier setting above: I just tested it and works like charm! thanks @sourcesoft :) I have one question. Is there anything that we have to be cautious when running prettier on every single js file ? For example, create-react-app prettier integration only read js file in src folder. Just curious about the reason behind this code.
|
@SeunghunSunmoonLee Sometimes we have server, configuration or temp files that need to be formatted differently compared to rest of the files. In my case I once had a /db folder with |
Thanks @sourcesoft! I'm gonna close this for now bc I believe this is being tossed around in PRs and will def be integrated, but anyone is welcome to add to this convo |
@sourcesoft I just found an issue. After running 'git commit' followed by prettier, some of my node_modules were deleted automatically, started getting http://localhost:3000/__webpack_hmr net::ERR_INCOMPLETE_CHUNKED_ENCODING error messages. |
@SeunghunSunmoonLee No I haven't, it feels like a firewall problem to me. See #2083 for better implementation, mine's kind of dirty. |
Done in #2083, ready for review. |
@gretzky reopening to track PR |
@justingreenberg wasn't this moved to #2083 ? |
@justingreenberg i'm aware, sorry, i thought that PR had been merged already |
@gretzky @mxstbr im using this with steps assuming you have prettier installed: npm install onchange --save-dev then I made a script in package.json "prettier-watch": "onchange 'app/**/*.js' 'app/**/*.test.js' 'app/**/*.scss' 'stories/**/*.stories.js' -- prettier --write {{changed}}" to run npm run prettier-watch so this script will keep running until you want it to. @blling I saw you did a PR for it a few months ago so you might find this interesting. |
Anybody here interested in reviewing the Prettier integration which is supposed to make it into v3.6? Please take a look at #2244. It's integrated with ESLint via the relevant plugin+baseConfig, calibrated for ES5 (because of Node 6 compatibility) and triggered for JS and JSON by pre-commit hooks. It could do with extra docs though. Either way, I'll be closing this as v3.6 is getting close to release. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
i'm surprised nobody has brought this up yet... it's been a game changer for my team. would be nice to integrate with #1711 husky pre-commit hooks. imo this is a no-brainer, kinda wish it shipped with v3.5. maybe we can tighten up the releases and cut another minor in the next couple of weeks
The text was updated successfully, but these errors were encountered: