hotfix(next):next lint installs eslint@9 which includes breaking 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>
This commit is contained in:
Jiwon Choi 2024-04-06 23:45:21 +09:00 committed by GitHub
parent acaf642fbd
commit 3b24c347e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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