react-doctor 0.3.0 → 0.4.0-dev.15bd9d8

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 CHANGED
@@ -37,11 +37,23 @@ npx react-doctor@latest install
37
37
 
38
38
  Works with Claude Code, Cursor, Codex, OpenCode, and many more.
39
39
 
40
- ### 3. Run in CI (GitHub Actions) for your team
40
+ ### 3. Use in your editor (LSP)
41
+
42
+ React Doctor ships an experimental language server, so diagnostics show up live as you type — underlined inline, with rich hovers and quick fixes — in VS Code, Cursor, Zed, Neovim, Sublime, Emacs, Helix, or any LSP client. The universal launch command is:
43
+
44
+ ```bash
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
41
53
 
42
54
  [![GitHub Action](https://img.shields.io/badge/GitHub%20Action-React%20Doctor-000000?style=flat&labelColor=000000&logo=githubactions&logoColor=white)](https://github.com/marketplace/actions/react-doctor)
43
55
 
44
- Add the reusable GitHub Action from Marketplace to scan every pull request, show inline annotations, and leave findings where reviewers already look.
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.
45
57
 
46
58
  ```yaml
47
59
  name: React Doctor
@@ -54,6 +66,7 @@ permissions:
54
66
  contents: read
55
67
  pull-requests: write
56
68
  issues: write
69
+ statuses: write # lets the action publish the score as a commit status
57
70
 
58
71
  concurrency:
59
72
  group: react-doctor-${{ github.event.pull_request.number || github.ref }}
@@ -64,13 +77,17 @@ jobs:
64
77
  runs-on: ubuntu-latest
65
78
  steps:
66
79
  - uses: actions/checkout@v5
67
- - uses: millionco/react-doctor@v1
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
68
83
  ```
69
84
 
70
- `@v1` always resolves to the latest `v1.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:
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:
71
88
 
72
89
  ```yaml
73
- - uses: millionco/react-doctor@b612664043a9be414166e3c6a69b355e39a8dcf4 # v1.1.1
90
+ - uses: millionco/react-doctor@75932719d11ef50e110eac01ce04acdc05fde074 # v2.0.1
74
91
  ```
75
92
 
76
93
  [Add GitHub Action →](https://github.com/marketplace/actions/react-doctor)
@@ -10,4 +10,12 @@ if (module.enableCompileCache && !process.env.NODE_DISABLE_COMPILE_CACHE) {
10
10
  }
11
11
  }
12
12
 
13
- await import("../dist/cli.js");
13
+ // Fast-path the (experimental) language server so it runs without the CLI's
14
+ // commander / prompts / ora layer, which would touch process.stdin before the
15
+ // LSP connection attaches and break the stdio transport.
16
+ if (process.argv[2] === "experimental-lsp") {
17
+ const { startLanguageServer } = await import("../dist/lsp.js");
18
+ startLanguageServer();
19
+ } else {
20
+ await import("../dist/cli.js");
21
+ }