react-doctor 0.3.0 → 0.4.0-dev.f75ec7a

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
@@ -64,9 +76,13 @@ jobs:
64
76
  runs-on: ubuntu-latest
65
77
  steps:
66
78
  - uses: actions/checkout@v5
79
+ with:
80
+ fetch-depth: 0 # so React Doctor can diff against the merge-base for new-vs-existing
67
81
  - uses: millionco/react-doctor@v1
68
82
  ```
69
83
 
84
+ `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.
85
+
70
86
  `@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:
71
87
 
72
88
  ```yaml
@@ -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
+ }