Skip to content

Commit

Permalink
Exit with 1 if there are relevant diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
daniilsapa committed Jul 17, 2024
1 parent 350560d commit 743de0b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/steiger/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,15 @@ if (consoleArgs.watch) {
})
} else {
const diagnostics = await linter.run(resolve(consoleArgs._[0]))
let stillRelevantDiagnostics = diagnostics

reportPretty(diagnostics, process.cwd())

if (consoleArgs.fix) {
applyAutofixes(diagnostics)
stillRelevantDiagnostics = await applyAutofixes(diagnostics)
}

if (stillRelevantDiagnostics.length > 0) {
process.exit(1)
}
}

0 comments on commit 743de0b

Please sign in to comment.