react-doctor 0.2.0 → 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/README.md +66 -13
- package/dist/chunk-q7NCDQ7-.js +26 -0
- package/dist/cli.js +7785 -1527
- package/dist/dist-2B-kn9PW.js +17940 -0
- package/dist/dist-BPzE37C6.js +17940 -0
- package/dist/index.d.ts +29 -3
- package/dist/index.js +508 -230
- package/package.json +10 -16
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
1
2
|
//#region ../types/dist/index.d.ts
|
|
2
3
|
//#region src/config.d.ts
|
|
3
4
|
type FailOnLevel = "error" | "warning" | "none";
|
|
@@ -78,6 +79,14 @@ interface SurfaceControls {
|
|
|
78
79
|
interface ReactDoctorConfig {
|
|
79
80
|
ignore?: ReactDoctorIgnoreConfig;
|
|
80
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;
|
|
81
90
|
verbose?: boolean;
|
|
82
91
|
diff?: boolean | string;
|
|
83
92
|
failOn?: FailOnLevel;
|
|
@@ -284,6 +293,8 @@ interface ScoreResult {
|
|
|
284
293
|
//#region src/diagnose.d.ts
|
|
285
294
|
interface DiagnoseOptions {
|
|
286
295
|
lint?: boolean;
|
|
296
|
+
/** See `ReactDoctorConfig.deadCode`. Ignored in diff mode. */
|
|
297
|
+
deadCode?: boolean;
|
|
287
298
|
verbose?: boolean;
|
|
288
299
|
includePaths?: string[];
|
|
289
300
|
/**
|
|
@@ -295,6 +306,14 @@ interface DiagnoseOptions {
|
|
|
295
306
|
interface DiagnoseResult {
|
|
296
307
|
diagnostics: Diagnostic[];
|
|
297
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>;
|
|
298
317
|
project: ProjectInfo;
|
|
299
318
|
elapsedMilliseconds: number;
|
|
300
319
|
} //#endregion
|
|
@@ -318,7 +337,13 @@ interface InspectResult {
|
|
|
318
337
|
elapsedMilliseconds: number;
|
|
319
338
|
}
|
|
320
339
|
interface DiffInfo {
|
|
321
|
-
|
|
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;
|
|
322
347
|
baseBranch: string;
|
|
323
348
|
changedFiles: string[];
|
|
324
349
|
isCurrentChanges?: boolean;
|
|
@@ -326,7 +351,8 @@ interface DiffInfo {
|
|
|
326
351
|
type JsonReportMode = "full" | "diff" | "staged";
|
|
327
352
|
interface JsonReportDiffInfo {
|
|
328
353
|
baseBranch: string;
|
|
329
|
-
currentBranch
|
|
354
|
+
/** `null` when `HEAD` is detached — see `DiffInfo.currentBranch`. */
|
|
355
|
+
currentBranch: string | null;
|
|
330
356
|
changedFileCount: number;
|
|
331
357
|
isCurrentChanges: boolean;
|
|
332
358
|
}
|
|
@@ -401,7 +427,7 @@ declare class AmbiguousProjectError extends ReactDoctorError {
|
|
|
401
427
|
constructor(directory: string, candidates: readonly string[], options?: ErrorOptions);
|
|
402
428
|
}
|
|
403
429
|
declare const isReactDoctorError: (value: unknown) => value is ReactDoctorError; //#endregion
|
|
404
|
-
//#region src/utils/is-
|
|
430
|
+
//#region src/utils/is-directory.d.ts
|
|
405
431
|
//#endregion
|
|
406
432
|
//#region ../core/dist/index.d.ts
|
|
407
433
|
//#endregion
|