Skip to content

ESLint flat config migration: diff review (old .eslintrc.cjs → new eslint.config.mts)#26554

Open
tylerbutler wants to merge 1 commit intolint/baseline-flat-config-migrationfrom
lint/review-flat-config-migration
Open

ESLint flat config migration: diff review (old .eslintrc.cjs → new eslint.config.mts)#26554
tylerbutler wants to merge 1 commit intolint/baseline-flat-config-migrationfrom
lint/review-flat-config-migration

Conversation

@tylerbutler
Copy link
Member

Summary

Dummy PR for reviewing the ESLint 8 → 9 flat config migration diff.

The base branch has each eslint.config.mts file populated with the old .eslintrc.cjs content from before the migration. The head branch has the new flat config content from preserve-eslint-comments. The diff shows the actual content delta: old CJS format → new MTS flat config format.

Related to PR #26211 (preserve-eslint-comments).

Caution

DO NOT MERGE — this PR exists only for diff review purposes.

How this works

Two synthetic branches are used:

  • Base (lint/baseline-flat-config-migration): full repo tree with old .eslintrc.cjs content written into eslint.config.mts filenames
  • Head (lint/review-flat-config-migration): same tree but with the real new eslint.config.mts content from preserve-eslint-comments

The diff between them shows exactly 189 eslint config files changing from old format to new format.

Old content comes from commit 7a050c95 (before the flat config migration). The script scripts/generate-baseline-eslint-configs.mjs automates the baseline generation.

Regeneration workflow

When preserve-eslint-comments is updated:

# Update the merge-base reference
MB=$(git merge-base main preserve-eslint-comments)

# Recreate baseline branch
git checkout -B lint/baseline-flat-config-migration "$MB"
git checkout preserve-eslint-comments -- .
node scripts/generate-baseline-eslint-configs.mjs
git add -A && git commit -m "chore: baseline with old .eslintrc.cjs content"

# Recreate review branch
git checkout -B lint/review-flat-config-migration
git checkout preserve-eslint-comments -- '*.mts'
git add -A && git commit -m "chore: new eslint flat configs from preserve-eslint-comments"

# Push both
git push --force-with-lease upstream lint/baseline-flat-config-migration lint/review-flat-config-migration

Review notes

  • Comments/feedback should be applied to the preserve-eslint-comments branch, then this PR regenerated.
  • 1 new file (examples/data-objects/text-editor/eslint.config.mts) has no old equivalent and appears unchanged.
  • This PR should not be merged — it exists only for diff review.

Replace old .eslintrc.cjs content with the new eslint.config.mts
content from the preserve-eslint-comments branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant