react-doctor 0.2.0-beta.5 → 0.2.0
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 +100 -14
- package/dist/cli.js +2145 -187
- package/dist/index.d.ts +55 -0
- package/dist/index.js +2113 -153
- package/dist/skills/react-doctor/SKILL.md +4 -4
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,24 @@ interface ReactDoctorIgnoreConfig {
|
|
|
32
32
|
* still see the suggestion when they touch the file.
|
|
33
33
|
*/
|
|
34
34
|
type DiagnosticSurface = "cli" | "prComment" | "score" | "ciFailure";
|
|
35
|
+
/**
|
|
36
|
+
* Severity value accepted by the top-level `rules` and `categories`
|
|
37
|
+
* config fields. Exactly the same form ESLint and oxlint accept:
|
|
38
|
+
* `"off"` skips registration entirely (the rule never runs and
|
|
39
|
+
* never enters any surface); `"error"` / `"warn"` change the rule's
|
|
40
|
+
* registered severity.
|
|
41
|
+
*
|
|
42
|
+
* For visibility-only adjustments (silence on PR comments but keep
|
|
43
|
+
* on CLI / score), prefer `surfaces` instead — severity applies
|
|
44
|
+
* before lint runs and is the most aggressive control.
|
|
45
|
+
*/
|
|
46
|
+
type RuleSeverityOverride = "error" | "warn" | "off";
|
|
47
|
+
/**
|
|
48
|
+
* Internal shape consumed by `resolveRuleSeverityOverride` and
|
|
49
|
+
* `applySeverityControls`. Assembled at runtime from the top-level
|
|
50
|
+
* `rules` and `categories` fields on `ReactDoctorConfig`. Per-rule
|
|
51
|
+
* wins over per-category when both match the same diagnostic.
|
|
52
|
+
*/
|
|
35
53
|
interface SurfaceControls {
|
|
36
54
|
/**
|
|
37
55
|
* Tag names whose diagnostics should be force-included on the surface,
|
|
@@ -176,6 +194,43 @@ interface ReactDoctorConfig {
|
|
|
176
194
|
* score or PR-comment surface.
|
|
177
195
|
*/
|
|
178
196
|
surfaces?: Partial<Record<DiagnosticSurface, SurfaceControls>>;
|
|
197
|
+
/**
|
|
198
|
+
* Per-rule severity map — the exact ESLint / oxlint top-level
|
|
199
|
+
* `rules` field. Keys are fully-qualified rule keys
|
|
200
|
+
* (`"<plugin>/<rule>"`, e.g. `"react-doctor/no-array-index-as-key"`),
|
|
201
|
+
* values are `"error" | "warn" | "off"`.
|
|
202
|
+
*
|
|
203
|
+
* `"off"` skips registration in the generated lint config so the
|
|
204
|
+
* rule never runs; `"error"` / `"warn"` re-stamp the registered
|
|
205
|
+
* severity and the post-lint diagnostic, so downstream consumers
|
|
206
|
+
* (`--fail-on`, the score, the printed list) all see the
|
|
207
|
+
* user-chosen severity.
|
|
208
|
+
*
|
|
209
|
+
* For visibility-only changes (silence on PR comments but keep on
|
|
210
|
+
* CLI / score), prefer `surfaces` instead. Most specific control
|
|
211
|
+
* wins: `rules` > `categories` > `tags`.
|
|
212
|
+
*
|
|
213
|
+
* ```json
|
|
214
|
+
* { "rules": { "react-doctor/no-array-index-as-key": "error" } }
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
rules?: Record<string, RuleSeverityOverride>;
|
|
218
|
+
/**
|
|
219
|
+
* Per-category severity map. Mirrors oxlint's top-level
|
|
220
|
+
* `categories` field, but keyed by React Doctor's display
|
|
221
|
+
* categories (`"Server"`, `"React Native"`, `"Architecture"`,
|
|
222
|
+
* `"Bundle Size"`, `"State & Effects"`, `"Security"`,
|
|
223
|
+
* `"Accessibility"`, `"Performance"`, `"Correctness"`, …).
|
|
224
|
+
*
|
|
225
|
+
* ```json
|
|
226
|
+
* { "categories": { "React Native": "warn", "Server": "off" } }
|
|
227
|
+
* ```
|
|
228
|
+
*
|
|
229
|
+
* To silence a whole tag-defined rule family (e.g. `"design"`,
|
|
230
|
+
* `"test-noise"`, `"migration-hint"`) that doesn't align with a
|
|
231
|
+
* single category, use `ignore.tags` instead.
|
|
232
|
+
*/
|
|
233
|
+
categories?: Record<string, RuleSeverityOverride>;
|
|
179
234
|
} //#endregion
|
|
180
235
|
//#region src/diagnostic.d.ts
|
|
181
236
|
interface Diagnostic {
|