Skip to content

Instantly share code, notes, and snippets.

@azliabdullah
Last active March 3, 2019 05:20
Show Gist options
  • Save azliabdullah/c6619960fa53a6175e1b62a571402c63 to your computer and use it in GitHub Desktop.
Save azliabdullah/c6619960fa53a6175e1b62a571402c63 to your computer and use it in GitHub Desktop.
// 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