Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 53b673b

Browse files
committed
fix(lint): handle Biome 'no files processed' as success
When Biome receives files that are excluded by its configuration (e.g., package.json, CHANGELOG.md), it exits with an error stating "No files were processed in the specified paths". This is not a real error - it just means Biome had nothing to do. This change detects this specific error message and treats it as success, allowing the linter to continue to the next linter (eslint) instead of failing the entire lint run. Fixes spurious lint failures in git hooks when staging files that Biome doesn't process.
1 parent 22f3f0c commit 53b673b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

‎scripts/lint.mjs‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,16 @@ async function runLintOnFiles(files, options = {}) {
195195
const result = await runCommandQuiet('pnpm', args)
196196

197197
if (result.exitCode !== 0) {
198+
// Check if Biome simply had no files to process (not an error)
199+
const isBiomeNoFilesError =
200+
result.stderr &&
201+
result.stderr.includes('No files were processed in the specified paths')
202+
203+
if (isBiomeNoFilesError) {
204+
// Biome had nothing to do - this is fine, continue to next linter
205+
continue
206+
}
207+
198208
// When fixing, non-zero exit codes are normal if fixes were applied.
199209
if (!fix || (result.stderr && result.stderr.trim().length > 0)) {
200210
if (!quiet) {
@@ -259,6 +269,16 @@ async function runLintOnAll(options = {}) {
259269
const result = await runCommandQuiet('pnpm', args)
260270

261271
if (result.exitCode !== 0) {
272+
// Check if Biome simply had no files to process (not an error)
273+
const isBiomeNoFilesError =
274+
result.stderr &&
275+
result.stderr.includes('No files were processed in the specified paths')
276+
277+
if (isBiomeNoFilesError) {
278+
// Biome had nothing to do - this is fine, continue to next linter
279+
continue
280+
}
281+
262282
// When fixing, non-zero exit codes are normal if fixes were applied.
263283
if (!fix || (result.stderr && result.stderr.trim().length > 0)) {
264284
if (!quiet) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /