# Prettier Configuration — ESLint + Prettier

Source: https://www.geekswithgeeks.com/hi/eslint-prettier/eslint-prettier-04

> Prettier formatting विकल्पों को सेट अप करें।

## Prettier की बुनियादी बातें

Prettier opinionated है—यह एक consistent style को लागू करता है। इसे .prettierrc के साथ configure करें line width, quotes, semicolons, और tabs सेट करने के लिए।

## Sample .prettierrc

यह configuration 2-space indentation और trailing commas को लागू करता है।

```json
{
  "printWidth": 80,
  "tabWidth": 2,
  "useTabs": false,
  "semi": true,
  "singleQuote": true,
  "trailingComma": "es5"
}
```

Output:

```
Prettier config ready: 2-space indent, 80-char lines, single quotes
```

## Config drift से बचें

.prettierrc को version control में commit करें ताकि सभी टीम सदस्य identical formatting rules का उपयोग करें।

त्वरित जाँच

**Quiz:** Prettier में 'printWidth' क्या control करता है?

- [x] Wrapping से पहले अधिकतम line length।
- [ ] प्रति indent में spaces की संख्या।
- [ ] Quote style।

*Answer:* Wrapping से पहले अधिकतम line length।. 'printWidth' प्रति line character limit को सेट करता है (default 80)। लंबी lines स्वचालित रूप से wrap होती हैं।
