@codelaw/rules-react · codelaw-rules-react
codelaw's React rules — one of codelaw's first-party rule packs
(SR-RULE-PACKS). The
same files ship on npm as @codelaw/rules-react and on PyPI as codelaw-rules-react.
# codelaw.toml
extends = ["codelaw:js/recommended", "codelaw:react/recommended"]
preview = true # every rule is `preview` until a corpus run promotes it
Presets
| preset | rules | ported from |
|---|---|---|
react/recommended |
19 | eslint-plugin-react 7.37.5 recommended + jsx-runtime (17 of its 20 active rules), and eslint-plugin-react-hooks 7.1.1's rules-of-hooks and exhaustive-deps |
react/conventions |
2 | codelaw's starter catalogue: react/hook-prefix, react/props-type-name — opt in |
Every rule is reimplemented, not vendored: the matchers, messages and docs
are written fresh, and each rule's ported_from: names the source rule.
How the ports differ
Every rule matches its source's documented behaviour on the source's own
examples. Where codelaw differs, the rule's ## Differences from the source
section says so. The larger ones:
| rule | difference |
|---|---|
react/jsx-key |
elements returned from a .map() callback's block body are not checked yet |
react/no-unknown-property |
renames HTML spellings (class, onclick, tabindex); in .js/.jsx the JavaScript grammar can't parse class= and for= |
react/exhaustive-deps |
dependencies compared by root name; setters, dispatchers and refs are stable |
react/rules-of-hooks |
an early return anywhere before a hook counts as making it conditional |
Not ported, and why
| rule | why |
|---|---|
react/prop-types |
needs the component's declared prop types matched to its uses; TypeScript types do this job |
react/jsx-uses-vars |
marks JSX names as used for no-unused-vars; codelaw's semantic model already counts them |
react/react-in-jsx-scope, react/jsx-uses-react |
turned off by jsx-runtime |
| eslint-plugin-react-hooks' 14 React Compiler rules | need the React Compiler's analysis |
Data
data/react/dom-property-aliases.json — HTML attribute names and the React prop names that replace them, written for this pack.
Metadata
Release files for codelaw-rules-react 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| codelaw_rules_react-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for codelaw_rules_react-0.2.0-py3-none-any.whl |
Release files / codelaw_rules_react-0.2.0-py3-none-any.whl
| Download URL | codelaw_rules_react-0.2.0-py3-none-any.whl |
|---|---|
| Size | 26.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df9363ce49b973b06946089a89b5f1c724cc837a697e184b1a4e2350d4333188
|
|
BLAKE2b-256 checksum How to use checksums |
d64ce0d9e0d235f16296afd5a6508338655f54c1c1b90f077c02415a05b2f28c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for codelaw-rules-react 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.