Skip to main content

Troubleshooting ESLint

Quick solutions to common ESLint problems, errors, and configuration issues.
Use Ctrl+F (or Cmd+F) to search for your specific error message on this page.

Installation Issues

Cause: ESLint is not installed or not in your PATH.Solution:
Always install ESLint as a dev dependency in your project, not globally. This ensures version consistency across your team.
Cause: A plugin requires a different ESLint version than you have installed.Solution:
For pnpm users:
Cause: The @eslint/js package is not installed.Solution:
In your config:

Configuration Issues

Cause: ESLint v10 cannot find eslint.config.js.Solutions:1. Create config file:
2. Ensure correct filename:
  • eslint.config.js
  • eslint.config.mjs
  • eslint.config.cjs
  • .eslintrc (no longer supported in v10)
  • .eslintrc.json (no longer supported in v10)
3. Verify file location:
4. Specify config explicitly:
Cause: You’re using /* eslint-env */ comments, which are not supported in ESLint v10.Solution:Before (ESLint v8):
After (ESLint v10):
In eslint.config.js:
Cause: Your eslint.config.js has a syntax or structure error.Common mistakes:1. Not exporting an array:
2. Mixing old and new config formats:
Debug your config:
Cause: File patterns don’t match or files are ignored.Solutions:1. Check file patterns:
2. Check ignored files:
3. Debug config for a specific file:
4. Verify file is being linted:
Cause: Custom parser (like @typescript-eslint/parser) is not installed or configured incorrectly.Solution:1. Install parser:
2. Configure correctly:

Runtime Errors

Cause: Using deprecated context methods removed in ESLint v10.Solution:Before:
After:
Full migration table:
Cause: Your config file uses ESM syntax but Node.js is treating it as CommonJS.Solutions:1. Rename to .mjs:
2. Add “type”: “module” to package.json:
3. Or use CommonJS:
Cause: Parser cannot understand your code syntax.Solutions:For TypeScript:
For JSX:
For modern JavaScript:
Cause: Plugin not installed or imported incorrectly.Solution:1. Install plugin:
2. Import correctly:

Performance Issues

Causes & Solutions:1. Enable caching:
2. Limit file scope:
3. Disable expensive rules:
4. Use faster glob patterns:
5. Parallelize in CI:
Cause: Large codebase or complex rules exceeding Node.js memory limit.Solutions:1. Increase Node.js memory:
2. Lint in batches:
3. Reduce file scope:
Cause: Infinite loop in a rule or extremely complex file.Solutions:1. Identify problematic file:
2. Skip specific file:
3. Update plugins:

Editor Integration Issues

Solutions:1. Install ESLint extension:
  • Install “ESLint” by Microsoft from VS Code marketplace
2. Check output panel:
  • View → Output → Select “ESLint” from dropdown
  • Look for error messages
3. Restart ESLint server:
  • Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)
  • Type “ESLint: Restart ESLint Server”
4. Configure settings.json:
5. Check workspace settings:
Solutions:1. Enable ESLint:
  • Settings → Languages & Frameworks → JavaScript → Code Quality Tools → ESLint
  • Check “Automatic ESLint configuration”
2. Verify Node.js interpreter:
  • Settings → Languages & Frameworks → Node.js
  • Ensure correct Node.js version (20.19+)
3. Specify config file:
  • ESLint settings → Configuration file
  • Point to eslint.config.js
4. Clear caches:
  • File → Invalidate Caches / Restart
Cause: Both tools trying to format code differently.Solution:1. Use Prettier for formatting, ESLint for logic:
2. Disable ESLint formatting rules:
3. Run separately:

CI/CD Issues

Causes & Solutions:1. Different Node.js versions:
2. Missing dependencies:
3. Cached node_modules:
4. Platform-specific line endings:
Cause: Errors are configured as warnings.Solutions:1. Use —max-warnings 0:
2. Change warnings to errors:

Migration Issues

See the complete Migration Guide for step-by-step instructions.Quick checklist:
  • ✅ Node.js v20.19.0+
  • ✅ Remove v10_config_lookup_from_file flag
  • ✅ Remove .eslintrc files
  • ✅ Remove /* eslint-env */ comments
  • ✅ Update context methods in custom rules
  • ✅ Update SourceCode methods
Old format (.eslintrc.json):
New format (eslint.config.js):
Use migration tool:

Debugging Commands


Getting Help

GitHub Discussions

Ask questions and get help from the community

Discord Server

Real-time chat with ESLint users and maintainers

Stack Overflow

Search existing questions or ask new ones

Report a Bug

File an issue on GitHub

Common Error Messages Reference

Quick reference for frequently encountered errors:
Still stuck? Include these details when asking for help:
  • ESLint version (npx eslint --version)
  • Node.js version (node --version)
  • Package manager (npm/pnpm/yarn)
  • Full error message
  • Relevant config file
  • Example code that triggers the issue