Skip to content

Commit 4f8155e

Browse files
committed
docs: fix inconsistencies and omissions in internal docs
1 parent 4bff07e commit 4f8155e

4 files changed

Lines changed: 14 additions & 12 deletions

File tree

docs/rule-feature-system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const RULE_FEATURES = ["EXP"]; // static-components: experimental detection
4848

4949
## How Features Drive Presets
5050

51-
Feature metadata is the source of truth; preset files are maintained manually. The `scripts/20-check-rules.ts` script (run via `node --run check:rules`) verifies config consistency—registered rules are accounted for, config keys are valid, and preset hierarchies hold—but it does not check `RULE_FEATURES` flags. Keeping `disable-type-checked` and `disable-experimental` aligned with `RULE_FEATURES` is currently a manual step.
51+
Feature metadata is the source of truth for badges and categorization, but the preset files themselves are maintained manually. The `scripts/20-check-rules.ts` script (run via `node --run check:rules`) verifies config consistency—registered rules are accounted for, config keys are valid, and preset hierarchies hold—but it does not check `RULE_FEATURES` flags. Keeping `disable-type-checked` and `disable-experimental` aligned with `RULE_FEATURES` is currently a manual step.
5252

5353
Rules marked `TSC` are disabled in `disable-type-checked.ts`:
5454

docs/rule-implementation-patterns-term-based.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function create(context: RuleContext<MessageID, []>): RuleListener {
2525

2626
Used by: `no-access-state-in-setstate`, `no-class-component`, `no-component-will-*`, `no-create-ref`, `no-forward-ref`, `no-missing-context-display-name`, `no-misused-capture-owner-stack`, `no-set-state-in-component-*`, `no-unsafe-component-will-*`, `no-use-context`, `use-memo`, `context-name`, `id-name`, `ref-name`, `no-leaked-timeout`, `no-leaked-interval`, `no-leaked-resize-observer`, `no-leaked-intersection-observer`, `no-leaked-fetch` (first check), `no-leaked-event-listener` (first check).
2727

28-
Rules that currently omit the text precheck but still use term-based visitors: `no-children-count`, `no-children-for-each`, `no-children-only`, `no-children-to-array`, `no-direct-mutation-state`.
28+
Rules that currently omit the text precheck but still use term-based visitors: `no-children-count`, `no-children-for-each`, `no-children-map`, `no-children-only`, `no-children-to-array`, `no-clone-element`, `no-direct-mutation-state`.
2929

3030
### Multi-term check
3131

docs/rule-relations-table.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@
4747
| `react-x/no-duplicate-key` | `react-x/no-array-index-key` | Disallows using an item's index in the array as its key |
4848
| `react-x/no-duplicate-key` | `react-x/no-implicit-key` | Prevents implicitly passing the `key` prop to components |
4949
| `react-x/no-duplicate-key` | `react-x/no-missing-key` | Disallows missing `key` on items in list rendering |
50-
| `react-x/no-implicit-children` | `react-x/no-implicit-key` | Prevents implicitly passing the `key` prop to components. |
51-
| `react-x/no-implicit-children` | `react-x/no-implicit-ref` | Prevents implicitly passing the `ref` prop to components. |
52-
| `react-x/no-implicit-key` | `react-x/no-implicit-children` | Prevents implicitly passing the `children` prop to components. |
53-
| `react-x/no-implicit-key` | `react-x/no-implicit-ref` | Prevents implicitly passing the `ref` prop to components. |
54-
| `react-x/no-implicit-ref` | `react-x/no-implicit-children` | Prevents implicitly passing the `children` prop to components. |
55-
| `react-x/no-implicit-ref` | `react-x/no-implicit-key` | Prevents implicitly passing the `key` prop to components. |
50+
| `react-x/no-implicit-children` | `react-x/no-implicit-key` | Prevents implicitly passing the `key` prop to components |
51+
| `react-x/no-implicit-children` | `react-x/no-implicit-ref` | Prevents implicitly passing the `ref` prop to components |
52+
| `react-x/no-implicit-key` | `react-x/no-implicit-children` | Prevents implicitly passing the `children` prop to components |
53+
| `react-x/no-implicit-key` | `react-x/no-implicit-ref` | Prevents implicitly passing the `ref` prop to components |
54+
| `react-x/no-implicit-ref` | `react-x/no-implicit-children` | Prevents implicitly passing the `children` prop to components |
55+
| `react-x/no-implicit-ref` | `react-x/no-implicit-key` | Prevents implicitly passing the `key` prop to components |
5656
| `react-x/no-missing-component-display-name` | `react-x/no-missing-context-display-name` | Enforces that all contexts have a `displayName` that can be used in DevTools |
5757
| `react-x/no-missing-context-display-name` | `react-x/no-missing-component-display-name` | Enforces that all components have a `displayName` that can be used in DevTools |
5858
| `react-x/no-missing-key` | `react-x/no-array-index-key` | Disallows using an item's index in the array as its key |
5959
| `react-x/no-missing-key` | `react-x/no-duplicate-key` | Prevents duplicate `key` props on sibling elements when rendering lists |
6060
| `react-x/no-missing-key` | `react-x/no-implicit-key` | Prevents implicitly passing the `key` prop to components |
61-
| `react-x/no-nested-component-definitions` | `react-x/no-nested-lazy-component-declarations` | Disallows nesting lazy component declarations inside other components |
61+
| `react-x/no-nested-component-definitions` | `react-x/no-nested-lazy-component-declarations` | Disallows nesting lazy component declarations inside other components or hooks |
6262
| `react-x/no-nested-component-definitions` | `react-x/static-components` | Validates that components are static, not recreated every render |
6363
| `react-x/no-nested-lazy-component-declarations` | `react-x/no-nested-component-definitions` | Disallows nesting component definitions inside other components |
6464
| `react-x/no-nested-lazy-component-declarations` | `react-x/static-components` | Validates that components are static, not recreated every render |

docs/rule-rename-checklist.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Checklist for renaming or moving rules in `eslint-plugin-react-x` and `@eslint-r
99
- [ ] Rename `src/rules/<old-name>/<old-name>.ts``src/rules/<new-name>/<new-name>.ts`
1010
- [ ] Rename `src/rules/<old-name>/<old-name>.spec.ts``src/rules/<new-name>/<new-name>.spec.ts`
1111
- [ ] Rename `src/rules/<old-name>/<old-name>.mdx``src/rules/<new-name>/<new-name>.mdx`
12+
- [ ] Rename `src/rules/<old-name>/CHANGELOG.md``src/rules/<new-name>/CHANGELOG.md`
1213

1314
### A2. Rule Implementation
1415

@@ -57,7 +58,7 @@ Checklist for renaming or moving rules in `eslint-plugin-react-x` and `@eslint-r
5758

5859
- [ ] `pnpm tsc --noEmit`
5960
- [ ] `pnpm vitest run src/rules/<new-name>/<new-name>.spec.ts`
60-
- [ ] `grep -r "<old-name>" packages/` — no leftover references
61+
- [ ] `grep -r --exclude-dir=node_modules --exclude-dir=dist "<old-name>" plugins/ packages/` — no leftover references
6162

6263
---
6364

@@ -81,6 +82,7 @@ Checklist for renaming or moving rules in `eslint-plugin-react-x` and `@eslint-r
8182
- Copy tests from the source plugin.
8283
- Update the import: `import rule, { RULE_NAME } from "./<rule-name>/<rule-name>";`.
8384
- [ ] Create `src/rules/<rule-name>/<rule-name>.mdx` following the template below.
85+
- [ ] Create `src/rules/<rule-name>/CHANGELOG.md` (copy from the source plugin or start fresh).
8486

8587
### B3. Plugin Registration (`eslint-plugin-react-x/src/plugin.ts`)
8688

@@ -99,7 +101,7 @@ Checklist for renaming or moving rules in `eslint-plugin-react-x` and `@eslint-r
99101

100102
- [ ] Remove the import and `rules` map entry from the source plugin's `src/plugin.ts`.
101103
- [ ] Remove the rule key from the source plugin's configs.
102-
- [ ] Keep or delete the original `.ts` / `.spec.ts` / `.mdx` files as appropriate.
104+
- [ ] Keep or delete the original `.ts` / `.spec.ts` / `.mdx` / `CHANGELOG.md` files as appropriate.
103105

104106
### B7. CHANGELOG
105107

@@ -111,7 +113,7 @@ Checklist for renaming or moving rules in `eslint-plugin-react-x` and `@eslint-r
111113

112114
- [ ] `pnpm tsc --noEmit` in all affected packages.
113115
- [ ] `pnpm vitest run src/rules/<rule-name>/<rule-name>.spec.ts`
114-
- [ ] `grep -r "react-<source>/<rule-name>" packages/`no stale references
116+
- [ ] `grep -r --exclude-dir=node_modules --exclude-dir=dist "react-<source>/<rule-name>" plugins/ packages/`no stale references
115117

116118
---
117119

0 commit comments

Comments
 (0)