diff --git a/client/babel.config.js b/client/babel.config.js index e955840..397abca 100644 --- a/client/babel.config.js +++ b/client/babel.config.js @@ -1,5 +1,3 @@ module.exports = { - presets: [ - '@vue/cli-plugin-babel/preset' - ] -} + presets: ["@vue/cli-plugin-babel/preset"] +}; diff --git a/client/package.json b/client/package.json index ff44db1..64d0815 100644 --- a/client/package.json +++ b/client/package.json @@ -15,9 +15,13 @@ "@vue/cli-plugin-babel": "~4.3.0", "@vue/cli-plugin-eslint": "~4.3.0", "@vue/cli-service": "~4.3.0", + "@vue/eslint-config-prettier": "^6.0.0", "babel-eslint": "^10.1.0", "eslint": "^6.7.2", + "eslint-plugin-prettier": "^3.1.1", "eslint-plugin-vue": "^6.2.2", + "lint-staged": "^9.5.0", + "prettier": "^1.19.1", "vue-template-compiler": "^2.6.11" }, "eslintConfig": { @@ -27,7 +31,8 @@ }, "extends": [ "plugin:vue/essential", - "eslint:recommended" + "eslint:recommended", + "@vue/prettier" ], "parserOptions": { "parser": "babel-eslint" @@ -38,5 +43,14 @@ "> 1%", "last 2 versions", "not dead" - ] + ], + "gitHooks": { + "pre-commit": "lint-staged" + }, + "lint-staged": { + "*.{js,jsx,vue}": [ + "vue-cli-service lint", + "git add" + ] + } } diff --git a/client/src/App.vue b/client/src/App.vue index 55df315..fb03c6e 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -1,19 +1,19 @@