# Formatting Standards & Team Consistency — ESLint and Prettier: Code Quality and Formatting

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

> Use Prettier to end formatting debates, format on save and keep style identical across a 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.
- [ ] To hide the config from CI

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