Using Prettier code formatter in PHP with VSCode

Using Prettier code formatter in PHP with VSCode

What is Prettier?

https://prettier.io/

Installation

1. Prettier - Code formatter

Install through VS Code extensions. Search for Prettier - Code formatter

Visual Studio Code Market Place: Prettier - Code formatter

2. Prettier PHP Plugin

You need to install @prettier/plugin-php in folder vscode extention: cd ~/.vscode/extensions/esbenp.prettier-vscode-3.18.0

1
npm install --save-dev prettier @prettier/plugin-php