@codelaw/rules-react 0.1.0 → 0.2.0
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 +4 -0
- package/codelaw-pack.toml +1 -1
- package/corpus.toml +25 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,11 +12,15 @@ preview = true # every rule is `preview` until a corpus run promotes it
|
|
|
12
12
|
|
|
13
13
|
## Presets
|
|
14
14
|
|
|
15
|
+
<!-- docs-sync:presets -->
|
|
16
|
+
|
|
15
17
|
| preset | rules | ported from |
|
|
16
18
|
|---|---|---|
|
|
17
19
|
| `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` |
|
|
18
20
|
| `react/conventions` | 2 | codelaw's starter catalogue: `react/hook-prefix`, `react/props-type-name` — opt in |
|
|
19
21
|
|
|
22
|
+
<!-- /docs-sync:presets -->
|
|
23
|
+
|
|
20
24
|
Every rule is **reimplemented**, not vendored: the matchers, messages and docs
|
|
21
25
|
are written fresh, and each rule's `ported_from:` names the source rule.
|
|
22
26
|
|
package/codelaw-pack.toml
CHANGED
package/corpus.toml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# `codelaw test --corpus` finding counts (SR-RULE-AUTHORING decision 4).
|
|
2
|
+
# Rewrite with --update-snapshot, and review the change.
|
|
3
|
+
|
|
4
|
+
[findings]
|
|
5
|
+
"react/display-name" = 0
|
|
6
|
+
"react/exhaustive-deps" = 0
|
|
7
|
+
"react/hook-prefix" = 0
|
|
8
|
+
"react/jsx-key" = 1
|
|
9
|
+
"react/jsx-no-comment-textnodes" = 0
|
|
10
|
+
"react/jsx-no-duplicate-props" = 0
|
|
11
|
+
"react/jsx-no-target-blank" = 0
|
|
12
|
+
"react/jsx-no-undef" = 0
|
|
13
|
+
"react/no-children-prop" = 1
|
|
14
|
+
"react/no-danger-with-children" = 0
|
|
15
|
+
"react/no-deprecated" = 0
|
|
16
|
+
"react/no-direct-mutation-state" = 0
|
|
17
|
+
"react/no-find-dom-node" = 0
|
|
18
|
+
"react/no-is-mounted" = 0
|
|
19
|
+
"react/no-render-return-value" = 0
|
|
20
|
+
"react/no-string-refs" = 0
|
|
21
|
+
"react/no-unescaped-entities" = 9
|
|
22
|
+
"react/no-unknown-property" = 0
|
|
23
|
+
"react/props-type-name" = 8
|
|
24
|
+
"react/require-render-return" = 0
|
|
25
|
+
"react/rules-of-hooks" = 65
|