Skip to content

Commit

Permalink
fix: if error occurs, don't disable linting
Browse files Browse the repository at this point in the history
  • Loading branch information
wyattjoh committed May 23, 2024
1 parent a720066 commit 141d5b3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/lib/next-test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand All @@ -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 (
Expand All @@ -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(
Expand Down

0 comments on commit 141d5b3

Please sign in to comment.