Skip to content

Commit

Permalink
feat!: align the default prettier style with create-vue instead of …
Browse files Browse the repository at this point in the history
…vue core

After all, `vuejs/core` is more of a TypeScript project than a Vue project.
I feel that we really need `printWidth: 100` for templates.

And `arrowParens` isn't that important. Let's use the default value.
Moreover, as stated in [prettier's documentation](https://prettier.io/docs/en/options#arrow-function-parentheses),
`arrowParens: "always"` is better for adding type annotations, extra
arguments or default values as well as making other changes.
I believe that `arrowParens: "avoid"` is set in `vuejs/core` only
because it started using prettier in its 1.x era and want to avoid
too drastic style changes. vuejs/core#3926 (comment)
  • Loading branch information
haoqunjiang committed Oct 25, 2024
1 parent d1fe363 commit 5c93155
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions templates/_prettierrc.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
}
<%_ } else { _%>
<%#
The default style follows the one used in the vuejs/core repository
<https://github.com/vuejs/core/blob/main/.prettierrc>
The default style follows the one used in the vuejs/create-vue repository
<https://github.com/vuejs/create-vue/blob/main/.prettierrc>
%>
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"singleQuote": true,
"arrowParens": "avoid"
"printWidth": 100
}
<%_ } _%>

0 comments on commit 5c93155

Please sign in to comment.