oxlint-harness 1.0.6 → 1.0.8

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.
package/dist/command.js CHANGED
@@ -91,11 +91,15 @@ The suppression file format uses counts per rule per file:
91
91
  this.log(" --no-save-results Don't save oxlint JSON results to file");
92
92
  this.log(" -t, --tighten Tighten suppressions when violations are fixed (default: true)");
93
93
  this.log(" --no-tighten Don't tighten suppressions");
94
+ this.log(" --no-type-aware Don't pass --type-aware to oxlint (default: passes it)");
95
+ this.log(" --no-type-check Don't pass --type-check to oxlint (default: passes it)");
94
96
  this.log(" -h, --help Show this help message");
95
97
  this.log("");
96
98
  this.log("ENVIRONMENT VARIABLES");
97
99
  this.log(" OXLINT_HARNESS_RESULTS_PATH Override the results file path");
98
100
  this.log(" OXLINT_HARNESS_NO_FAIL_ON_EXCESS Set to 'true' to exit 0 on new errors");
101
+ this.log(" OXLINT_HARNESS_NO_TYPE_AWARE Set to 'true' to skip --type-aware");
102
+ this.log(" OXLINT_HARNESS_NO_TYPE_CHECK Set to 'true' to skip --type-check");
99
103
  this.log("");
100
104
  this.log("ARGS");
101
105
  this.log(" <paths> Files or directories to lint (passed to oxlint)");
@@ -124,6 +128,8 @@ The suppression file format uses counts per rule per file:
124
128
  "--tighten",
125
129
  "-t",
126
130
  "--no-tighten",
131
+ "--no-type-aware",
132
+ "--no-type-check",
127
133
  ]);
128
134
  const collectOxlintArgs = (args) => {
129
135
  const passthrough = [];
@@ -153,6 +159,9 @@ The suppression file format uses counts per rule per file:
153
159
  if (arg === "--tighten" || arg === "-t" || arg === "--no-tighten") {
154
160
  continue;
155
161
  }
162
+ if (arg === "--no-type-aware" || arg === "--no-type-check") {
163
+ continue;
164
+ }
156
165
  if (arg === "--help" || arg === "-h") {
157
166
  continue;
158
167
  }
@@ -230,6 +239,17 @@ The suppression file format uses counts per rule per file:
230
239
  throw error;
231
240
  }
232
241
  }
242
+ // Default --type-aware and --type-check unless opted out
243
+ const noTypeAware = rawArgs.includes("--no-type-aware") ||
244
+ process.env.OXLINT_HARNESS_NO_TYPE_AWARE?.toLowerCase() === "true";
245
+ const noTypeCheck = rawArgs.includes("--no-type-check") ||
246
+ process.env.OXLINT_HARNESS_NO_TYPE_CHECK?.toLowerCase() === "true";
247
+ if (!noTypeAware && !oxlintArgs.includes("--type-aware")) {
248
+ oxlintArgs.unshift("--type-aware");
249
+ }
250
+ if (!noTypeCheck && !oxlintArgs.includes("--type-check")) {
251
+ oxlintArgs.unshift("--type-check");
252
+ }
233
253
  // Check for OXLINT_HARNESS_UPDATE_BULK_SUPPRESSION environment variable
234
254
  if (process.env.OXLINT_HARNESS_UPDATE_BULK_SUPPRESSION?.toLowerCase() ===
235
255
  "true") {
@@ -59,6 +59,14 @@ export class OxlintRunner {
59
59
  // oxlint exits with non-zero when linting issues are found
60
60
  // We still want to parse the JSON output
61
61
  const diagnostics = this.parseOxlintOutput(stdout);
62
+ // If oxlint produced no diagnostics but exited with a code other than
63
+ // 0 (success) or 1 (lint violations found), treat it as a failure.
64
+ // This prevents tighten from wiping the suppression file when oxlint
65
+ // fails silently (e.g. missing tsconfig for --type-aware).
66
+ if (diagnostics.length === 0 && code !== 0 && code !== 1) {
67
+ reject(new Error(`oxlint exited with code ${code} and produced no output.\nStderr: ${stderr}`));
68
+ return;
69
+ }
62
70
  resolve(diagnostics);
63
71
  }
64
72
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-harness",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "A harness for oxlint with bulk suppressions support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",