Why Prettier does not format code in VSCODE?

后端 未结 18 720
失恋的感觉
失恋的感觉 2020-12-07 18:39

In my Nuxt application where ESlint and Prettier are installed and enabled, I switched to Visual Studio Code editor.

When I open a .vue file and pre

18条回答
  •  一整个雨季
    2020-12-07 18:43

    File Path:

    C:\Users\pgmre\AppData\Roaming\Code\User\settings.json
    

    Change From:

    "[javascript]": {
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    

    To:

    "[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    

    Note:

    • If the above is not present, add it instead of changing.
    • You should already have installed the "Prettier - code formatter" to see the effect of the above change.

提交回复
热议问题