From e68ce6e9925b531b9243b956869e1558c405ea78 Mon Sep 17 00:00:00 2001 From: Jiwon Choi Date: Tue, 15 Oct 2024 19:42:16 +0900 Subject: [PATCH] fix(next): eslint v9 not picking up config (#71298) --- packages/next/src/lib/eslint/runLintCheck.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/next/src/lib/eslint/runLintCheck.ts b/packages/next/src/lib/eslint/runLintCheck.ts index 8f175506d4540..b224d4e848574 100644 --- a/packages/next/src/lib/eslint/runLintCheck.ts +++ b/packages/next/src/lib/eslint/runLintCheck.ts @@ -135,9 +135,11 @@ async function lint( const mod = await Promise.resolve(require(deps.resolved.get('eslint')!)) - const useFlatConfig = - // If V9 config was found, use flat config, or else use legacy. - eslintrcFile?.startsWith('eslint.config.') + // If V9 config was found, use flat config, or else use legacy. + const useFlatConfig = eslintrcFile + ? // eslintrcFile is absolute path + path.basename(eslintrcFile).startsWith('eslint.config.') + : false let ESLint // loadESLint is >= 8.57.0