Dirk Hoekstra
Dirk Hoekstra

Reputation: 1061

Prettier with VsCode

I'm trying to integrate Prettier in Visual Studio Code.

I've installed the Prettier VsCode plugin.

In the instructions it says to set the following VSCode setting:

"editor.defaultFormatter": "esbenp.prettier-vscode",

However, when I do this Visual Studio gives the message: "Unknown configuration setting".

And whenever I try to format the Javascript files it does not use prettier. I've uninstalled all other extensions just to be sure that nothing was interfering with the prettier extension.

Prettier does work correctly if I execute it with the command line:

npx prettier --write .

Does anyone know how this can be resolved?

Upvotes: 1

Views: 725

Answers (1)

Dirk Hoekstra
Dirk Hoekstra

Reputation: 1061

I've found the problem.

Turns out I was using an old version of Visual Studio Code (1.22.0)

The "Check for updates" button gave the message that there were no updates available, so I figured that I was on the latest version already. But, this was not the case.

After downloading the new version everything works as expected.

Upvotes: 0

Related Questions