Technical manual
...
Source code
Code formatting
5 min
prettier helps us maintain consistent code formatting across our projects setting up prettier in vs code step 1 install the prettier extension press ctrl + p to open the command palette type ext install esbenp prettier vscode and press enter follow the prompts to install the prettier extension step 2 open vs code settings press ctrl + , together to open the vs code settings step 3 enable format on save in the search bar at the top, type format on save you will see three tabs user , remote , and workspace check the box next to editor format on save under the user and remote tabs do not check the box under the workspace tab step 4 set prettier as the default formatter open any file in your workspace right click within the file editor select format document with choose configure default formatter select prettier code formatter from the list verifying your setup to ensure code is automatically formatted upon saving open a file with some unformatted code make a small edit and save the file ( ctrl + s ) check if the code is automatically formatted upon saving by following these steps, you ensure that prettier is set up as the default code formatter and that formatting occurs automatically on save, reducing formatting issues across the team