react-doctor 0.2.14-dev.daef23c → 0.2.14-dev.e9e71bb
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 +48 -2
- package/dist/cli.js +2516 -402
- package/dist/index.d.ts +47 -9
- package/dist/index.js +631 -98
- package/dist/skills/doctor-explain/SKILL.md +75 -0
- package/dist/skills/react-doctor/SKILL.md +4 -0
- package/package.json +6 -2
package/dist/index.d.ts
CHANGED
|
@@ -5,13 +5,35 @@ import * as Cause from "effect/Cause";
|
|
|
5
5
|
//#region src/types/config.d.ts
|
|
6
6
|
type FailOnLevel = "error" | "warning" | "none";
|
|
7
7
|
interface ReactDoctorIgnoreOverride {
|
|
8
|
+
/** Glob patterns the override applies to (e.g. `["src/legacy/**"]`). */
|
|
8
9
|
files: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Rule keys to suppress for the matched files. Omit (or leave empty) to
|
|
12
|
+
* suppress every rule for those files.
|
|
13
|
+
*/
|
|
9
14
|
rules?: string[];
|
|
10
15
|
}
|
|
11
16
|
interface ReactDoctorIgnoreConfig {
|
|
17
|
+
/**
|
|
18
|
+
* Fully-qualified rule keys (`"<plugin>/<rule>"`) whose diagnostics are
|
|
19
|
+
* dropped AFTER linting. The rule still runs; its findings are filtered
|
|
20
|
+
* out. To stop a rule from running at all, set it to `"off"` in the
|
|
21
|
+
* top-level `rules` map instead. Prefer `react-doctor rules disable
|
|
22
|
+
* <rule>` to edit this safely.
|
|
23
|
+
*/
|
|
12
24
|
rules?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* Glob patterns whose files are excluded from scanning entirely (matched
|
|
27
|
+
* against paths relative to the scanned directory).
|
|
28
|
+
*/
|
|
13
29
|
files?: string[];
|
|
30
|
+
/** Per-path rule suppressions — narrower than the top-level `rules`/`files`. */
|
|
14
31
|
overrides?: ReactDoctorIgnoreOverride[];
|
|
32
|
+
/**
|
|
33
|
+
* Behavioral tags whose rules are disabled BEFORE linting, skipping a
|
|
34
|
+
* whole family at once (e.g. `["design", "test-noise", "migration-hint"]`).
|
|
35
|
+
* Prefer `react-doctor rules ignore-tag <tag>` to edit this safely.
|
|
36
|
+
*/
|
|
15
37
|
tags?: string[];
|
|
16
38
|
}
|
|
17
39
|
/**
|
|
@@ -100,11 +122,11 @@ interface ReactDoctorConfig {
|
|
|
100
122
|
deadCode?: boolean;
|
|
101
123
|
verbose?: boolean;
|
|
102
124
|
/**
|
|
103
|
-
* Whether to surface `"warning"`-severity diagnostics. Default: `
|
|
104
|
-
* —
|
|
105
|
-
*
|
|
125
|
+
* Whether to surface `"warning"`-severity diagnostics. Default: `true`
|
|
126
|
+
* — every warning reaches every surface (CLI, PR comment, score,
|
|
127
|
+
* `--fail-on`).
|
|
106
128
|
*
|
|
107
|
-
* Set to `
|
|
129
|
+
* Set to `false` to surface only `"error"`-severity findings. This is the
|
|
108
130
|
* master toggle and runs after per-rule / per-category severity
|
|
109
131
|
* overrides: a rule the user explicitly restamps to `"warn"` (via
|
|
110
132
|
* `rules` / `categories`) still shows even when `warnings` is `false`.
|
|
@@ -122,7 +144,7 @@ interface ReactDoctorConfig {
|
|
|
122
144
|
* the redirect is stable no matter where the CLI / `diagnose()` is
|
|
123
145
|
* run from. Absolute paths are used as-is.
|
|
124
146
|
*
|
|
125
|
-
* Typical use: a monorepo root holds the only `
|
|
147
|
+
* Typical use: a monorepo root holds the only `doctor.config.*`
|
|
126
148
|
* (so editor tooling and child commands all find it), but the React
|
|
127
149
|
* app lives in `apps/web`. Setting `"rootDir": "apps/web"` makes
|
|
128
150
|
* every invocation that loads this config scan that subproject
|
|
@@ -369,6 +391,22 @@ interface ProjectInfo {
|
|
|
369
391
|
* — no `rn-*` rules load for the project at all.
|
|
370
392
|
*/
|
|
371
393
|
hasReactNativeWorkspace: boolean;
|
|
394
|
+
/**
|
|
395
|
+
* The declared `expo` package version spec (e.g. `"~51.0.0"`), looked up
|
|
396
|
+
* in the project or any of its workspace packages, or `null` when `expo`
|
|
397
|
+
* isn't a dependency. Doubles as react-doctor's "is this an Expo project?"
|
|
398
|
+
* signal (`expoVersion !== null`) and its SDK-version source — the `expo`
|
|
399
|
+
* major tracks the Expo SDK release one-to-one — paralleling how
|
|
400
|
+
* `reactVersion` models the React runtime.
|
|
401
|
+
*
|
|
402
|
+
* Keyed off the dependency rather than `framework === "expo"` because
|
|
403
|
+
* `detectFramework` returns the first matching package, so a project
|
|
404
|
+
* declaring both `expo` and a web bundler (`vite` / `next`) classifies as
|
|
405
|
+
* the web framework yet is still an Expo project. Drives the `expo`
|
|
406
|
+
* capability in `buildCapabilities` (which gates every Expo-specific
|
|
407
|
+
* rule) and the ported expo-doctor checks.
|
|
408
|
+
*/
|
|
409
|
+
expoVersion: string | null;
|
|
372
410
|
/**
|
|
373
411
|
* `true` when the project (or any of its workspace packages) declares
|
|
374
412
|
* `react-native-reanimated`. Lets diagnostics surface reanimated's
|
|
@@ -404,8 +442,8 @@ interface DiagnoseOptions {
|
|
|
404
442
|
respectInlineDisables?: boolean;
|
|
405
443
|
/**
|
|
406
444
|
* Per-call override for `ReactDoctorConfig.warnings`. See that field's
|
|
407
|
-
* docs — `"warning"`-severity diagnostics
|
|
408
|
-
* the config) opts
|
|
445
|
+
* docs — `"warning"`-severity diagnostics surface by default unless this
|
|
446
|
+
* (or the config) opts out via `false`.
|
|
409
447
|
*/
|
|
410
448
|
warnings?: boolean;
|
|
411
449
|
}
|
|
@@ -428,7 +466,7 @@ interface DiagnoseResult {
|
|
|
428
466
|
* Scan options (`deadCode`, `lint`, etc.) are flat on the entry and
|
|
429
467
|
* layer on top of the global defaults — omitted fields fall through.
|
|
430
468
|
* `config` is a full `ReactDoctorConfig` override that replaces the
|
|
431
|
-
* on-disk `
|
|
469
|
+
* on-disk `doctor.config.*` for this project's scan.
|
|
432
470
|
*/
|
|
433
471
|
//#endregion
|
|
434
472
|
//#region src/types/inspect.d.ts
|
|
@@ -726,7 +764,7 @@ interface BuildJsonReportInput {
|
|
|
726
764
|
totalElapsedMilliseconds: number;
|
|
727
765
|
}
|
|
728
766
|
declare const buildJsonReport: (input: BuildJsonReportInput) => JsonReport; //#endregion
|
|
729
|
-
//#region src/
|
|
767
|
+
//#region src/build-skipped-checks.d.ts
|
|
730
768
|
//#endregion
|
|
731
769
|
//#region src/get-diff-files.d.ts
|
|
732
770
|
/**
|