# Formatting Standards & Team Consistency — ESLint + Prettier

Source: https://www.geekswithgeeks.com/en/eslint-prettier/eslint-prettier-11

> Use Prettier to enforce uniform code style across your team.

## Why formatting matters

Inconsistent formatting wastes time in code reviews (arguing over spaces vs. tabs). Prettier removes this debate: it's opinionated and automatic.

## Run Prettier on save

Configure your editor to run Prettier on save for automatic formatting.

```bash
# In VS Code settings.json:
{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true
}
```

Output:

```
Prettier configured to format on save in VS Code
```

## Distributed consistency

Commit .prettierrc to your repo. When all developers use the same config, Prettier ensures identical formatting regardless of editor settings.

Quick check

**Quiz:** Why commit .prettierrc to git?

- [x] So all team members format code identically.
- [ ] To speed up Prettier.
- [ ] To disable Prettier for some files.

*Answer:* So all team members format code identically.. Shared .prettierrc ensures consistent formatting across the team, eliminating style arguments in code reviews.
