Last active
March 3, 2019 05:20
-
-
Save azliabdullah/c6619960fa53a6175e1b62a571402c63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://medium.com/@gogl.alex/how-to-properly-set-up-eslint-with-prettier-for-vue-or-nuxt-in-vscode-e42532099a9c | |
npm install eslint babel-eslint eslint-config-prettier eslint-plugin-prettier eslint-plugin-vue prettier -D | |
in vscode settings.json | |
` | |
{ | |
"eslint.validate": [ | |
{ "language": "html", "autoFix": true }, | |
{ "language": "vue", "autoFix": true }, | |
{ "language": "javascript", "autoFix": true }, | |
{ "language": "javascriptreact", "autoFix": true } | |
], | |
"editor.formatOnSave": false, | |
"eslint.autoFixOnSave": true, | |
"vetur.validation.template": false, | |
} | |
` | |
in project's package.json | |
``` | |
"eslintConfig": { | |
"root": true, | |
"env": { | |
"node": true | |
}, | |
"extends": [ | |
"plugin:vue/recommended", | |
"eslint:recommended", | |
"plugin:prettier/recommended", | |
"prettier/vue" | |
], | |
"rules": { | |
"no-console": [ | |
"error", | |
{ | |
"allow": [ | |
"log", | |
"error", | |
"warn" | |
] | |
} | |
] | |
}, | |
"globals": { | |
"$nuxt": true | |
}, | |
"parserOptions": { | |
"parser": "babel-eslint" | |
} | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment