Skip to content

Commit

Permalink
hotfix(next):next lint installs eslint@9 which includes breaking …
Browse files Browse the repository at this point in the history
…changes (#64141)

This is a hotfix since it breaks `next lint`, I'll start to implement
eslint v9 for canary.

x-ref: #64114
x-ref: [eslint v9
release](https://github.com/eslint/eslint/releases/tag/v9.0.0)
Fixes #64136

---------

Co-authored-by: Zack Tanner <zacktanner@gmail.com>
  • Loading branch information
devjiwonchoi and ztanner authored Apr 6, 2024
1 parent acaf642 commit 3b24c34
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/next/src/lib/eslint/runLintCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,16 @@ export async function runLintCheck(
} else {
// Check if necessary deps installed, and install any that are missing
deps = await hasNecessaryDependencies(baseDir, requiredPackages)
if (deps.missing.length > 0)
if (deps.missing.length > 0) {
deps.missing.forEach((dep) => {
if (dep.pkg === 'eslint') {
// eslint v9 has breaking changes, so lock to 8 until dependency plugins fully support v9.
dep.pkg = 'eslint@^8'
}
})

await installDependencies(baseDir, deps.missing, true)
}

// Write default ESLint config.
// Check for /pages and src/pages is to make sure this happens in Next.js folder
Expand Down

0 comments on commit 3b24c34

Please sign in to comment.