nextjs - ✅(Solved) Fix Broken next-lint-to-eslint-cli codemod [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#85679Fetched 2026-04-08 02:14:25
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
cross-referenced ×2labeled ×2commented ×1issue_type_added ×1

Error Message

Migrating from next lint to the ESLint CLI... Found legacy ESLint config: .eslintrc.cjs Running "npx @eslint/migrate-config /Users/xxx/Code/next-lint-to-eslint-cli-codemod-issue/.eslintrc.cjs" to convert legacy config... /Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/transforms/next-lint-to-eslint-cli.js:855 throw new Error(Failed to run "${command}" to migrate the legacy ESLint config "${eslintConfigFilename}".\n + ^

Error: Failed to run "npx @eslint/migrate-config /Users/xxx/Code/next-lint-to-eslint-cli-codemod-issue/.eslintrc.cjs" to migrate the legacy ESLint config ".eslintrc.cjs". Please try the migration to Flat config manually. Learn more: https://eslint.org/docs/latest/use/configure/migration-guide at Object.transformer [as default] (/Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/transforms/next-lint-to-eslint-cli.js:855:23) at Command.runTransform (/Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/bin/transform.js:83:48) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) { [cause]: Error: Failed to find the expected output file "/Users/xxx/Code/next-lint-to-eslint-cli-codemod-issue/eslint.config.mjs" generated by the migration tool. at Object.transformer [as default] (/Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/transforms/next-lint-to-eslint-cli.js:847:27) at Command.runTransform (/Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/bin/transform.js:83:48) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) }

Node.js v22.17.0

Fix Action

Fixed

PR fix notes

PR #144: chore: finish Next.js lint setup

Description (problem / solution / changelog)

Summary

  • Migrates app/ from deprecated next lint to the standard ESLint CLI (eslint .)
  • Adds flat config (eslint.config.mjs) with eslint-config-next@16 (core-web-vitals + typescript presets)
  • Fixes all 22 lint errors/warnings across source files (unused imports, JSX comment text, any types, React hooks)

Why

next lint is deprecated in Next.js 15 and removed in 16. Without an existing ESLint config, it launches an interactive wizard — CI can't run lint headlessly.

What changed

Package: app

ChangeDetails
eslint.config.mjsNew flat config with core-web-vitals + typescript + postcss override
package.jsonLint script → eslint ., added eslint@9 + eslint-config-next@16
Source filesRemoved unused imports, wrapped // branding in JSX expressions, replaced as any with typed assertions, deferred HeroVideo setState via rAF

Note on eslint-config-next@16

The v16 package exports proper flat config arrays (v15 only ships legacy CommonJS). It has no runtime coupling to Next.js 16 — only peer-depends on eslint >=9 and typescript >=3.3.1.

The @next/codemod@canary next-lint-to-eslint-cli codemod was skipped because it crashes when no existing .eslintrc is found.

Test plan

  • npm run lint exits cleanly with zero errors/warnings (no interactive prompts)
  • npm run build succeeds
  • Dev server renders correctly — // branding, page structure, no console errors

🤖 Generated with Claude Code

Changed files

  • app/eslint.config.mjs (added, +15/-0)
  • app/package-lock.json (modified, +6223/-1659)
  • app/package.json (modified, +3/-1)
  • app/src/app/leaderboard/page.tsx (modified, +1/-2)
  • app/src/app/page.tsx (modified, +4/-4)
  • app/src/app/syndicate/[subdomain]/proposals/page.tsx (modified, +0/-4)
  • app/src/components/DepositModal.tsx (modified, +2/-2)
  • app/src/components/HeroVideo.tsx (modified, +7/-4)
  • app/src/components/LiveFeed.tsx (modified, +1/-1)
  • app/src/components/SyndicateHeader.tsx (modified, +1/-1)
  • app/src/components/VaultOverview.tsx (modified, +1/-1)
  • app/src/components/WithdrawModal.tsx (modified, +2/-2)
  • app/src/components/proposals/ActiveProposal.tsx (modified, +0/-1)
  • app/src/lib/syndicate-data.ts (modified, +1/-3)

Code Example

Migrating from next lint to the ESLint CLI...
   Found legacy ESLint config: .eslintrc.cjs
   Running "npx @eslint/migrate-config /Users/xxx/Code/next-lint-to-eslint-cli-codemod-issue/.eslintrc.cjs" to convert legacy config...
/Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/transforms/next-lint-to-eslint-cli.js:855
                throw new Error(`Failed to run "${command}" to migrate the legacy ESLint config "${eslintConfigFilename}".\n` +
                      ^

Error: Failed to run "npx @eslint/migrate-config /Users/xxx/Code/next-lint-to-eslint-cli-codemod-issue/.eslintrc.cjs" to migrate the legacy ESLint config ".eslintrc.cjs".
Please try the migration to Flat config manually.
Learn more: https://eslint.org/docs/latest/use/configure/migration-guide
    at Object.transformer [as default] (/Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/transforms/next-lint-to-eslint-cli.js:855:23)
    at Command.runTransform (/Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/bin/transform.js:83:48)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  [cause]: Error: Failed to find the expected output file "/Users/xxx/Code/next-lint-to-eslint-cli-codemod-issue/eslint.config.mjs" generated by the migration tool.
      at Object.transformer [as default] (/Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/transforms/next-lint-to-eslint-cli.js:847:27)
      at Command.runTransform (/Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/bin/transform.js:83:48)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
}

Node.js v22.17.0

---

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 12
Binaries:
  Node: 22.17.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 9.11.0
Relevant Packages:
  next: 16.0.1 // Latest available version is detected (16.0.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

---

const {
    defineConfig,
    globalIgnores,
} = require("eslint/config");

const {
    fixupConfigRules,
    fixupPluginRules,
} = require("@eslint/compat");

const tsParser = require("@typescript-eslint/parser");
const typescriptEslint = require("@typescript-eslint/eslint-plugin");
const svgJsx = require("eslint-plugin-svg-jsx");
const js = require("@eslint/js");

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

const compat = new FlatCompat({
    baseDirectory: __dirname,
    recommendedConfig: js.configs.recommended,
    allConfig: js.configs.all
});

module.exports = defineConfig([{
    extends: fixupConfigRules(compat.extends(
        "plugin:import/recommended",
        "plugin:import/react",
        "plugin:import/typescript",
        "next/core-web-vitals",
        "plugin:@typescript-eslint/recommended",
    )),

    languageOptions: {
        parser: tsParser,
    },

    plugins: {
        "@typescript-eslint": fixupPluginRules(typescriptEslint),
        "svg-jsx": svgJsx,
    },

    "rules": {
        "svg-jsx/camel-case-dash": "error",
        "svg-jsx/camel-case-colon": "error",
        "svg-jsx/no-style-string": "error",
        "no-unused-vars": "off",
        "@typescript-eslint/no-unused-vars": ["warn"],
        "@typescript-eslint/no-explicit-any": ["warn"],
        "@typescript-eslint/ban-ts-comment": ["warn"],
        "@typescript-eslint/no-empty-object-type": ["warn"],
        "@typescript-eslint/no-require-imports": ["warn"],
        "prefer-const": ["warn"],
        "prefer-spread": ["warn"],

        "no-restricted-syntax": ["error", {
            selector: "JSXOpeningElement[name.name='feGaussianBlur']",
            message: "<feGaussianBlur> has spotty Safari support",
        }],

        "no-restricted-imports": ["error", {
            paths: [{
                name: "next-intl/server",
                importNames: ["getTranslations"],
                message: "Do not import messages API from next-intl directly, use wrapper instead",
            }, {
                name: "next-intl",
                importNames: ["useTranslations"],
                message: "Do not import messages API from next-intl directly, use wrapper instead",
            }],
        }],

        "import/no-duplicates": ["error"],

        "import/no-unused-modules": ["warn", {
            "unusedExports": true,
            missingExports: true,
            ignoreExports: [],
        }],

        "import/no-unresolved": ["error", {
            "ignore": ["\\.png", "\\.svg", "\\.jpg", "\\.jpeg", "server-only"],
        }],
    },
}, globalIgnores([])]);
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/Git-I985/next-lint-to-eslint-cli-codemod-issue

To Reproduce

  • Install dependencies (npm install or whatever).
  • Run npx @next/codemod@canary next-lint-to-eslint-cli according to docs
  • On step ✔ On which files or directory should the codemods be applied? … type . (dot, current folder)

Current vs. Expected behavior

Current behavior

I get the following errors

Migrating from next lint to the ESLint CLI...
   Found legacy ESLint config: .eslintrc.cjs
   Running "npx @eslint/migrate-config /Users/xxx/Code/next-lint-to-eslint-cli-codemod-issue/.eslintrc.cjs" to convert legacy config...
/Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/transforms/next-lint-to-eslint-cli.js:855
                throw new Error(`Failed to run "${command}" to migrate the legacy ESLint config "${eslintConfigFilename}".\n` +
                      ^

Error: Failed to run "npx @eslint/migrate-config /Users/xxx/Code/next-lint-to-eslint-cli-codemod-issue/.eslintrc.cjs" to migrate the legacy ESLint config ".eslintrc.cjs".
Please try the migration to Flat config manually.
Learn more: https://eslint.org/docs/latest/use/configure/migration-guide
    at Object.transformer [as default] (/Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/transforms/next-lint-to-eslint-cli.js:855:23)
    at Command.runTransform (/Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/bin/transform.js:83:48)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  [cause]: Error: Failed to find the expected output file "/Users/xxx/Code/next-lint-to-eslint-cli-codemod-issue/eslint.config.mjs" generated by the migration tool.
      at Object.transformer [as default] (/Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/transforms/next-lint-to-eslint-cli.js:847:27)
      at Command.runTransform (/Users/xxx/.npm/_npx/6a090669e21b4303/node_modules/@next/codemod/bin/transform.js:83:48)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
}

Node.js v22.17.0

Expected behavior

I shouldn’t receive this error

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 12
Binaries:
  Node: 22.17.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 9.11.0
Relevant Packages:
  next: 16.0.1 // Latest available version is detected (16.0.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Instrumentation, Linting, Not sure

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

<details> <summary>Show generated config</summary>
const {
  defineConfig,
  globalIgnores,
} = require("eslint/config");

const {
  fixupConfigRules,
  fixupPluginRules,
} = require("@eslint/compat");

const tsParser = require("@typescript-eslint/parser");
const typescriptEslint = require("@typescript-eslint/eslint-plugin");
const svgJsx = require("eslint-plugin-svg-jsx");
const js = require("@eslint/js");

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

const compat = new FlatCompat({
  baseDirectory: __dirname,
  recommendedConfig: js.configs.recommended,
  allConfig: js.configs.all
});

module.exports = defineConfig([{
  extends: fixupConfigRules(compat.extends(
      "plugin:import/recommended",
      "plugin:import/react",
      "plugin:import/typescript",
      "next/core-web-vitals",
      "plugin:@typescript-eslint/recommended",
  )),

  languageOptions: {
      parser: tsParser,
  },

  plugins: {
      "@typescript-eslint": fixupPluginRules(typescriptEslint),
      "svg-jsx": svgJsx,
  },

  "rules": {
      "svg-jsx/camel-case-dash": "error",
      "svg-jsx/camel-case-colon": "error",
      "svg-jsx/no-style-string": "error",
      "no-unused-vars": "off",
      "@typescript-eslint/no-unused-vars": ["warn"],
      "@typescript-eslint/no-explicit-any": ["warn"],
      "@typescript-eslint/ban-ts-comment": ["warn"],
      "@typescript-eslint/no-empty-object-type": ["warn"],
      "@typescript-eslint/no-require-imports": ["warn"],
      "prefer-const": ["warn"],
      "prefer-spread": ["warn"],

      "no-restricted-syntax": ["error", {
          selector: "JSXOpeningElement[name.name='feGaussianBlur']",
          message: "<feGaussianBlur> has spotty Safari support",
      }],

      "no-restricted-imports": ["error", {
          paths: [{
              name: "next-intl/server",
              importNames: ["getTranslations"],
              message: "Do not import messages API from next-intl directly, use wrapper instead",
          }, {
              name: "next-intl",
              importNames: ["useTranslations"],
              message: "Do not import messages API from next-intl directly, use wrapper instead",
          }],
      }],

      "import/no-duplicates": ["error"],

      "import/no-unused-modules": ["warn", {
          "unusedExports": true,
          missingExports: true,
          ignoreExports: [],
      }],

      "import/no-unresolved": ["error", {
          "ignore": ["\\.png", "\\.svg", "\\.jpg", "\\.jpeg", "server-only"],
      }],
  },
}, globalIgnores([])]);
</details>

extent analysis

TL;DR

Manually migrate the legacy ESLint config to Flat config as suggested in the error message.

Guidance

  • The error message indicates a failure to migrate the legacy ESLint config using npx @eslint/migrate-config.
  • The suggested workaround is to try the migration manually.
  • Review the generated eslint.config.cjs for any potential issues or errors.
  • Check the ESLint migration guide for more information on migrating to Flat config.

Example

No code example is provided as the issue is related to a specific codemod tool and ESLint configuration.

Notes

The provided information suggests that the issue is related to the migration of the ESLint config. However, without more details about the specific error or the expected behavior, it's difficult to provide a more specific solution.

Recommendation

Apply workaround: Manually migrate the legacy ESLint config to Flat config as suggested in the error message. This is recommended because the automated migration using npx @eslint/migrate-config is failing, and manual migration is the suggested alternative.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - ✅(Solved) Fix Broken next-lint-to-eslint-cli codemod [1 pull requests, 1 comments, 2 participants]