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
Use Prettier to format YAML #9281
Conversation
224a087
to
be28596
Compare
@Fydon can you also include yaml files to format for example Helm files available in Kubernetes folder? Thanks Edit: forget, yaml files were already updated to yml. |
Changes in packages.json.ejs is fine. But the change of formatting in templates is not required. It's way better to let Prettier fix our templates on the fly than to maintain prettified templates ;) |
@DanielFran my current pull request focuses on the current definition of applying Prettier to the src folder. In my project I've extented formatting to the entire project, but with the Prettier ignore file slightly tweaked. @murdos Some of the formatting is for consistency, so technically unnecessary, but other formatting is due to Prettier formatting comments in such a way that puts them at the wrong indentation so that the YAML is now incorrect, potentially leaving a new user lost when their project is broken when they uncomment. Therefore I felt it worth testing the output and tweaking the comments to be positioned where we would expect them to be, rather then where Prettier has put them. This is why leaving Prettier as a post process could cause problems. Also converting files from 2 space indentation to 4 to match the Prettier configuration, might help having future comments indent to the correct level. |
f061aa7
to
64f2e25
Compare
Is the generator using the Prettier from the package.json at the root? The React and Angular package.json files are now using the latest versions, so I don't know why the builds started failing with the error |
Yes. So I guess we should update to the latest version here too. |
Yes I'll update that. Should I update As a result of updating Prettier for React, I also updated |
Yeah, please update them too. |
64f2e25
to
09a4cdd
Compare
Sure. Updated them. I've looked through the change logs, but didn't see any problems: eslint, eslint-config-prettier, eslint-plugin-import and eslint-plugin-prettier. |
09a4cdd
to
388e070
Compare
What is the reason for setting eslint-plugin-prettier to error on files not conforming to the Prettier formatting? I thought the Prettier formatting would be applied as a post process to "fix" any files. I assume that this is resulting in this test failing. |
388e070
to
6b0a751
Compare
I've now run |
We don't do that for other files, so no.
I'm not sure.
Great! Could you also resolve the conflicts? Then we should be able to merge. |
I'm ok for formatting the Travis and Azure file, used for our Continuous Integration, if it doesn't break anything :-) |
6b0a751
to
34c56fe
Compare
I've now also applied the formatting to the Travis and Azure files. @murdos I only suggested I've resolved the conflicts, which included |
Added formatting of YAML files to Prettier, formatted comments in YAML files so that they end up in the correct indentation and changed YAML files that are formatted with an indent of 2 space to 4. Updated Prettier, eslint and related dependencies. Fix jhipster#8805
c3f7525
to
634f511
Compare
I've rebased my changes to the latest master even though all the tests passed, as it probably results in a better |
Thanks Fydon ! 👍 |
Added formatting of YAML files to Prettier, formatted comments in YAML files so that they end up in the correct indentation and changed YAML files that are formatted with an indent of 2 space to 4
Fix #8805
Please make sure the below checklist is followed for Pull Requests.
Travis tests are green
Tests are added where necessary
Documentation is added/updated where necessary
Coding Rules & Commit Guidelines as per our CONTRIBUTING.md document are followed