Lesson 24 / 25
Troubleshooting & Common Gotchas
Solve common problems developers encounter.
Known issues and solutions
Config not loading? Parser errors? Rules don't apply? These are fixable. Most issues stem from config syntax, plugin conflicts, or order-dependent extends.
Troubleshooting checklist
Step-by-step debugging for common issues.
# Issue 1: Config not found
eslint --print-config src/app.js | head -20
# Issue 2: Prettier conflicts ESLint
# Verify prettier is in extends array LAST
grep -A2 'extends' .eslintrc.json
# Issue 3: Rule not applying
DEBUG=eslint* eslint src/app.js
# Issue 4: Parser error
# Check parserOptions.ecmaVersion matches your code
# Issue 5: Plugin not loaded
eslint --print-config src/app.js | grep -A3 plugins
Output:
Use these commands to debug any ESLint issue
Start minimal, add gradually
If issues persist: start with eslint:recommended only, then add plugins one at a time. This isolates the problem.
Quick check
Quick check: If a rule isn't applying, what should you check first?
- Use eslint --print-config to see if the rule is active.
- Restart the editor.
- Delete .eslintrc.json and recreate it.
Answer
Use eslint --print-config to see if the rule is active. — --print-config shows the effective configuration ESLint is using, revealing if a rule is active or disabled.