react-doctor 0.2.14-dev.b612664 → 0.2.14-dev.daef23c

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/index.d.ts CHANGED
@@ -53,6 +53,14 @@ type RuleSeverityOverride = "error" | "warn" | "off";
53
53
  * `rules` and `categories` fields on `ReactDoctorConfig`. Per-rule
54
54
  * wins over per-category when both match the same diagnostic.
55
55
  */
56
+ /**
57
+ * Closed set of severity buckets. Spelled out (rather than
58
+ * `Record<string, …>`) so an unknown/typo'd bucket key is a type error
59
+ * instead of a silent no-op.
60
+ */
61
+ interface SeverityBuckets {
62
+ "compiler-cleanup"?: RuleSeverityOverride;
63
+ }
56
64
  interface SurfaceControls {
57
65
  /**
58
66
  * Tag names whose diagnostics should be force-included on the surface,
@@ -66,9 +74,9 @@ interface SurfaceControls {
66
74
  * `["test-noise"]`) for a single channel without touching others.
67
75
  */
68
76
  excludeTags?: string[];
69
- /** Category names (e.g. `"Architecture"`) to force-include. */
77
+ /** Category names (e.g. `"Maintainability"`) to force-include. */
70
78
  includeCategories?: string[];
71
- /** Category names (e.g. `"Architecture"`) to exclude. */
79
+ /** Category names (e.g. `"Maintainability"`) to exclude. */
72
80
  excludeCategories?: string[];
73
81
  /**
74
82
  * Fully-qualified rule keys (`"<plugin>/<rule>"`, e.g.
@@ -85,12 +93,23 @@ interface ReactDoctorConfig {
85
93
  /**
86
94
  * Whether to run dead-code analysis (via `deslop-js`) alongside lint.
87
95
  * Reports unused files, unused exports, unused dependencies, and
88
- * circular imports under the "Dead Code" category. Default: `true`.
96
+ * circular imports under the "Maintainability" category. Default: `true`.
89
97
  * Always skipped in `--diff` / `--staged` modes because reachability
90
98
  * is a whole-project property.
91
99
  */
92
100
  deadCode?: boolean;
93
101
  verbose?: boolean;
102
+ /**
103
+ * Whether to surface `"warning"`-severity diagnostics. Default: `false`
104
+ * — only `"error"`-severity findings reach any surface (CLI, PR comment,
105
+ * score, `--fail-on`).
106
+ *
107
+ * Set to `true` to surface every warning on every surface. This is the
108
+ * master toggle and runs after per-rule / per-category severity
109
+ * overrides: a rule the user explicitly restamps to `"warn"` (via
110
+ * `rules` / `categories`) still shows even when `warnings` is `false`.
111
+ */
112
+ warnings?: boolean;
94
113
  diff?: boolean | string;
95
114
  failOn?: FailOnLevel;
96
115
  customRulesOnly?: boolean;
@@ -229,15 +248,12 @@ interface ReactDoctorConfig {
229
248
  rules?: Record<string, RuleSeverityOverride>;
230
249
  /**
231
250
  * Per-category severity map. Mirrors oxlint's top-level
232
- * `categories` field, but keyed by React Doctor's display
233
- * categories (`"Server"`, `"React Native"`, `"Architecture"`,
234
- * `"Bundle Size"`, `"State & Effects"`, `"Security"`,
235
- * `"Accessibility"`, `"Performance"`, `"Correctness"`,
236
- * `"Next.js"`, `"Preact"`, `"TanStack Query"`,
237
- * `"TanStack Start"`, …).
251
+ * `categories` field, but keyed by React Doctor's five user-facing
252
+ * buckets: `"Security"`, `"Bugs"`, `"Performance"`,
253
+ * `"Accessibility"`, `"Maintainability"`.
238
254
  *
239
255
  * ```json
240
- * { "categories": { "React Native": "warn", "Server": "off" } }
256
+ * { "categories": { "Maintainability": "off", "Performance": "warn" } }
241
257
  * ```
242
258
  *
243
259
  * To silence a whole tag-defined rule family (e.g. `"design"`,
@@ -245,6 +261,20 @@ interface ReactDoctorConfig {
245
261
  * single category, use `ignore.tags` instead.
246
262
  */
247
263
  categories?: Record<string, RuleSeverityOverride>;
264
+ /**
265
+ * Per-bucket severity map. Buckets are curated rule families with a
266
+ * shared gating story (not categories). Today the only bucket is
267
+ * `"compiler-cleanup"`: the redundant-memoization rule
268
+ * (`react-compiler-no-manual-memoization`) that ships as a warning once
269
+ * React Compiler is detected. Set it to `"error"` to re-enable strictness.
270
+ *
271
+ * ```json
272
+ * { "buckets": { "compiler-cleanup": "error" } }
273
+ * ```
274
+ *
275
+ * A per-rule override in `rules` still wins over a bucket entry.
276
+ */
277
+ buckets?: SeverityBuckets;
248
278
  /**
249
279
  * User-defined oxlint plugins to load alongside the built-in
250
280
  * `react-doctor` plugin. Each entry is either:
@@ -288,6 +318,7 @@ interface Diagnostic {
288
318
  plugin: string;
289
319
  rule: string;
290
320
  severity: "error" | "warning";
321
+ title?: string;
291
322
  message: string;
292
323
  help: string;
293
324
  url?: string;
@@ -371,6 +402,12 @@ interface DiagnoseOptions {
371
402
  * See that field's docs for the full contract.
372
403
  */
373
404
  respectInlineDisables?: boolean;
405
+ /**
406
+ * Per-call override for `ReactDoctorConfig.warnings`. See that field's
407
+ * docs — `"warning"`-severity diagnostics are hidden unless this (or
408
+ * the config) opts them back in.
409
+ */
410
+ warnings?: boolean;
374
411
  }
375
412
  interface DiagnoseResult {
376
413
  diagnostics: Diagnostic[];
@@ -410,6 +447,28 @@ interface InspectResult {
410
447
  skippedCheckReasons?: Record<string, string>;
411
448
  project: ProjectInfo;
412
449
  elapsedMilliseconds: number;
450
+ /**
451
+ * Number of files the scan reported. Distinct from
452
+ * `project.sourceFileCount` in diff / staged mode (where only changed
453
+ * files are scanned). Optional so non-orchestrator constructors keep
454
+ * working; the multi-project summary falls back to
455
+ * `project.sourceFileCount` when absent.
456
+ */
457
+ scannedFileCount?: number;
458
+ /**
459
+ * Absolute paths of every file the scan considered. Lets the
460
+ * multi-project summary count UNIQUE files across projects instead of
461
+ * summing per-project counts, which double-counts shared files when one
462
+ * workspace package's tree is nested inside another's.
463
+ */
464
+ scannedFilePaths?: ReadonlyArray<string>;
465
+ /**
466
+ * Wall-clock duration of the scan phase, in milliseconds. Distinct
467
+ * from `elapsedMilliseconds` (which spans the full `inspect()` call
468
+ * including score fetch + rendering). Used by the multi-project
469
+ * summary to report combined scan time.
470
+ */
471
+ scanElapsedMilliseconds?: number;
413
472
  }
414
473
  /**
415
474
  * Options accepted by `inspect()`. Mixes two concern groups; ordered