CleverCloud / clever-components

Collection of Web Components by Clever Cloud
https://www.clever-cloud.com/doc/clever-components/
Apache License 2.0
215 stars 19 forks source link

feat: add prettier as formatter #1030

Open Galimede opened 2 months ago

Galimede commented 2 months ago

What does this PR do?

How to review

TODO

florian-sanders-cc commented 3 weeks ago

:wave: Hey there thanks for testing & setting up all of this @Galimede

My only question is: could we open a new issue about sorting imports with prettier? What do you think about trivago/prettier-plugin-sort-imports?

Reading through Hubert's feedback, I have one question:

Who runs the format:ci?

Should we add this in a GitHub action?
Maybe it should be in prepack?
Maybe in a precommit hook?

I'm not sure but I wonder if CI should format. Formatting means files would be modified and these modifications would need to be commited no? While it is possible to commit & push stuff from an action, I would rather use prettier --check ... to let the CI fail if formatting is missing so people can format and push formatting as part of their commits (not a commit dedicated to formatting I mean) before a PR is merged :thinking:

TLDR; no format:ci & a format:check-ci instead?