The Power of Pretty
Prettier formats code. Period. It enforces consistency and kills style debates. VS Code integration makes it essential.
Skip manual formatting. Let Prettier be your code janitor.
1. Install Prettier
Get Prettier running in VS Code. Five steps:
- Open VS Code.
- Hit Extensions view. Square icon or ‘Ctrl+Shift+X’.
- Search “Prettier – Code Formatter”. Hit Enter.
- Click “Install”.
- Move to config.
2. Configure Prettier
Prettier works out of the box. Tweak it for your needs:
- Open settings. ‘Ctrl+,’ or File > Preferences > Settings.
- Search “Prettier”.
- Set tab width, semicolons, quote style.
- Save.
Prettier now formats your code. But there’s more.
3. Using Prettier in your Workflow
Prettier transforms dev workflow. Key wins:
- Consistent formatting across codebases. No style wars.
- Automates formatting. Saves time for real problems.
- Eliminates human formatting errors. No syntax mistakes from bad indentation.
- Teams align faster. Same format, fewer merge conflicts.