oxlint-harness 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,7 +58,7 @@ export class OxlintRunner {
58
58
  try {
59
59
  // oxlint exits with non-zero when linting issues are found
60
60
  // We still want to parse the JSON output
61
- const diagnostics = this.parseOxlintOutput(stdout);
61
+ const diagnostics = this.parseOxlintOutput(stdout, code, stderr);
62
62
  resolve(diagnostics);
63
63
  }
64
64
  catch (error) {
@@ -70,9 +70,12 @@ export class OxlintRunner {
70
70
  });
71
71
  });
72
72
  }
73
- parseOxlintOutput(output) {
73
+ parseOxlintOutput(output, exitCode = null, stderr = '') {
74
74
  if (!output.trim()) {
75
- return [];
75
+ // oxlint -f json should always produce JSON output. Empty stdout means
76
+ // it failed to run (missing tsconfig, binary not found, signal kill, etc).
77
+ // Returning [] here would cause tighten to wipe the suppression file.
78
+ throw new Error(`oxlint produced no output (exit code: ${exitCode}).${stderr ? `\nStderr: ${stderr}` : ''}`);
76
79
  }
77
80
  try {
78
81
  const parsed = JSON.parse(output);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-harness",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "A harness for oxlint with bulk suppressions support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",