Change prettier workflow to git hook (#25)
This commit is contained in:
parent
034ad21c23
commit
b2ff3696ca
28
.github/workflows/format_prettier.yml
vendored
28
.github/workflows/format_prettier.yml
vendored
|
@ -1,28 +0,0 @@
|
|||
name: Format Prettier
|
||||
|
||||
# This action works with pull requests and pushes
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
prettier:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
# Make sure the actual branch is checked out when running on pull requests
|
||||
ref: ${{ github.head_ref }}
|
||||
|
||||
- name: Prettify code
|
||||
uses: creyD/prettier_action@v2.2
|
||||
with:
|
||||
# This part is also where you can pass other options, for example:
|
||||
prettier_options:
|
||||
--write **/*.{js,md}
|
||||
--tab-width 4
|
||||
--jsx-bracket-same-line true
|
13
package.json
13
package.json
|
@ -27,8 +27,21 @@
|
|||
"babel-eslint": "^10.1.0",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"husky": "^4.3.0",
|
||||
"lint-staged": "^10.5.1",
|
||||
"prettier": "^2.1.2",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,css,md}": [
|
||||
"prettier --tab-width 4 --jsx-bracket-same-line true --write"
|
||||
]
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"env": {
|
||||
|
|
Loading…
Reference in a new issue