Skip to content

Commit

Permalink
chore: improve prettier config (#4154)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 authored Jul 6, 2021
1 parent a552f0a commit a9073cb
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 25 deletions.
7 changes: 4 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ body:
id: logs
attributes:
label: Logs
description: "Optional if provided reproduction. Please try not to insert an image but copy paste the log text.
description: |
Optional if provided reproduction. Please try not to insert an image but copy paste the log text.
1. Run `vite` or `vite build` with the `--debug` flag.
2. Provide the error log here."
1. Run `vite` or `vite build` with the `--debug` flag.
2. Provide the error log here.
render: shell
- type: checkboxes
id: checkboxes
Expand Down
6 changes: 1 addition & 5 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"extends": [
"config:base",
"schedule:weekly",
"group:allNonMajor"
],
"extends": ["config:base", "schedule:weekly", "group:allNonMajor"],
"labels": ["dependencies"],
"ignorePaths": [
"packages/playground/**",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
node_version: 14
fail-fast: false

name: 'Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
name: "Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}"
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:

lint:
runs-on: ubuntu-latest
name: 'Lint: node-14, ubuntu-latest'
name: "Lint: node-14, ubuntu-latest"
steps:
- uses: actions/checkout@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/issue-close-require.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Issue Close Require

on:
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"

jobs:
close-issues:
Expand All @@ -11,7 +11,7 @@ jobs:
- name: need reproduction
uses: actions-cool/issues-helper@v2.2.1
with:
actions: 'close-issues'
actions: "close-issues"
token: ${{ secrets.GITHUB_TOKEN }}
labels: 'need reproduction'
labels: "need reproduction"
inactive-day: 3
12 changes: 6 additions & 6 deletions .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ jobs:
if: github.event.label.name == 'contribution welcome' || github.event.label.name == 'help wanted'
uses: actions-cool/issues-helper@v2.2.1
with:
actions: 'create-comment, remove-labels'
actions: "create-comment, remove-labels"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
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!
labels: 'pending triage, need reproduction'
labels: "pending triage, need reproduction"

- name: remove pending
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)
uses: actions-cool/issues-helper@v2.2.1
with:
actions: 'remove-labels'
actions: "remove-labels"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: 'pending triage'
labels: "pending triage"

- name: need reproduction
if: github.event.label.name == 'need reproduction'
uses: actions-cool/issues-helper@v2.2.1
with:
actions: 'create-comment, remove-labels'
actions: "create-comment, remove-labels"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
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.
labels: 'pending triage'
labels: "pending triage"
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ packages/vite/dist/
packages/plugin-vue/dist/
packages/*/CHANGELOG.md
LICENSE.md
.prettierrc
.prettierignore
yarn.lock
22 changes: 22 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 80,
"trailingComma": "none",
"overrides": [
{
"files": ["*.json5"],
"options": {
"singleQuote": false,
"quoteProps": "preserve"
}
},
{
"files": ["*.yml"],
"options": {
"singleQuote": false
}
}
]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"node": ">=12.0.0"
},
"scripts": {
"format": "prettier --write .",
"lint": "eslint --ext .js,.ts packages/*/src/**",
"test": "run-s test-serve test-build",
"test-serve": "jest",
Expand Down
6 changes: 1 addition & 5 deletions packages/plugin-vue-jsx/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@ function vueJsxPlugin(options = {}) {
const filter = createFilter(include || /\.[jt]sx$/, exclude)

if (filter(id)) {
const plugins = [
importMeta,
[jsx, babelPluginOptions],
...babelPlugins
]
const plugins = [importMeta, [jsx, babelPluginOptions], ...babelPlugins]
if (id.endsWith('.tsx')) {
plugins.push([
require('@babel/plugin-transform-typescript'),
Expand Down

0 comments on commit a9073cb

Please sign in to comment.