oxlint-plugin-react-doctor 0.9.12-dev.a2b460d → 0.9.12-dev.bd08406
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 +47 -2
- package/dist/capability-D9W-G7Ci.js +31 -0
- package/dist/core.d.ts +1090 -2
- package/dist/core.js +2 -2
- package/dist/index.d.ts +25880 -360
- package/dist/index.js +12 -12
- package/dist/react-native-dependency-names-waW0owVD.d.ts +333 -0
- package/package.json +2 -2
- package/dist/capability-BwQbtKnB.js +0 -31
- package/dist/core-C9jdAHos.d.ts +0 -1372
package/README.md
CHANGED
|
@@ -61,9 +61,54 @@ the package's root entry.
|
|
|
61
61
|
|
|
62
62
|
## Available rules
|
|
63
63
|
|
|
64
|
-
The full rule list lives in [`rule-registry.ts`](https://github.com/millionco/react-doctor/blob/main/packages/oxlint-plugin-react-doctor/src/plugin/rule-registry.ts).
|
|
64
|
+
The full rule list lives in [`rule-registry.ts`](https://github.com/millionco/react-doctor/blob/main/packages/oxlint-plugin-react-doctor/src/plugin/rule-registry.ts). Rules exported by this package use the `react-doctor/*` namespace.
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
### Choose a runner for each diagnostic
|
|
67
|
+
|
|
68
|
+
Standalone Oxlint runs rules that inspect one source file. The React Doctor CLI also runs whole-project and package analyzers.
|
|
69
|
+
|
|
70
|
+
| Diagnostic source | Standalone Oxlint | Runner |
|
|
71
|
+
| --------------------------------------------------------------------------------------------- | ----------------- | ---------------------------------------------------------------- |
|
|
72
|
+
| `react-doctor/*` rules with per-file visitors | Yes | Configure them under `rules` as shown above |
|
|
73
|
+
| Project rules such as `react-doctor/circular-dependency` and `react-doctor/unused-dependency` | No | Run the React Doctor CLI |
|
|
74
|
+
| `deslop/*` diagnostics | No | Run the React Doctor CLI |
|
|
75
|
+
| `socket/*` diagnostics | No | Run the React Doctor CLI |
|
|
76
|
+
| `react-hooks-js/*` React Compiler diagnostics | Separate plugin | Register `eslint-plugin-react-hooks` or run the React Doctor CLI |
|
|
77
|
+
|
|
78
|
+
The `deslop/*` names are CLI output aliases for project rules. These rules need the complete dependency graph, so their plugin entries have no per-file visitors. The `socket/*` diagnostics need package and supply-chain data. Neither prefix names an Oxlint plugin exported by this package.
|
|
79
|
+
|
|
80
|
+
Rules in the `security-scan` bucket also require a project-wide file scan. They register metadata here but do nothing under standalone Oxlint or ESLint. The [React Doctor CLI](https://npmjs.com/package/react-doctor) executes them during its whole-tree scan.
|
|
81
|
+
|
|
82
|
+
### Run React Compiler diagnostics in standalone Oxlint
|
|
83
|
+
|
|
84
|
+
React Doctor loads React Compiler diagnostics from `eslint-plugin-react-hooks` when it detects the compiler. To use them in standalone Oxlint, install and register that plugin:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm install --save-dev eslint-plugin-react-hooks
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Add both plugins to `.oxlintrc.json`. The `react-compiler` capability enables compiler-specific React Doctor cleanup rules:
|
|
91
|
+
|
|
92
|
+
```jsonc
|
|
93
|
+
{
|
|
94
|
+
"jsPlugins": [
|
|
95
|
+
{ "name": "react-doctor", "specifier": "oxlint-plugin-react-doctor" },
|
|
96
|
+
{ "name": "react-hooks-js", "specifier": "eslint-plugin-react-hooks" },
|
|
97
|
+
],
|
|
98
|
+
"settings": {
|
|
99
|
+
"react-doctor": {
|
|
100
|
+
"capabilities": ["react-compiler"],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
"rules": {
|
|
104
|
+
"react-doctor/react-compiler-no-manual-memoization": "warn",
|
|
105
|
+
"react-hooks-js/immutability": "error",
|
|
106
|
+
"react-hooks-js/refs": "error",
|
|
107
|
+
},
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The `react-hooks-js` namespace is the alias React Doctor uses for the external plugin. It is not exported by `oxlint-plugin-react-doctor`.
|
|
67
112
|
|
|
68
113
|
Each rule can be set to `"error"`, `"warn"`, or `"off"`:
|
|
69
114
|
|