Skip to content

Commit 3f47644

Browse files
committed
Fix oxlint test helper error handling
1 parent e64af92 commit 3f47644

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

lint-rules/oxlint-test-utils.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { spawn } from 'node:child_process'
2-
import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
2+
import { mkdtemp, rm, writeFile } from 'node:fs/promises'
33
import { tmpdir } from 'node:os'
44
import path from 'node:path'
55
import { fileURLToPath } from 'node:url'
@@ -103,7 +103,7 @@ export async function runOxlint(input) {
103103
throw new Error(result.stderr)
104104
}
105105

106-
if (result.exitCode && result.exitCode !== 0) {
106+
if (result.exitCode != null && result.exitCode > 1) {
107107
throw new Error(result.stdout || `Oxlint exited with code ${result.exitCode}`)
108108
}
109109

@@ -121,6 +121,3 @@ export async function disposeOxlintFixture(fixture) {
121121
await fixture[Symbol.asyncDispose]()
122122
}
123123

124-
export async function readLockfile() {
125-
return readFile(path.join(rootDirectory, 'package-lock.json'), 'utf8')
126-
}

0 commit comments

Comments
 (0)