oxlint-harness 1.0.10 → 1.0.12
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 +15 -17
- package/package.json +2 -2
package/dist/command.js
CHANGED
|
@@ -56,7 +56,7 @@ The suppression file format uses counts per rule per file:
|
|
|
56
56
|
tighten: Flags.boolean({
|
|
57
57
|
char: "t",
|
|
58
58
|
description: "Tighten suppressions by reducing counts when violations are fixed",
|
|
59
|
-
default:
|
|
59
|
+
default: false,
|
|
60
60
|
allowNo: true,
|
|
61
61
|
}),
|
|
62
62
|
};
|
|
@@ -89,17 +89,17 @@ The suppression file format uses counts per rule per file:
|
|
|
89
89
|
this.log(" --show-code <number> Show code snippets for files with N or fewer errors (default: 3, 0 to disable)");
|
|
90
90
|
this.log(" --results-path <path> Path to save oxlint JSON results (default: artifacts/oxlint-results.json)");
|
|
91
91
|
this.log(" --no-save-results Don't save oxlint JSON results to file");
|
|
92
|
-
this.log(" -t, --tighten Tighten suppressions when violations are fixed
|
|
92
|
+
this.log(" -t, --tighten Tighten suppressions when violations are fixed");
|
|
93
93
|
this.log(" --no-tighten Don't tighten suppressions");
|
|
94
94
|
this.log(" --no-type-aware Don't pass --type-aware to oxlint (default: passes it)");
|
|
95
|
-
this.log(" --
|
|
95
|
+
this.log(" --type-check Pass --type-check to oxlint (default: off)");
|
|
96
96
|
this.log(" -h, --help Show this help message");
|
|
97
97
|
this.log("");
|
|
98
98
|
this.log("ENVIRONMENT VARIABLES");
|
|
99
99
|
this.log(" OXLINT_HARNESS_RESULTS_PATH Override the results file path");
|
|
100
100
|
this.log(" OXLINT_HARNESS_NO_FAIL_ON_EXCESS Set to 'true' to exit 0 on new errors");
|
|
101
101
|
this.log(" OXLINT_HARNESS_NO_TYPE_AWARE Set to 'true' to skip --type-aware");
|
|
102
|
-
this.log("
|
|
102
|
+
this.log(" OXLINT_HARNESS_TYPE_CHECK Set to 'true' to enable --type-check");
|
|
103
103
|
this.log("");
|
|
104
104
|
this.log("ARGS");
|
|
105
105
|
this.log(" <paths> Files or directories to lint (passed to oxlint)");
|
|
@@ -129,7 +129,7 @@ The suppression file format uses counts per rule per file:
|
|
|
129
129
|
"-t",
|
|
130
130
|
"--no-tighten",
|
|
131
131
|
"--no-type-aware",
|
|
132
|
-
"--
|
|
132
|
+
"--type-check",
|
|
133
133
|
]);
|
|
134
134
|
const collectOxlintArgs = (args) => {
|
|
135
135
|
const passthrough = [];
|
|
@@ -159,7 +159,7 @@ The suppression file format uses counts per rule per file:
|
|
|
159
159
|
if (arg === "--tighten" || arg === "-t" || arg === "--no-tighten") {
|
|
160
160
|
continue;
|
|
161
161
|
}
|
|
162
|
-
if (arg === "--no-type-aware" || arg === "--
|
|
162
|
+
if (arg === "--no-type-aware" || arg === "--type-check") {
|
|
163
163
|
continue;
|
|
164
164
|
}
|
|
165
165
|
if (arg === "--help" || arg === "-h") {
|
|
@@ -187,7 +187,7 @@ The suppression file format uses counts per rule per file:
|
|
|
187
187
|
"results-path": process.env.OXLINT_HARNESS_RESULTS_PATH ||
|
|
188
188
|
"artifacts/oxlint-results.json",
|
|
189
189
|
"save-results": true,
|
|
190
|
-
tighten:
|
|
190
|
+
tighten: false,
|
|
191
191
|
};
|
|
192
192
|
// Manually parse known flags and collect unknown ones
|
|
193
193
|
for (let i = 0; i < rawArgs.length; i++) {
|
|
@@ -239,15 +239,15 @@ The suppression file format uses counts per rule per file:
|
|
|
239
239
|
throw error;
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
// Default --type-aware
|
|
242
|
+
// Default --type-aware unless opted out; --type-check is opt-in
|
|
243
243
|
const noTypeAware = rawArgs.includes("--no-type-aware") ||
|
|
244
244
|
process.env.OXLINT_HARNESS_NO_TYPE_AWARE?.toLowerCase() === "true";
|
|
245
|
-
const
|
|
246
|
-
process.env.
|
|
245
|
+
const typeCheck = rawArgs.includes("--type-check") ||
|
|
246
|
+
process.env.OXLINT_HARNESS_TYPE_CHECK?.toLowerCase() === "true";
|
|
247
247
|
if (!noTypeAware && !oxlintArgs.includes("--type-aware")) {
|
|
248
248
|
oxlintArgs.unshift("--type-aware");
|
|
249
249
|
}
|
|
250
|
-
if (
|
|
250
|
+
if (typeCheck && !oxlintArgs.includes("--type-check")) {
|
|
251
251
|
oxlintArgs.unshift("--type-check");
|
|
252
252
|
}
|
|
253
253
|
// Check for OXLINT_HARNESS_UPDATE_BULK_SUPPRESSION environment variable
|
|
@@ -283,12 +283,10 @@ The suppression file format uses counts per rule per file:
|
|
|
283
283
|
// Normal mode: check suppressions
|
|
284
284
|
const suppressions = suppressionManager.loadSuppressions();
|
|
285
285
|
const excessErrors = suppressionManager.findExcessErrors(diagnostics, suppressions);
|
|
286
|
-
// Tighten is
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
shouldTighten = true;
|
|
291
|
-
}
|
|
286
|
+
// Tighten is opt-in via --tighten flag or env var
|
|
287
|
+
const shouldTighten = flags.tighten ||
|
|
288
|
+
process.env.OXLINT_HARNESS_TIGHTEN_BULK_SUPPRESSION?.toLowerCase() ===
|
|
289
|
+
"true";
|
|
292
290
|
if (shouldTighten) {
|
|
293
291
|
// Tighten suppressions by removing/reducing cleaned-up violations
|
|
294
292
|
const tightenedSuppressions = suppressionManager.tightenSuppressions(suppressions, diagnostics, targetedPaths.length > 0 ? targetedPaths : undefined);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint-harness",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "A harness for oxlint with bulk suppressions support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=22"
|
|
53
53
|
},
|
|
54
|
-
"packageManager": "pnpm@
|
|
54
|
+
"packageManager": "pnpm@10.28.0+sha512.05df71d1421f21399e053fde567cea34d446fa02c76571441bfc1c7956e98e363088982d940465fd34480d4d90a0668bc12362f8aa88000a64e83d0b0e47be48"
|
|
55
55
|
}
|