oxlint-harness 1.0.5 → 1.0.6

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/README.md CHANGED
@@ -240,6 +240,13 @@ pnpm lint
240
240
  pnpm dev --help
241
241
  ```
242
242
 
243
+ ## Publishing
244
+
245
+ ```
246
+ npm login
247
+ npm publish
248
+ ```
249
+
243
250
  ## License
244
251
 
245
252
  MIT
package/dist/command.d.ts CHANGED
@@ -10,6 +10,7 @@ export default class OxlintHarness extends Command {
10
10
  "show-code": import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
11
11
  "results-path": import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
12
  "save-results": import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
+ tighten: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
14
  };
14
15
  static args: {
15
16
  paths: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
package/dist/command.js CHANGED
@@ -53,6 +53,12 @@ The suppression file format uses counts per rule per file:
53
53
  default: true,
54
54
  allowNo: true,
55
55
  }),
56
+ tighten: Flags.boolean({
57
+ char: "t",
58
+ description: "Tighten suppressions by reducing counts when violations are fixed",
59
+ default: true,
60
+ allowNo: true,
61
+ }),
56
62
  };
57
63
  static args = {
58
64
  paths: Args.string({
@@ -83,6 +89,8 @@ The suppression file format uses counts per rule per file:
83
89
  this.log(" --show-code <number> Show code snippets for files with N or fewer errors (default: 3, 0 to disable)");
84
90
  this.log(" --results-path <path> Path to save oxlint JSON results (default: artifacts/oxlint-results.json)");
85
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 (default: true)");
93
+ this.log(" --no-tighten Don't tighten suppressions");
86
94
  this.log(" -h, --help Show this help message");
87
95
  this.log("");
88
96
  this.log("ENVIRONMENT VARIABLES");
@@ -113,6 +121,9 @@ The suppression file format uses counts per rule per file:
113
121
  "--results-path",
114
122
  "--save-results",
115
123
  "--no-save-results",
124
+ "--tighten",
125
+ "-t",
126
+ "--no-tighten",
116
127
  ]);
117
128
  const collectOxlintArgs = (args) => {
118
129
  const passthrough = [];
@@ -139,6 +150,9 @@ The suppression file format uses counts per rule per file:
139
150
  if (arg === "--save-results" || arg === "--no-save-results") {
140
151
  continue;
141
152
  }
153
+ if (arg === "--tighten" || arg === "-t" || arg === "--no-tighten") {
154
+ continue;
155
+ }
142
156
  if (arg === "--help" || arg === "-h") {
143
157
  continue;
144
158
  }
@@ -164,6 +178,7 @@ The suppression file format uses counts per rule per file:
164
178
  "results-path": process.env.OXLINT_HARNESS_RESULTS_PATH ||
165
179
  "artifacts/oxlint-results.json",
166
180
  "save-results": true,
181
+ tighten: true,
167
182
  };
168
183
  // Manually parse known flags and collect unknown ones
169
184
  for (let i = 0; i < rawArgs.length; i++) {
@@ -195,6 +210,12 @@ The suppression file format uses counts per rule per file:
195
210
  else if (arg === "--no-save-results") {
196
211
  parsedFlags["save-results"] = false;
197
212
  }
213
+ else if (arg === "--tighten" || arg === "-t") {
214
+ parsedFlags.tighten = true;
215
+ }
216
+ else if (arg === "--no-tighten") {
217
+ parsedFlags.tighten = false;
218
+ }
198
219
  else if (!knownFlagNames.has(arg) &&
199
220
  arg !== "--help" &&
200
221
  arg !== "-h") {
@@ -241,9 +262,12 @@ The suppression file format uses counts per rule per file:
241
262
  // Normal mode: check suppressions
242
263
  const suppressions = suppressionManager.loadSuppressions();
243
264
  const excessErrors = suppressionManager.findExcessErrors(diagnostics, suppressions);
244
- // Check for OXLINT_HARNESS_TIGHTEN_BULK_SUPPRESSION environment variable
245
- const shouldTighten = process.env.OXLINT_HARNESS_TIGHTEN_BULK_SUPPRESSION?.toLowerCase() ===
246
- "true";
265
+ // Tighten is on by default; env var can override the flag
266
+ let shouldTighten = flags.tighten;
267
+ if (process.env.OXLINT_HARNESS_TIGHTEN_BULK_SUPPRESSION?.toLowerCase() ===
268
+ "true") {
269
+ shouldTighten = true;
270
+ }
247
271
  if (shouldTighten) {
248
272
  // Tighten suppressions by removing/reducing cleaned-up violations
249
273
  const tightenedSuppressions = suppressionManager.tightenSuppressions(suppressions, diagnostics);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-harness",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "A harness for oxlint with bulk suppressions support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",