-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Code Formatter | ||
Check warning on line 1 in docs/manual/98_contributing/05_source/60_codeFormatting.md GitHub Actions / runner / vale
|
||
|
||
We use prettier to format our code. | ||
Check warning on line 3 in docs/manual/98_contributing/05_source/60_codeFormatting.md GitHub Actions / runner / vale
Check warning on line 3 in docs/manual/98_contributing/05_source/60_codeFormatting.md GitHub Actions / runner / vale
|
||
|
||
## Format on Save | ||
Check warning on line 5 in docs/manual/98_contributing/05_source/60_codeFormatting.md GitHub Actions / runner / vale
|
||
|
||
### Setting Up Prettier in VS Code | ||
Check warning on line 7 in docs/manual/98_contributing/05_source/60_codeFormatting.md GitHub Actions / runner / vale
Check warning on line 7 in docs/manual/98_contributing/05_source/60_codeFormatting.md GitHub Actions / runner / vale
|
||
|
||
1. **Install Prettier Extension (if not already installed):** | ||
- 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. | ||
|
||
2. **Open Settings:** | ||
- Press `Ctrl` + `,` together to open the VS Code settings. | ||
|
||
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 both User and Remote tabs. **Do not check the box under the Workspace tab.** | ||
Check failure on line 20 in docs/manual/98_contributing/05_source/60_codeFormatting.md GitHub Actions / runner / vale
|
||
|
||
4. **Set Prettier as 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 | ||
Check warning on line 31 in docs/manual/98_contributing/05_source/60_codeFormatting.md GitHub Actions / runner / vale
|
||
|
||
1. **Test Format on Save:** | ||
- Open a file with some unformatted code. | ||
- Make a small edit and save the file (`Ctrl` + `S`). | ||
- Verify that 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. | ||
Check warning on line 38 in docs/manual/98_contributing/05_source/60_codeFormatting.md GitHub Actions / runner / vale
Check warning on line 38 in docs/manual/98_contributing/05_source/60_codeFormatting.md GitHub Actions / runner / vale
|