Core Concepts · Quick recall Q&A

1 min read
Mid-level2 min read
Rapid overview

Quick recall Q&A

1. What's the difference between ESLint and Prettier?

ESLint: Catches code quality issues, potential bugs, enforces best practices Prettier: Focuses purely on code formatting (whitespace, line breaks, quotes)

Use both together: ESLint for quality, Prettier for formatting, with eslint-config-prettier to avoid conflicts.

2. How do you handle legacy code that violates rules?

  1. Use / eslint-disable rule-name / for specific files
  2. Add to .eslintignore temporarily
  3. Use --max-warnings to allow gradual fixes
  4. Set rules to warn initially, then error after cleanup

3. What's the flat config and why was it introduced?

Flat config (ESLint 9+) replaces .eslintrc:

  • Simpler, JavaScript-based configuration
  • Better IDE support with explicit imports
  • Clearer config merging and precedence
  • No more cascading config confusion

4. How do you enforce ESLint in CI/CD?

# GitHub Actions
- name: Lint
  run: npm run lint -- --max-warnings 0

Use --max-warnings 0 to fail on any warnings, preventing gradual degradation.

See also