react-doctor 0.2.14-dev.8b313ba → 0.2.14-dev.9777f1a

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
@@ -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
  /**
@@ -53,6 +75,14 @@ type RuleSeverityOverride = "error" | "warn" | "off";
53
75
  * `rules` and `categories` fields on `ReactDoctorConfig`. Per-rule
54
76
  * wins over per-category when both match the same diagnostic.
55
77
  */
78
+ /**
79
+ * Closed set of severity buckets. Spelled out (rather than
80
+ * `Record<string, …>`) so an unknown/typo'd bucket key is a type error
81
+ * instead of a silent no-op.
82
+ */
83
+ interface SeverityBuckets {
84
+ "compiler-cleanup"?: RuleSeverityOverride;
85
+ }
56
86
  interface SurfaceControls {
57
87
  /**
58
88
  * Tag names whose diagnostics should be force-included on the surface,
@@ -92,11 +122,11 @@ interface ReactDoctorConfig {
92
122
  deadCode?: boolean;
93
123
  verbose?: boolean;
94
124
  /**
95
- * Whether to surface `"warning"`-severity diagnostics. Default: `false`
96
- * — only `"error"`-severity findings reach any surface (CLI, PR comment,
97
- * score, `--fail-on`).
125
+ * Whether to surface `"warning"`-severity diagnostics. Default: `true`
126
+ * — every warning reaches every surface (CLI, PR comment, score,
127
+ * `--fail-on`).
98
128
  *
99
- * Set to `true` to surface every warning on every surface. This is the
129
+ * Set to `false` to surface only `"error"`-severity findings. This is the
100
130
  * master toggle and runs after per-rule / per-category severity
101
131
  * overrides: a rule the user explicitly restamps to `"warn"` (via
102
132
  * `rules` / `categories`) still shows even when `warnings` is `false`.
@@ -114,7 +144,7 @@ interface ReactDoctorConfig {
114
144
  * the redirect is stable no matter where the CLI / `diagnose()` is
115
145
  * run from. Absolute paths are used as-is.
116
146
  *
117
- * Typical use: a monorepo root holds the only `react-doctor.config.json`
147
+ * Typical use: a monorepo root holds the only `doctor.config.*`
118
148
  * (so editor tooling and child commands all find it), but the React
119
149
  * app lives in `apps/web`. Setting `"rootDir": "apps/web"` makes
120
150
  * every invocation that loads this config scan that subproject
@@ -253,6 +283,20 @@ interface ReactDoctorConfig {
253
283
  * single category, use `ignore.tags` instead.
254
284
  */
255
285
  categories?: Record<string, RuleSeverityOverride>;
286
+ /**
287
+ * Per-bucket severity map. Buckets are curated rule families with a
288
+ * shared gating story (not categories). Today the only bucket is
289
+ * `"compiler-cleanup"`: the redundant-memoization rule
290
+ * (`react-compiler-no-manual-memoization`) that ships as a warning once
291
+ * React Compiler is detected. Set it to `"error"` to re-enable strictness.
292
+ *
293
+ * ```json
294
+ * { "buckets": { "compiler-cleanup": "error" } }
295
+ * ```
296
+ *
297
+ * A per-rule override in `rules` still wins over a bucket entry.
298
+ */
299
+ buckets?: SeverityBuckets;
256
300
  /**
257
301
  * User-defined oxlint plugins to load alongside the built-in
258
302
  * `react-doctor` plugin. Each entry is either:
@@ -347,6 +391,22 @@ interface ProjectInfo {
347
391
  * — no `rn-*` rules load for the project at all.
348
392
  */
349
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;
350
410
  /**
351
411
  * `true` when the project (or any of its workspace packages) declares
352
412
  * `react-native-reanimated`. Lets diagnostics surface reanimated's
@@ -382,8 +442,8 @@ interface DiagnoseOptions {
382
442
  respectInlineDisables?: boolean;
383
443
  /**
384
444
  * 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.
445
+ * docs — `"warning"`-severity diagnostics surface by default unless this
446
+ * (or the config) opts out via `false`.
387
447
  */
388
448
  warnings?: boolean;
389
449
  }
@@ -406,7 +466,7 @@ interface DiagnoseResult {
406
466
  * Scan options (`deadCode`, `lint`, etc.) are flat on the entry and
407
467
  * layer on top of the global defaults — omitted fields fall through.
408
468
  * `config` is a full `ReactDoctorConfig` override that replaces the
409
- * on-disk `react-doctor.config.json` for this project's scan.
469
+ * on-disk `doctor.config.*` for this project's scan.
410
470
  */
411
471
  //#endregion
412
472
  //#region src/types/inspect.d.ts
@@ -704,7 +764,7 @@ interface BuildJsonReportInput {
704
764
  totalElapsedMilliseconds: number;
705
765
  }
706
766
  declare const buildJsonReport: (input: BuildJsonReportInput) => JsonReport; //#endregion
707
- //#region src/can-oxlint-extend-config.d.ts
767
+ //#region src/build-skipped-checks.d.ts
708
768
  //#endregion
709
769
  //#region src/get-diff-files.d.ts
710
770
  /**