Skip to content

style: unify code style #1009

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

Closed
wants to merge 0 commits into from
Closed

style: unify code style #1009

wants to merge 0 commits into from

Conversation

wenfangdu
Copy link
Contributor

@wenfangdu wenfangdu commented Apr 23, 2021

Description of Problem

Currently, many code samples aren't following the same code style which can lead to confusion, e.g. (excerpted from here)

<template>
  <div>
    <p>{{ text }}</p>
    <button v-on:click="$emit('accepted')">OK</button>
  </div>
</template>
<script>
👇 indent
  export default {
    props: ['text'],
    emits: ['accepted']
  }
</script>
<template>
  <button v-on:click="$emit('click', $event)">OK</button>
</template>
<script>
👇 no indent
export default {
  emits: [] // without declared event
}
</script>

Proposed Solution

  1. Prettier codebase.
  2. Add pre-commit hook for prettier.

Additional Information

This PR has no other changes except the above actions.

@skirtles-code
Copy link
Contributor

Thanks for the PR.

There are problems with the formatting changes in some of the files. In some cases the formatting mattered and information has been lost or corrupted as a result of the changes. I'm not going to attempt to list them all here as reviewing over 100 files isn't really practical.

Instead I'm going to create some smaller PRs that make some of these changes by hand. Once those are merged we can try running Prettier again to see what's left and then make some decisions accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants