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.

Revisions

  1. azliabdullah revised this gist Mar 3, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions setup eslint-prettier in vscode
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    // 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
    `
    {
  2. azliabdullah revised this gist Mar 3, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions setup eslint-prettier in vscode
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    // from https://medium.com/@gogl.alex/how-to-properly-set-up-eslint-with-prettier-for-vue-or-nuxt-in-vscode-e42532099a9c

    in vscode settings.json
    ```
    `
    {
    "eslint.validate": [
    { "language": "html", "autoFix": true },
    @@ -13,7 +13,7 @@ in vscode settings.json
    "eslint.autoFixOnSave": true,
    "vetur.validation.template": false,
    }
    ```
    `

    in project's package.json
    ```
  3. azliabdullah created this gist Mar 3, 2019.
    50 changes: 50 additions & 0 deletions setup eslint-prettier in vscode
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,50 @@
    // from https://medium.com/@gogl.alex/how-to-properly-set-up-eslint-with-prettier-for-vue-or-nuxt-in-vscode-e42532099a9c

    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"
    }
    }
    ```