-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add prettier #42
Comments
I'm open to this, but I think I'd also like to do the code-generation refactor first (see #44), because the current state of play in |
fully 10% of the prs that go south at work are because someone had to spend an hour fighting a formatter that wasn't able to understand that it was breaking things |
I'm fine with the current approach. If anyone feels strongly about prettier, please send a PR. |
Is this still the case? I'll put up a PR if you're still willing to take it... |
I'd really rather not change all the formatting at this point, but if you can make prettier get "close enough" to what we currently have, I guess I'd look at it. Let's land 425 and 427 first though, please. |
Also, if the answer is yes, is it ok to change some of the eslint rules to match prettier's behavior? eg prettier has no option to split lines before the operator, so the eslint rule |
I really don't want to change the eslint rules unless we get enough benefit out of it. I really don't see prettier as a benefit, since I have my editor configured to give visual cues for every lint violation, and I fix them as I go. |
Actually, while prettier is my preferred formatter, I'm not really attached to it. What I really like about it is that I've configured it in my own projects to format on save, so I no longer have to worry about where to insert spaces, or break lines etc. I just type and save. But I've had to disable that in peggy to avoid breaking all the lint rules (and generally reformatting code that I'm not working on) - which has meant that I have to painstakingly fix all the nits that eslint throws at me. So all I really want is something that will fix the eslint nits automatically - and it seems that I can just switch to using eslint as a formatter, and get essentially the behavior I'm looking for (not quite as good as prettier - it won't auto fix all the issues that it complains about, but seems to deal with most of them). So at this point, I'm mostly happy. Would a PR for some VSCode settings be acceptable? It would add a .vscode directory with a couple of files in it at the top level. |
I have that too. But compared with being able to just ignore them, hit save, and have them auto-fixed its painful. But as I said, configuring eslint as the formatter seems to solve that issue (in VSCode at least). |
I would accept a patch that adds |
I guess I see why you wouldn't want the But what about this: there could be a checked in Also I think it would still be useful to add a |
That sounds like a workable plan. note to self: adding |
Note that extensions.json just provides a list of recommended extensions; it doesn't force you to install or enable them (but it does give you a one click way to do so). |
Fixed in #432. |
Prettier makes it easier to maintain consistency in the codebase, especially when there's several different contributors. I'd like to enable it, but it's not as easy as it would normally be because several tests use formatting to convey intent and to make things more readable. We should either refactor those tests to convey similar intent in a way that prettier won't ruin, or we should use some prettier ignore comments.
The text was updated successfully, but these errors were encountered: