-
Notifications
You must be signed in to change notification settings - Fork 28
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 trailing comma to prettier config #2
Conversation
kdv24
commented
Apr 19, 2019
- This fixes the removal of trailing comments on save, but I haven't yet found a way to prevent vscode making multi-line arrays into single line.
- How can I prevent prettier from taking multi-line array to a single line? prettier/prettier-vscode#352
- I haven't found a way to prevent vscode making multi-line arrays into single line - prettier/prettier-vscode#352
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kdv24,
I tried this out on my VSCode and it works. Trailing commas are preserved, and if they don't exist, they are added.
EDIT: For the collapsing to one line bit, one fix that I don't think is in the PR you linked could be putting the file into .prettierignore, which I think you can wildcard, so .*
to ignore all dotfiles.
It's possible that prettier wasn't run on all these files (for instance, I don't have it set up to run on save in my editor), so we might not actually have to make prettier keep the files the way they are, if that makes sense.
On that note, my only suggestion is to check with @chris and @doug to make sure they are on board with the style updates & get their opinion on how to handle the formatting of existing project code.
As long as everyone else is on board it LGTM!
Thanks for the quick review, @thmsdnnr. I'll see what @dougmakingstuff and @bobbymart1n think. I'm not sure who else is from the Amplify Team for sure to ask. |
This works for me. I do have format on save set to true on my editor. I'm still a little new to VS Code and have been using Atom for the past year. As far as I'm aware, VS Code looks for a .prettierrc file if you have prettier installed which I do currently. Let me know if I'm mistaken about that though as I think I've run into VS Code having its own format on save functionality and overriding the .prettierrc file in the past. |
@bobbymart1n I'm fairly new to the VS Code settings as well. I have a .prettierrc file and format on save set for me as well, but as I understand it the multi-line issue with the array isn't something prettier will do... or at least I'm not having any luck with it. For example, in
to If you change yours to multiline and save it, does it revert it back to the multi-line? I'm just trying to determine if it's autoformatting for you. Thanks! |
Add react-intl and framework for cookie