react-doctor 0.2.1 → 0.2.2

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
@@ -79,6 +79,14 @@ interface SurfaceControls {
79
79
  interface ReactDoctorConfig {
80
80
  ignore?: ReactDoctorIgnoreConfig;
81
81
  lint?: boolean;
82
+ /**
83
+ * Whether to run dead-code analysis (via `deslop-js`) alongside lint.
84
+ * Reports unused files, unused exports, unused dependencies, and
85
+ * circular imports under the "Dead Code" category. Default: `true`.
86
+ * Always skipped in `--diff` / `--staged` modes because reachability
87
+ * is a whole-project property.
88
+ */
89
+ deadCode?: boolean;
82
90
  verbose?: boolean;
83
91
  diff?: boolean | string;
84
92
  failOn?: FailOnLevel;
@@ -285,6 +293,8 @@ interface ScoreResult {
285
293
  //#region src/diagnose.d.ts
286
294
  interface DiagnoseOptions {
287
295
  lint?: boolean;
296
+ /** See `ReactDoctorConfig.deadCode`. Ignored in diff mode. */
297
+ deadCode?: boolean;
288
298
  verbose?: boolean;
289
299
  includePaths?: string[];
290
300
  /**
@@ -296,6 +306,14 @@ interface DiagnoseOptions {
296
306
  interface DiagnoseResult {
297
307
  diagnostics: Diagnostic[];
298
308
  score: ScoreResult | null;
309
+ /**
310
+ * Checks that did not run to completion (e.g. `"dead-code"` when the
311
+ * `deslop-js` native binding crashed). Empty when everything ran.
312
+ * Mirrors `InspectResult.skippedChecks`.
313
+ */
314
+ skippedChecks: string[];
315
+ /** See `InspectResult.skippedCheckReasons`. */
316
+ skippedCheckReasons?: Record<string, string>;
299
317
  project: ProjectInfo;
300
318
  elapsedMilliseconds: number;
301
319
  } //#endregion
@@ -319,7 +337,13 @@ interface InspectResult {
319
337
  elapsedMilliseconds: number;
320
338
  }
321
339
  interface DiffInfo {
322
- currentBranch: string;
340
+ /**
341
+ * `null` when `HEAD` is detached (e.g. GitHub Actions `pull_request`
342
+ * runs that check out `refs/pull/N/merge`). The diff itself still
343
+ * resolves via `git merge-base <base> HEAD`; callers should render
344
+ * this case as `"(detached HEAD)"` or similar.
345
+ */
346
+ currentBranch: string | null;
323
347
  baseBranch: string;
324
348
  changedFiles: string[];
325
349
  isCurrentChanges?: boolean;
@@ -327,7 +351,8 @@ interface DiffInfo {
327
351
  type JsonReportMode = "full" | "diff" | "staged";
328
352
  interface JsonReportDiffInfo {
329
353
  baseBranch: string;
330
- currentBranch: string;
354
+ /** `null` when `HEAD` is detached — see `DiffInfo.currentBranch`. */
355
+ currentBranch: string | null;
331
356
  changedFileCount: number;
332
357
  isCurrentChanges: boolean;
333
358
  }