Skip to content

Commit a9073cb

Browse files
authored
chore: improve prettier config (#4154)
1 parent a552f0a commit a9073cb

File tree

9 files changed

+42
-25
lines changed

9 files changed

+42
-25
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ body:
4646
id: logs
4747
attributes:
4848
label: Logs
49-
description: "Optional if provided reproduction. Please try not to insert an image but copy paste the log text.
49+
description: |
50+
Optional if provided reproduction. Please try not to insert an image but copy paste the log text.
5051
51-
1. Run `vite` or `vite build` with the `--debug` flag.
52-
2. Provide the error log here."
52+
1. Run `vite` or `vite build` with the `--debug` flag.
53+
2. Provide the error log here.
5354
render: shell
5455
- type: checkboxes
5556
id: checkboxes

.github/renovate.json5

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
2-
"extends": [
3-
"config:base",
4-
"schedule:weekly",
5-
"group:allNonMajor"
6-
],
2+
"extends": ["config:base", "schedule:weekly", "group:allNonMajor"],
73
"labels": ["dependencies"],
84
"ignorePaths": [
95
"packages/playground/**",

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
node_version: 14
2626
fail-fast: false
2727

28-
name: 'Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
28+
name: "Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}"
2929
steps:
3030
- name: Checkout
3131
uses: actions/checkout@v2
@@ -68,7 +68,7 @@ jobs:
6868

6969
lint:
7070
runs-on: ubuntu-latest
71-
name: 'Lint: node-14, ubuntu-latest'
71+
name: "Lint: node-14, ubuntu-latest"
7272
steps:
7373
- uses: actions/checkout@v2
7474
with:

.github/workflows/issue-close-require.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Issue Close Require
22

33
on:
44
schedule:
5-
- cron: '0 0 * * *'
5+
- cron: "0 0 * * *"
66

77
jobs:
88
close-issues:
@@ -11,7 +11,7 @@ jobs:
1111
- name: need reproduction
1212
uses: actions-cool/issues-helper@v2.2.1
1313
with:
14-
actions: 'close-issues'
14+
actions: "close-issues"
1515
token: ${{ secrets.GITHUB_TOKEN }}
16-
labels: 'need reproduction'
16+
labels: "need reproduction"
1717
inactive-day: 3

.github/workflows/issue-labeled.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,29 @@ jobs:
1212
if: github.event.label.name == 'contribution welcome' || github.event.label.name == 'help wanted'
1313
uses: actions-cool/issues-helper@v2.2.1
1414
with:
15-
actions: 'create-comment, remove-labels'
15+
actions: "create-comment, remove-labels"
1616
token: ${{ secrets.GITHUB_TOKEN }}
1717
issue-number: ${{ github.event.issue.number }}
1818
body: |
1919
Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!
20-
labels: 'pending triage, need reproduction'
20+
labels: "pending triage, need reproduction"
2121

2222
- name: remove pending
2323
if: github.event.label.name == 'enhancement' || github.event.label.name == 'bug' || (contains(github.event.label.name, 'pending triage') == false && startsWith(github.event.label.name, 'bug:') == true)
2424
uses: actions-cool/issues-helper@v2.2.1
2525
with:
26-
actions: 'remove-labels'
26+
actions: "remove-labels"
2727
token: ${{ secrets.GITHUB_TOKEN }}
2828
issue-number: ${{ github.event.issue.number }}
29-
labels: 'pending triage'
29+
labels: "pending triage"
3030

3131
- name: need reproduction
3232
if: github.event.label.name == 'need reproduction'
3333
uses: actions-cool/issues-helper@v2.2.1
3434
with:
35-
actions: 'create-comment, remove-labels'
35+
actions: "create-comment, remove-labels"
3636
token: ${{ secrets.GITHUB_TOKEN }}
3737
issue-number: ${{ github.event.issue.number }}
3838
body: |
3939
Hello @${{ github.event.issue.user.login }}. Please provide a online reproduction by [codesandbox](https://codesandbox.io/) or a minimal GitHub repository. Issues labeled by `need reproduction` will be closed if no activities in 3 days.
40-
labels: 'pending triage'
40+
labels: "pending triage"

.prettierignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ packages/vite/dist/
33
packages/plugin-vue/dist/
44
packages/*/CHANGELOG.md
55
LICENSE.md
6-
.prettierrc
6+
.prettierignore
7+
yarn.lock

.prettierrc.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"semi": false,
3+
"tabWidth": 2,
4+
"singleQuote": true,
5+
"printWidth": 80,
6+
"trailingComma": "none",
7+
"overrides": [
8+
{
9+
"files": ["*.json5"],
10+
"options": {
11+
"singleQuote": false,
12+
"quoteProps": "preserve"
13+
}
14+
},
15+
{
16+
"files": ["*.yml"],
17+
"options": {
18+
"singleQuote": false
19+
}
20+
}
21+
]
22+
}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"node": ">=12.0.0"
1010
},
1111
"scripts": {
12+
"format": "prettier --write .",
1213
"lint": "eslint --ext .js,.ts packages/*/src/**",
1314
"test": "run-s test-serve test-build",
1415
"test-serve": "jest",

packages/plugin-vue-jsx/index.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,7 @@ function vueJsxPlugin(options = {}) {
9191
const filter = createFilter(include || /\.[jt]sx$/, exclude)
9292

9393
if (filter(id)) {
94-
const plugins = [
95-
importMeta,
96-
[jsx, babelPluginOptions],
97-
...babelPlugins
98-
]
94+
const plugins = [importMeta, [jsx, babelPluginOptions], ...babelPlugins]
9995
if (id.endsWith('.tsx')) {
10096
plugins.push([
10197
require('@babel/plugin-transform-typescript'),

0 commit comments

Comments
 (0)