6

I have prettier installed on VS code but it does not seem to have any functionality. I installed Prettier - Code formatter (6.4.0) through VS code extensions, I am using the latest version of VScode and there are no updates available.

Both the format on save and cmd-shift-p no nothing for .php files but works perfectly for .js files.

My VS code settings.json file look like this:

{
"editor.codeActionsOnSave": null,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}

This is the only VS code extension I have installed, so it is not a compatibility issue with another VS code extension, however I did also install the plugin-php formatter globally using:

npm install --global prettier @prettier/plugin-php
David Linder
  • 83
  • 1
  • 6

1 Answers1

0

Try installing the PHP formatter locally, like this:

npm install --save-dev prettier @prettier/plugin-php
Spyryto
  • 1,107
  • 12
  • 17