# Reporting और Performance — ESLint + Prettier

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

> ESLint performance को optimize करें और useful reports generate करें।

## Performance tuning

ESLint बड़े codebases पर slow हो सकता है। Unchanged files को skip करने के लिए --cache का उपयोग करें, और जब thresholds exceed हों तो warnings को errors के रूप में treat करने के लिए --max-warnings का उपयोग करें।

## Performance optimization

Linting results को cache करें और visibility के लिए reports generate करें।

```bash
# Use cache for faster linting
eslint . --cache

# Generate JSON report
eslint . --format json > lint-report.json

# Package.json scripts
"scripts": {
  "lint": "eslint . --cache",
  "lint:report": "eslint . --format json > lint-report.json",
  "lint:html": "eslint . --format html > lint-report.html"
}
```

Output:

```
Cache and reporting configured
```

## नियमित रूप से cache को clear करें

ESLint cache stale हो सकता है। Major updates से पहले `rm .eslintcache` या `eslint . --cache --cache-location ./node_modules/.cache/eslint` के साथ इसे clear करें।

त्वरित जाँच

**Quiz:** --cache flag क्या करता है?

- [x] Linting results को cache करता है ताकि अगले run पर unchanged files को skip किया जाए।
- [ ] Config को memory में store करता है।
- [ ] Memory usage को बढ़ाता है।

*Answer:* Linting results को cache करता है ताकि अगले run पर unchanged files को skip किया जाए।. --cache last lint run के बाद changed नहीं किए गए files को skip करके linting को significantly speed up करता है।
