Skip to content

Commit 36596ae

Browse files
committed
chore(claude): add 'inclusive language' rule to CLAUDE.md
Codifies the substitution table for whitelist/blacklist/master/etc. Allowlist/denylist/main aren't euphemisms — they're more accurate descriptions of what the lists do. Carves out exceptions for third-party APIs and vendored upstream sources where renaming would break the boundary.
1 parent b88ecb0 commit 36596ae

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,28 @@ When in doubt, sort. The cost of a sorted list that didn't need to be is approxi
6969

7070
When you spot duplication, the answer is never "update both" — the answer is "delete one and import the other." Fix the architecture, not the symptom.
7171

72+
### Inclusive Language
73+
74+
Use precise, neutral terms over historical metaphors that imply hierarchy or exclusion. The substitutes are not euphemisms — they're more *accurate* (a list of allowed values genuinely is an "allowlist"; "whitelist" is a metaphor that hides what the list does).
75+
76+
| Replace | With |
77+
| ---------------------------------------- | ----------------------------------------------------- |
78+
| `whitelist` / `whitelisted` | `allowlist` / `allowed` / `allowlisted` |
79+
| `blacklist` / `blacklisted` | `denylist` / `denied` / `blocklisted` / `blocked` |
80+
| `master` (branch, process, copy) | `main` (branch); `primary` / `controller` (process) |
81+
| `slave` | `replica`, `worker`, `secondary`, `follower` |
82+
| `grandfathered` | `legacy`, `pre-existing`, `exempted` |
83+
| `sanity check` | `quick check`, `confidence check`, `smoke test` |
84+
| `dummy` (placeholder) | `placeholder`, `stub` |
85+
86+
Apply across **code** (identifiers, comments, string literals), **docs** (READMEs, CLAUDE.md, markdown), **config files** (YAML, JSON), **commit messages**, **PR titles/descriptions**, and **CI logs** you control.
87+
88+
Two exceptions where the legacy term must remain (because changing it breaks something external):
89+
- **Third-party APIs / upstream code**: when interfacing with an external API field literally named `whitelist`, keep the field name; rename your local variable. E.g. `const allowedDomains = response.whitelist`.
90+
- **Vendored upstream sources**: don't rewrite vendored code (`vendor/**`, `upstream/**`, `**/fixtures/**`). Patch around it if needed.
91+
92+
When you encounter a legacy term during unrelated work, fix it inline — don't defer.
93+
7294
### Promise.race in loops
7395

7496
**NEVER re-race the same pool of promises across loop iterations.** Each call to `Promise.race([A, B, ...])` attaches fresh `.then` handlers to every arm; a promise that survives N iterations accumulates N handler sets. See [nodejs/node#17469](https://github.com/nodejs/node/issues/17469) and `@watchable/unpromise`.

0 commit comments

Comments
 (0)