react-doctor 0.4.1 → 0.4.2-dev.42c339f
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/LICENSE +1 -1
- package/README.md +6 -55
- package/dist/cli.js +930 -780
- package/dist/index.d.ts +11 -1
- package/dist/index.js +41 -4
- package/dist/lsp.js +34 -4
- package/package.json +7 -7
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -37,60 +37,11 @@ npx react-doctor@latest install
|
|
|
37
37
|
|
|
38
38
|
Works with Claude Code, Cursor, Codex, OpenCode, and many more.
|
|
39
39
|
|
|
40
|
-
### 3.
|
|
40
|
+
### 3. Run in CI
|
|
41
41
|
|
|
42
|
-
React Doctor
|
|
42
|
+
React Doctor CI (GitHub Actions) reviews every pull request automatically and reports only the issues your change introduced, not your existing backlog.
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
react-doctor experimental-lsp --stdio
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
> The editor language server is experimental — its protocol, caching, and diagnostics may change between releases, hence the `experimental-` prefix.
|
|
49
|
-
|
|
50
|
-
Companion extensions for VS Code/Cursor and Zed live under `packages/`; any other LSP client can run the command above directly over stdio.
|
|
51
|
-
|
|
52
|
-
### 4. Run in CI (GitHub Actions) for your team
|
|
53
|
-
|
|
54
|
-
[](https://github.com/marketplace/actions/react-doctor)
|
|
55
|
-
|
|
56
|
-
On a pull request the Action reports only the issues your change **introduced** — it scans the PR and the merge-base and reports the difference (like Codecov for coverage), leaving pre-existing findings alone. It posts inline review comments on the changed lines and a sticky summary with the new / fixed delta.
|
|
57
|
-
|
|
58
|
-
```yaml
|
|
59
|
-
name: React Doctor
|
|
60
|
-
|
|
61
|
-
on:
|
|
62
|
-
pull_request:
|
|
63
|
-
types: [opened, synchronize, reopened, ready_for_review]
|
|
64
|
-
|
|
65
|
-
permissions:
|
|
66
|
-
contents: read
|
|
67
|
-
pull-requests: write
|
|
68
|
-
issues: write
|
|
69
|
-
statuses: write # lets the action publish the score as a commit status
|
|
70
|
-
|
|
71
|
-
concurrency:
|
|
72
|
-
group: react-doctor-${{ github.event.pull_request.number || github.ref }}
|
|
73
|
-
cancel-in-progress: true
|
|
74
|
-
|
|
75
|
-
jobs:
|
|
76
|
-
react-doctor:
|
|
77
|
-
runs-on: ubuntu-latest
|
|
78
|
-
steps:
|
|
79
|
-
- uses: actions/checkout@v5
|
|
80
|
-
with:
|
|
81
|
-
fetch-depth: 0 # so React Doctor can diff against the merge-base for new-vs-existing
|
|
82
|
-
- uses: millionco/react-doctor@v2
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
`fetch-depth: 0` is recommended so the baseline comparison can read the base commit; without enough history the Action falls back to reporting every finding in the changed files.
|
|
86
|
-
|
|
87
|
-
`@v2` always resolves to the latest `v2.x` release of the Action. For hardened CI — recommended whenever the workflow is granted `pull-requests: write` — pin to a full commit SHA instead and let Dependabot or Renovate keep it current:
|
|
88
|
-
|
|
89
|
-
```yaml
|
|
90
|
-
- uses: millionco/react-doctor@75932719d11ef50e110eac01ce04acdc05fde074 # v2.0.1
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
[Add GitHub Action →](https://github.com/marketplace/actions/react-doctor)
|
|
44
|
+
[Add GitHub Action →](https://react.doctor/ci)
|
|
94
45
|
|
|
95
46
|
### 4. Configure rules in `doctor.config.ts`
|
|
96
47
|
|
|
@@ -98,14 +49,14 @@ Configure with a `doctor.config.ts` (or `.js`, `.mjs`, `.cjs`, `.json`, `.jsonc`
|
|
|
98
49
|
|
|
99
50
|
```ts
|
|
100
51
|
// doctor.config.ts
|
|
101
|
-
import
|
|
52
|
+
import { defineConfig } from "react-doctor/api";
|
|
102
53
|
|
|
103
|
-
export default {
|
|
54
|
+
export default defineConfig({
|
|
104
55
|
lint: true,
|
|
105
56
|
rules: {
|
|
106
57
|
"react-doctor/no-array-index-as-key": "off",
|
|
107
58
|
},
|
|
108
|
-
}
|
|
59
|
+
});
|
|
109
60
|
```
|
|
110
61
|
|
|
111
62
|
Prefer JSON? Use `doctor.config.json`:
|