Skip to content

Instantly share code, notes, and snippets.

@matthewblewitt
Created December 3, 2019 11:39
Show Gist options
  • Save matthewblewitt/7e024ac51601eeedbbf5ed2d600902c9 to your computer and use it in GitHub Desktop.
Save matthewblewitt/7e024ac51601eeedbbf5ed2d600902c9 to your computer and use it in GitHub Desktop.
Vue CLI + ESLint + Prettier + Fix on save
module.exports = {
root: true,
env: {
node: true
},
extends: [
"plugin:vue/recommended",
"eslint:recommended",
"prettier/vue",
"plugin:prettier/recommended"
],
rules: {},
parserOptions: {
parser: "babel-eslint"
}
};
{
"name": "awesome-linting",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.4.3",
"vue": "^2.6.10"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-plugin-eslint": "^4.1.0",
"@vue/cli-service": "^4.1.0",
"babel-eslint": "^10.0.3",
"eslint": "^5.16.0",
"eslint-config-prettier": "^6.7.0",
"eslint-loader": "^3.0.2",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.2.3",
"prettier": "^1.19.1",
"vue-template-compiler": "^2.6.10"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
module.exports = {
chainWebpack: config => {
config.module
.rule("eslint")
.use("eslint-loader")
.options({
fix: true
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment