docs icon indicating copy to clipboard operation
docs copied to clipboard

chore: enforce styling across the repo

Open xfq opened this issue 3 years ago • 2 comments

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

xfq avatar Jun 16 '22 11:06 xfq

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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Jun 16 '22 11:06 netlify[bot]

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.

skirtles-code avatar Jun 25 '22 15:06 skirtles-code

For the reason explained - some examples are easier to understand when hand-formatted.

yyx990803 avatar Jun 12 '23 03:06 yyx990803