-
Notifications
You must be signed in to change notification settings - Fork 1
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
Recommend Prettier? #13
Comments
Ps: Prettier supports css/scss out of the same box. |
Definitely worth a discussion, do you know if Prettier or a similar tool comes with a config file you can customize? If we had a .prettierrc file or something that we could shape around our standards that would be ideal. Also, if Prettier doesn't play nice with CSS Next, then maybe we can look into using something like this: https://stylelint.io/user-guide/postcss-plugin/ -- since we're already using PostCSS, it may be a nice drop in solution. Though I don't think it'll automatically fix the linting issues like Prettier does. |
There is an rc file: https://prettier.io/docs/en/configuration.html My feelings on Prettier aren't strong, but it would be very cool to have one solution that could handle css and js. |
We have the same issue with Gutenberg. The lack of spaces around everything that WordPress coding standards enforce is a blocker. See related thread: WordPress/gutenberg#2819. We solved it at @Automattic for Calypso forking Prettier - https://github.com/Automattic/calypso-prettier. I don't think it's a long-term solution for WordPress community, but sharing it anyway :) |
Thanks a ton for the insight @gziolo much appreciated!! |
Auto-formatting code is a Big Deal for me. I want to spend 0 seconds of my life indenting and spacing things when my computer can do a much better job of it anyway.
It would be amazing if we could (all) move to using something like Prettier and never have to deal with it again. I've played with Prettier a bunch of late and while it's not my favourite of the options, I think it's probably the leading contender and it has plugins for most major editors now (ST, vscode, PHPStorm, Atom).
It's not the job of this starter theme to dictate what text editor plugins you use, but if we decide to encourage the use of Prettier, we need to change some of the eslint config. In some cases, Prettier handles a lot of what eslint enforces already, while in other cases it's at odds with what's in the current .eslintrc.
Disclaimer: While we at 10up follow WordPress-like code standards in our js, with lots of ( 'spaces' ) around [ 'everything' ], Prettier currently doesn't support this, and isn't likely to. I thought this was going to be a deal-breaker for me at first, but I'm learning to move on and let the other benefits weigh against this detraction.
The text was updated successfully, but these errors were encountered: