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

后端 未结 7 915
囚心锁ツ
囚心锁ツ 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:52

    I know this is old but in case anyone should find this and not have success with the posted solutions, the fix for me was to add:

    "editor.codeActionsOnSave": {
       "source.fixAll": true
    }
    

    I did not need "editor.formatOnSave": true for some reason. I do not have Prettier installed - only ESLint - but this now performs any fixes automatically when I save.

提交回复
热议问题