Skip to content

Commit 391f785

Browse files
committed
fix(check): do not treat lint warnings as errors in exit code
When oxlint reports only warnings (0 errors), override the raw exit code to SUCCESS instead of propagating oxlint's non-zero exit code. This fixes ecosystem-ci failures where type-aware lint rules (e.g. typescript-eslint/await-thenable) produce warnings that cause `vp check --fix` to exit with code 1.
1 parent 09372d9 commit 391f785

File tree

6 files changed

+35
-0
lines changed

6 files changed

+35
-0
lines changed

packages/cli/binding/src/cli.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,7 @@ async fn execute_direct_subcommand(
12141214
Some(Err(failure)) => {
12151215
if failure.errors == 0 && failure.warnings > 0 {
12161216
output::warn(lint_message_kind.warning_heading());
1217+
status = ExitStatus::SUCCESS;
12171218
} else {
12181219
output::error(lint_message_kind.issue_heading());
12191220
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"no-console": "warn"
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "check-fix-lint-warn",
3+
"version": "0.0.0",
4+
"private": true
5+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
> vp check --fix
2+
warn: Lint warnings found
3+
⚠ eslint(no-console): Unexpected console statement.
4+
╭─[src/index.js:2:3]
5+
1 │ function hello() {
6+
2 │ console.log("hello");
7+
· ───────────
8+
3 │ }
9+
╰────
10+
help: Delete this console statement.
11+
12+
Found 0 errors and 1 warning in 1 file (<variable>ms, <variable> threads)
13+
pass: Formatting completed for checked files (<variable>ms)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function hello() {
2+
console.log("hello");
3+
}
4+
5+
export { hello };
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"env": {
3+
"VITE_DISABLE_AUTO_INSTALL": "1"
4+
},
5+
"commands": ["vp check --fix"]
6+
}

0 commit comments

Comments
 (0)