ESLint Migration Guides

How to migrate .eslintrc to eslint.config.cjs with FlatCompat

Convert static .eslintrc JSON or YAML into eslint.config.cjs without executing JS logic.

Start here

The safe first move

If the source config is static JSON or YAML data, the bridge file can be generated deterministically.

Stop before automation when: .eslintrc.js, .cjs, or .mjs logic. Repos that already have eslint.config.*.

Target shape

const { FlatCompat } = require("@eslint/eslintrc");
const compat = new FlatCompat();

module.exports = [
  ...compat.config({
    extends: ["eslint:recommended"],
    rules: { "no-console": "warn" },
  }),
];

Repo fit check

Want to know if your repo has this pattern?

Run the matching scanner locally first. The fit-report add-on is not listed for this proof-only product yet, so use the proof page and scanner output before treating it as a purchase candidate.

  • Local scan; no repository upload.
  • Supported findings are separated from manual-review findings.
  • Buy only when the repeated pattern is worth automating.
Run the static-config scan View example report See when to buy
Example scan summary
supported_findings: 38
manual_review_findings: 6
files_uploaded: 0
confidence: reviewable

Why this page exists

How to migrate .eslintrc to eslint.config.cjs with FlatCompat

The honest path is to bridge static config with FlatCompat and stop on JS-backed config.

Direct answer

What changes

If the source config is static JSON or YAML data, the bridge file can be generated deterministically.

Example

Before and after

Before

{
  "extends": ["eslint:recommended"],
  "rules": {"no-console": "warn"}
}

After

const { FlatCompat } = require("@eslint/eslintrc");
const compat = new FlatCompat();

module.exports = [
  ...compat.config({
    extends: ["eslint:recommended"],
    rules: { "no-console": "warn" },
  }),
];

Decision path

If this repeats across the repo, open the evaluation pages next.

This product exists for the static-config subset. It does not pretend to evaluate JS config logic.

  • Teams migrating static .eslintrc JSON or YAML configs.
  • Repos that still store eslintConfig inside package.json.
  • The fit-report add-on is not listed for this proof-only product yet; use the proof page and scanner output before treating this as purchasable.

Before checkout

Product fit, proof, and price should all be one click away.

Current listed price is not published on the pricing page yet.

Typical symptoms

  • The repo still has a static .eslintrc file.
  • The team wants a bridge, not a plugin-by-plugin rewrite party.
  • People need a clear stop signal on JS configs.

What the product covers

  • Static JSON and YAML config discovery.
  • FlatCompat bridge generation in the supported subset.
  • Manual-review findings for JS configs and existing flat config files.

Manual-review boundary

  • .eslintrc.js, .cjs, or .mjs logic.
  • Repos that already have eslint.config.*.
  • Ambiguous ignore rules that do not map cleanly.

FAQ

Fast answers before you decide

What is the safest fix for eslintrc to flat config?

If the source config is static JSON or YAML data, the bridge file can be generated deterministically.

Can eslintrc to flat config be automated?

Automate only the supported subset: Static JSON and YAML config discovery. FlatCompat bridge generation in the supported subset. Manual-review findings for JS configs and existing flat config files. Keep these cases in manual review: .eslintrc.js, .cjs, or .mjs logic. Repos that already have eslint.config.*. Ambiguous ignore rules that do not map cleanly.

When should I buy ESLint Flat Config Migration Cleanup Pack?

Use ESLint Flat Config Migration Cleanup Pack only when this pattern repeats across enough files that manual cleanup is still costly. Run the public scan or read the proof first. The fit-report add-on is not listed for this proof-only product yet; if unsupported findings dominate, keep the work manual.