Lesson 19 / 25

Migrating Between ESLint Versions

Update ESLint safely while maintaining code quality.

Migration strategy

Upgrading ESLint can introduce new rules. Test locally first, review changes, then roll out gradually. Use --max-warnings to enforce a transition period.

Safe upgrade process

Steps for upgrading ESLint without breaking the team.

# 1. Update package.json
npm update eslint

# 2. Test locally
npm run lint

# 3. Fix what you can
eslint . --fix

# 4. Use max-warnings during transition
eslint . --max-warnings 50  # Gradually reduce this number

# 5. Commit and create PR
git add .
git commit -m "chore: upgrade ESLint to v9"

Output:

ESLint upgraded safely

Read release notes

ESLint releases often include breaking changes and new rules. Read the release notes to understand what changed and plan your migration.

Quick check

Quick check: How should you upgrade ESLint in a team?

  • Test locally, fix issues gradually, use --max-warnings during transition.
  • Upgrade immediately on all machines.
  • Never upgrade, stay on old versions.
Answer

Test locally, fix issues gradually, use --max-warnings during transition. — Gradual migration prevents disruption and gives the team time to adapt to new rules.