- A linter that enforces coding standards and best practices.
- Finds potential errors (e.g., undefined variables, unused imports).
- Can auto-fix some issues but primarily focuses on code quality.
- A code formatter that ensures consistent styling.
- Handles whitespace, indentation, semicolons, quotes, etc.
- Does not enforce coding standards like ESLint—only formatting.
👉 We use both! ESLint ensures best practices, while Prettier keeps our code neatly formatted.
For the best experience, configure your IDE to run Prettier on save:
🔗 Official Prettier IDE Setup Guide
- Install the Prettier - Code formatter extension.
- Open Settings (
Ctrl + ,orCmd + ,on Mac). - Search for
"formatOnSave"and enable:"editor.formatOnSave": true
- Set Prettier as the default formatter:
"[typescriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }
- Go to Preferences > Languages & Frameworks > JavaScript > Prettier.
- Set the Prettier package to your project’s
node_modules/prettier. - Enable "Run Prettier on Save".
Refer to the Prettier Docs for setup instructions.
If you need to format all files manually, at our project's root run:
pnpm formatThis will apply Prettier formatting across the entire project. This ensures our codebase stays clean and readable without manual effort. Make sure to run this before committing your changes!