react-doctor 0.2.14-dev.b9e9bcb → 0.2.14-dev.bdb9e36
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 +40 -2
- package/dist/cli.js +1811 -404
- package/dist/index.d.ts +30 -8
- package/dist/index.js +232 -60
- package/dist/skills/doctor-explain/SKILL.md +75 -0
- package/dist/skills/react-doctor/SKILL.md +4 -0
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -81,9 +81,23 @@ React Doctor scans the files changed in the pull request, emits inline annotatio
|
|
|
81
81
|
|
|
82
82
|
[Add GitHub Action →](https://github.com/marketplace/actions/react-doctor)
|
|
83
83
|
|
|
84
|
-
### 4. Configure rules in `
|
|
84
|
+
### 4. Configure rules in `doctor.config.ts`
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
Configure with a `doctor.config.ts` (or `.js`, `.mjs`, `.cjs`, `.json`, `.jsonc`) in your project root — or a `"reactDoctor"` key in `package.json`.
|
|
87
|
+
|
|
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):
|
|
87
101
|
|
|
88
102
|
```jsonc
|
|
89
103
|
{
|
|
@@ -92,6 +106,30 @@ Point the `$schema` key at `https://react.doctor/schema/config.json` to get auto
|
|
|
92
106
|
}
|
|
93
107
|
```
|
|
94
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
|
+
|
|
120
|
+
## Telemetry
|
|
121
|
+
|
|
122
|
+
The CLI reports crashes and basic run traces to [Sentry](https://sentry.io) to help us fix bugs. Events include the version, platform, Node version, how the CLI was invoked (which command, package manager, and whether it ran locally vs. CI vs. a coding agent), the detected project shape (framework, React version, TypeScript, project size — never the contents of your files), and de-minified stack traces.
|
|
123
|
+
|
|
124
|
+
Telemetry is **anonymized** before it leaves your machine: no IP address is collected, your hostname and machine name are stripped, your OS username is removed from every path (your home directory is replaced with `~`), captured local variables are dropped, and known secrets/API keys/emails are masked. No source code or diagnostic findings are sent.
|
|
125
|
+
|
|
126
|
+
Opt out at any time:
|
|
127
|
+
|
|
128
|
+
- `npx react-doctor@latest --no-score` disables Sentry entirely (crash reporting and tracing) for that run, alongside the hosted score API.
|
|
129
|
+
- `SENTRY_TRACES_SAMPLE_RATE=0` keeps crash reporting but turns off performance tracing.
|
|
130
|
+
|
|
131
|
+
Telemetry is also skipped automatically under test runs, and the programmatic `react-doctor/api` library never initializes Sentry. Advanced overrides: `SENTRY_DSN` (point at your own Sentry project), `SENTRY_ENVIRONMENT`, `SENTRY_RELEASE`, and `SENTRY_DEBUG=1`.
|
|
132
|
+
|
|
95
133
|
## Contributing
|
|
96
134
|
|
|
97
135
|
[Issues welcome!](https://github.com/millionco/react-doctor/issues)
|