react-doctor 0.4.2 → 0.5.0-dev.cbb7975

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
@@ -118,10 +118,56 @@ interface SurfaceControls {
118
118
  /** Fully-qualified rule keys to exclude from this surface. */
119
119
  excludeRules?: string[];
120
120
  }
121
+ /**
122
+ * Configuration for the Socket.dev supply-chain score check (the
123
+ * `SupplyChain` service). Runs by default; set `enabled: false` to opt out
124
+ * (it performs one network request per direct dependency).
125
+ *
126
+ * Mirrors how Socket Firewall's free tier (`sfw`) works: each direct
127
+ * dependency's PURL is looked up against Socket's keyless
128
+ * `firewall-api.socket.dev/purl/<purl>` endpoint, which returns a
129
+ * supply-chain score (0–100 once normalized). A dependency scoring below
130
+ * `minScore` produces a diagnostic; at the default `severity: "error"` it
131
+ * fails the scan (non-zero CI exit), the same way an error-severity lint
132
+ * finding does.
133
+ */
134
+ interface SupplyChainConfig {
135
+ /**
136
+ * Whether to run the Socket supply-chain score check. Default: `true`.
137
+ * Set to `false` to opt out — the check performs one network request per
138
+ * direct dependency. It is always skipped in `--diff` / `--staged` mode
139
+ * and in editor scans regardless of this setting.
140
+ */
141
+ enabled?: boolean;
142
+ /**
143
+ * Minimum acceptable Socket score on a 0–100 scale. A direct dependency
144
+ * whose Socket `overall` score is below this is flagged. Default: `50`.
145
+ * Values outside `0..100` are clamped.
146
+ */
147
+ minScore?: number;
148
+ /**
149
+ * Severity for a below-threshold dependency. `"error"` (default) fails
150
+ * the scan at the standard `blocking: "error"` gate; `"warning"` keeps
151
+ * the finding advisory.
152
+ */
153
+ severity?: "error" | "warning";
154
+ /**
155
+ * Whether to score `devDependencies` in addition to `dependencies`.
156
+ * Default: `true`.
157
+ */
158
+ includeDevDependencies?: boolean;
159
+ }
121
160
  interface ReactDoctorConfig {
122
161
  $schema?: string;
123
162
  ignore?: ReactDoctorIgnoreConfig;
124
163
  lint?: boolean;
164
+ /**
165
+ * Socket.dev supply-chain score gate. Runs by default; set
166
+ * `supplyChain: { enabled: false }` to opt out. See {@link SupplyChainConfig}.
167
+ * Every direct dependency is scored against Socket's free PURL endpoint and
168
+ * a low score fails the scan (at the default `severity: "error"`).
169
+ */
170
+ supplyChain?: SupplyChainConfig;
125
171
  /**
126
172
  * Whether to run dead-code analysis (via `deslop-js`) alongside lint.
127
173
  * Reports unused files, unused exports, unused dependencies, and
@@ -487,6 +533,17 @@ interface ProjectInfo {
487
533
  * apply, instead of on every React Native project.
488
534
  */
489
535
  hasReanimated: boolean;
536
+ /**
537
+ * `true` when the project's `tsconfig.json` `compilerOptions.target` or
538
+ * `compilerOptions.lib` indicates the output environment predates ES2023
539
+ * (e.g. `target: "es2022"` or `lib: ["es2022"]`). Drives the `pre-es2023`
540
+ * capability in `buildCapabilities` so rules recommending ES2023-only
541
+ * methods (`toSorted`, `toReversed`, `toSpliced`, `with`, etc.) are
542
+ * silenced on projects that would get a type error or runtime crash.
543
+ * `false` when no tsconfig is found, when the target is ES2023+, or when
544
+ * the config is unparseable — the safe default is to keep the rule active.
545
+ */
546
+ isPreES2023Target: boolean;
490
547
  sourceFileCount: number;
491
548
  }
492
549
  //#endregion