chore: enforce styling across the repo
Description of Problem
There are some different auto-formatting styles in some PRs.
Proposed Solution
Add a pre-commit hook.
Additional Information
See https://github.com/vuejs/docs/issues/233
Deploy Preview for vuejs ready!
| Name | Link |
|---|---|
| Latest commit | ab2197bfa5a0d47c2913b0c5dff04fb723182e29 |
| Latest deploy log | https://app.netlify.com/sites/vuejs/deploys/62ab164b8a4fcb00084cdcff |
| Deploy Preview | https://deploy-preview-1778--vuejs.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
We've experimented with using automatic formatting before, but it's always proven to be problematic. The examples in the docs sometimes need the flexibility to deviate from strict formatting rules to allow for more effective communication.
I just tried running Prettier over the existing files and it does find some inconsistencies that need to be fixed. But it also changes things that really shouldn't be changed. While there are some weaker styling rules that could theoretically be applied, I don't think we'd be able to achieve that using Prettier.
I'm going to leave this open for now, as we need to fix some of the actual mistakes that Prettier finds.
For the reason explained - some examples are easier to understand when hand-formatted.