# Troubleshooting और Common Gotchas — ESLint और Prettier: Code Quality और Formatting

Source: https://www.skillbyai.com/hi/eslint-prettier/eslint-prettier-24

> आम ESLint और Prettier समस्याएँ सुलझाएँ: config न लोड होना, rule conflicts, parser errors और plugins।

## Known issues और solutions

Config लोड नहीं हो रहा? Parser errors? Rules लागू नहीं हो रहे? ये ठीक हो सकते हैं। अधिकांश समस्याएँ config syntax, plugin conflicts या flat config array में entries के क्रम से आती हैं।

## Troubleshooting checklist

सामान्य issues के लिए step-by-step debugging।

```bash
# Issue 1: Config not found
npx eslint --print-config src/app.js | head -20

# Issue 2: Prettier conflicts with ESLint
# Verify eslint-config-prettier is the LAST entry in eslint.config.js

# Issue 3: Rule not applying
npx eslint src/app.js --debug

# Issue 4: Parser error
# Check languageOptions.ecmaVersion / parser matches your code

# Issue 5: Plugin not loaded
npx eslint --print-config src/app.js | grep -A3 plugins
```

Output:

```
Use these commands to debug any ESLint issue
```

## Minimal से शुरू करें, gradually जोड़ें

यदि समस्याएँ बनी रहें तो केवल `js.configs.recommended` से शुरू करें, फिर plugins एक-एक करके जोड़ें। इससे समस्या अलग पहचानी जाती है।

त्वरित जाँच

**Quiz:** यदि कोई rule लागू नहीं हो रहा तो पहले क्या जाँचें?

- [ ] केवल editor restart करें
- [ ] config हटाकर फिर शुरू करें
- [x] फ़ाइल पर npx eslint --print-config उपयोग करें
- [ ] ESLint uninstall करें

*Answer:* फ़ाइल पर npx eslint --print-config उपयोग करें. --print-config ESLint द्वारा उपयोग किए जा रहे effective configuration को show करता है, यह reveal करता है कि rule active है या disabled है।
