diff --git a/.github/workflows/format_prettier.yml b/.github/workflows/format_prettier.yml deleted file mode 100644 index b861e95..0000000 --- a/.github/workflows/format_prettier.yml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/package.json b/package.json index d50fc8c..579ddd4 100644 --- a/package.json +++ b/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": {