From 141d5b309cc0f1aacd7eff40ef3f5c09fb65a2fe Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 23 May 2024 15:06:29 -0600 Subject: [PATCH] fix: if error occurs, don't disable linting --- test/lib/next-test-utils.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/lib/next-test-utils.ts b/test/lib/next-test-utils.ts index 0c934f0e2a5fe0..5b42399d8a9222 100644 --- a/test/lib/next-test-utils.ts +++ b/test/lib/next-test-utils.ts @@ -468,9 +468,7 @@ export function shouldDisableLinting(dir: string) { ) { return false } - } catch {} - try { // If some of these files exist, we should not disable linting. if ( ['.eslintrc.json', '.eslintrc.js', '.eslintrc'].some((file) => @@ -479,9 +477,7 @@ export function shouldDisableLinting(dir: string) { ) { return false } - } catch {} - try { // If the `eslintConfig` field is present in the `package.json` file, we // should not disable linting. if ( @@ -490,9 +486,13 @@ export function shouldDisableLinting(dir: string) { ) { return false } - } catch {} - return true + return true + } catch { + // An error ocurred while checking the directory, so we should not disable + // linting. + return false + } } export function nextBuild(