# Migrating Between ESLint Versions — ESLint + Prettier

Source: https://www.geekswithgeeks.com/en/eslint-prettier/eslint-prettier-19

> 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.

```bash
# 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

**Quiz:** How should you upgrade ESLint in a team?

- [x] 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.
