react-doctor 0.2.14-dev.4bc8a73 → 0.2.14-dev.5976266
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 +35 -2
- package/dist/cli.js +1419 -163
- package/dist/index.d.ts +31 -9
- package/dist/index.js +233 -85
- package/dist/skills/doctor-explain/SKILL.md +75 -0
- package/dist/skills/react-doctor/SKILL.md +4 -0
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -27,6 +27,14 @@ npx react-doctor@latest
|
|
|
27
27
|
|
|
28
28
|
https://github.com/user-attachments/assets/07cc88d9-9589-44c3-aa73-5d603cb1c570
|
|
29
29
|
|
|
30
|
+
On a large repo, add `--experimental-parallel` to fan the scan out across your CPU cores:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx react-doctor@latest --experimental-parallel
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
React Doctor's rules run as oxlint JS plugins, which are single-threaded per process, so the scan scales nearly linearly with the number of worker processes — typically 3–4x faster on large codebases. Pass `--experimental-parallel <n>` to cap the worker count, or set `REACT_DOCTOR_PARALLEL=<n>` (handy in CI). Diagnostics are identical to a serial run.
|
|
37
|
+
|
|
30
38
|
### 2. Install for agents
|
|
31
39
|
|
|
32
40
|
Once you have an audit, you can install the skill for your coding agent to learn from the issues and fix them in the future.
|
|
@@ -73,9 +81,23 @@ React Doctor scans the files changed in the pull request, emits inline annotatio
|
|
|
73
81
|
|
|
74
82
|
[Add GitHub Action →](https://github.com/marketplace/actions/react-doctor)
|
|
75
83
|
|
|
76
|
-
### 4. Configure rules in `
|
|
84
|
+
### 4. Configure rules in `doctor.config.ts`
|
|
85
|
+
|
|
86
|
+
Configure with a `doctor.config.ts` (or `.js`, `.mjs`, `.cjs`, `.json`, `.jsonc`) in your project root — or a `"reactDoctor"` key in `package.json`.
|
|
77
87
|
|
|
78
|
-
|
|
88
|
+
```ts
|
|
89
|
+
// doctor.config.ts
|
|
90
|
+
import type { ReactDoctorConfig } from "react-doctor/api";
|
|
91
|
+
|
|
92
|
+
export default {
|
|
93
|
+
lint: true,
|
|
94
|
+
rules: {
|
|
95
|
+
"react-doctor/no-array-index-as-key": "off",
|
|
96
|
+
},
|
|
97
|
+
} satisfies ReactDoctorConfig;
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Prefer JSON? Use `doctor.config.json` and point `$schema` at `https://react.doctor/schema/config.json` for autocomplete, hover docs, and typo warnings in any editor that understands JSON Schema (comments and trailing commas are allowed):
|
|
79
101
|
|
|
80
102
|
```jsonc
|
|
81
103
|
{
|
|
@@ -84,6 +106,17 @@ Point the `$schema` key at `https://react.doctor/schema/config.json` to get auto
|
|
|
84
106
|
}
|
|
85
107
|
```
|
|
86
108
|
|
|
109
|
+
Don't hand-edit if you'd rather not — the `rules` subcommands list, explain, and configure rules for you (they edit your `doctor.config.*` in place — including TS/JS, preserving formatting — or `package.json#reactDoctor`):
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
npx react-doctor@latest rules list # every rule + its effective severity
|
|
113
|
+
npx react-doctor@latest rules explain <rule> # why a rule matters and how to tune it
|
|
114
|
+
npx react-doctor@latest rules disable <rule> # turn a rule off
|
|
115
|
+
npx react-doctor@latest rules set <rule> warn # off | warn | error
|
|
116
|
+
npx react-doctor@latest rules category "React Native" off
|
|
117
|
+
npx react-doctor@latest rules ignore-tag design # skip a whole rule family
|
|
118
|
+
```
|
|
119
|
+
|
|
87
120
|
## Contributing
|
|
88
121
|
|
|
89
122
|
[Issues welcome!](https://github.com/millionco/react-doctor/issues)
|