Change prettier workflow to git hook (#25)

This commit is contained in:
khatab Wedaa 2020-11-12 10:25:19 +02:00 committed by GitHub
parent 034ad21c23
commit b2ff3696ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 28 deletions

View file

@ -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

View file

@ -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": {