visual-studio-codeprettiernpm-packageprettier-vscode

configure the Prettier extension to use the locally installed Prettier?


When I press ctrl+s, the file gets formatted by the Prettier extension in VS Code. However, it seems to be slower when compared to the locally installed Prettier using npm install -g prettier. Please correct me if I am wrong. How can I configure the Prettier extension to use the locally installed Prettier?


Solution

  • Use the prettier.prettierPath setting. Its description: "Path to the prettier module". You may need to use the ${userHome} variable or other VS Code variables in the value depending on where your Prettier is.

    I don't know if your own installed one will be faster than the Prettier one. The slowdown you're observing may just be part of the Prettier extension and not Prettier.