Can't get correct autoformat on save in Visual Studio Code with ESLint and Prettier

后端 未结 7 916
囚心锁ツ
囚心锁ツ 2021-01-30 03:16

in Visual Studio Code with ESLint and Prettier when working on .vue files, it seems I can\'t get vue/max-attributes-per-line to auto-fix correctly.

For example, with vue

7条回答
  •  感动是毒
    2021-01-30 03:47

    This is the setup I ended up going with in VSC settings.json file.

    Works perfectly for locally set up eslint disabling the default vetur settings (if the plugin is installed).

      "files.autoSave": "onFocusChange",
      "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
      },
      "editor.formatOnSave": false,
      "javascript.format.enable": false,
      "eslint.alwaysShowStatus": true,
      "eslint.options": {
        "extensions": [ ".html", ".js", ".vue", ".jsx" ]
      },
      "eslint.validate": [
        "html",
        "javascript",
        "vue"
      ],
    

提交回复
热议问题