react-doctor 0.2.14-dev.5f7cc7c → 0.2.14-dev.6448d5b

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
@@ -20,9 +20,9 @@ interface ReactDoctorIgnoreConfig {
20
20
  * locally but excluded from PR comments, the score, or the CI gate:
21
21
  *
22
22
  * - `cli` — local terminal output from `react-doctor` (`printDiagnostics`).
23
- * - `prComment` — output captured by the GitHub Action for the sticky
24
- * PR comment. Enabled when the CLI is run with `--pr-comment` (the
25
- * action sets this automatically when `github-token` is provided).
23
+ * - `prComment` — diagnostics destined for a sticky pull-request
24
+ * summary comment. Selected by running the CLI with `--pr-comment`
25
+ * (sets `outputSurface: "prComment"`).
26
26
  * - `score` — diagnostics shipped to the React Doctor score API
27
27
  * (or counted toward local score calculations).
28
28
  * - `ciFailure` — diagnostics that count toward the `--fail-on` exit
@@ -66,9 +66,9 @@ interface SurfaceControls {
66
66
  * `["test-noise"]`) for a single channel without touching others.
67
67
  */
68
68
  excludeTags?: string[];
69
- /** Category names (e.g. `"Architecture"`) to force-include. */
69
+ /** Category names (e.g. `"Maintainability"`) to force-include. */
70
70
  includeCategories?: string[];
71
- /** Category names (e.g. `"Architecture"`) to exclude. */
71
+ /** Category names (e.g. `"Maintainability"`) to exclude. */
72
72
  excludeCategories?: string[];
73
73
  /**
74
74
  * Fully-qualified rule keys (`"<plugin>/<rule>"`, e.g.
@@ -85,12 +85,23 @@ interface ReactDoctorConfig {
85
85
  /**
86
86
  * Whether to run dead-code analysis (via `deslop-js`) alongside lint.
87
87
  * Reports unused files, unused exports, unused dependencies, and
88
- * circular imports under the "Dead Code" category. Default: `true`.
88
+ * circular imports under the "Maintainability" category. Default: `true`.
89
89
  * Always skipped in `--diff` / `--staged` modes because reachability
90
90
  * is a whole-project property.
91
91
  */
92
92
  deadCode?: boolean;
93
93
  verbose?: boolean;
94
+ /**
95
+ * Whether to surface `"warning"`-severity diagnostics. Default: `false`
96
+ * — only `"error"`-severity findings reach any surface (CLI, PR comment,
97
+ * score, `--fail-on`).
98
+ *
99
+ * Set to `true` to surface every warning on every surface. This is the
100
+ * master toggle and runs after per-rule / per-category severity
101
+ * overrides: a rule the user explicitly restamps to `"warn"` (via
102
+ * `rules` / `categories`) still shows even when `warnings` is `false`.
103
+ */
104
+ warnings?: boolean;
94
105
  diff?: boolean | string;
95
106
  failOn?: FailOnLevel;
96
107
  customRulesOnly?: boolean;
@@ -229,15 +240,12 @@ interface ReactDoctorConfig {
229
240
  rules?: Record<string, RuleSeverityOverride>;
230
241
  /**
231
242
  * 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"`, …).
243
+ * `categories` field, but keyed by React Doctor's five user-facing
244
+ * buckets: `"Security"`, `"Bugs"`, `"Performance"`,
245
+ * `"Accessibility"`, `"Maintainability"`.
238
246
  *
239
247
  * ```json
240
- * { "categories": { "React Native": "warn", "Server": "off" } }
248
+ * { "categories": { "Maintainability": "off", "Performance": "warn" } }
241
249
  * ```
242
250
  *
243
251
  * To silence a whole tag-defined rule family (e.g. `"design"`,
@@ -288,6 +296,7 @@ interface Diagnostic {
288
296
  plugin: string;
289
297
  rule: string;
290
298
  severity: "error" | "warning";
299
+ title?: string;
291
300
  message: string;
292
301
  help: string;
293
302
  url?: string;
@@ -349,9 +358,15 @@ interface ProjectInfo {
349
358
  }
350
359
  //#endregion
351
360
  //#region src/types/score.d.ts
361
+ type RuleTier = "P0" | "P1" | "P2" | "P3";
362
+ interface RulePriority {
363
+ readonly priority: number | null;
364
+ readonly tier: RuleTier;
365
+ }
352
366
  interface ScoreResult {
353
367
  score: number;
354
368
  label: string;
369
+ readonly rules?: Readonly<Record<string, RulePriority>>;
355
370
  } //#endregion
356
371
  //#region src/types/diagnose.d.ts
357
372
  interface DiagnoseOptions {
@@ -365,6 +380,12 @@ interface DiagnoseOptions {
365
380
  * See that field's docs for the full contract.
366
381
  */
367
382
  respectInlineDisables?: boolean;
383
+ /**
384
+ * Per-call override for `ReactDoctorConfig.warnings`. See that field's
385
+ * docs — `"warning"`-severity diagnostics are hidden unless this (or
386
+ * the config) opts them back in.
387
+ */
388
+ warnings?: boolean;
368
389
  }
369
390
  interface DiagnoseResult {
370
391
  diagnostics: Diagnostic[];
@@ -404,6 +425,28 @@ interface InspectResult {
404
425
  skippedCheckReasons?: Record<string, string>;
405
426
  project: ProjectInfo;
406
427
  elapsedMilliseconds: number;
428
+ /**
429
+ * Number of files the scan reported. Distinct from
430
+ * `project.sourceFileCount` in diff / staged mode (where only changed
431
+ * files are scanned). Optional so non-orchestrator constructors keep
432
+ * working; the multi-project summary falls back to
433
+ * `project.sourceFileCount` when absent.
434
+ */
435
+ scannedFileCount?: number;
436
+ /**
437
+ * Absolute paths of every file the scan considered. Lets the
438
+ * multi-project summary count UNIQUE files across projects instead of
439
+ * summing per-project counts, which double-counts shared files when one
440
+ * workspace package's tree is nested inside another's.
441
+ */
442
+ scannedFilePaths?: ReadonlyArray<string>;
443
+ /**
444
+ * Wall-clock duration of the scan phase, in milliseconds. Distinct
445
+ * from `elapsedMilliseconds` (which spans the full `inspect()` call
446
+ * including score fetch + rendering). Used by the multi-project
447
+ * summary to report combined scan time.
448
+ */
449
+ scanElapsedMilliseconds?: number;
407
450
  }
408
451
  /**
409
452
  * Options accepted by `inspect()`. Mixes two concern groups; ordered