@neralabs/rerail-pack-react 0.1.1 → 0.1.3

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 CHANGED
@@ -1,12 +1,21 @@
1
1
  # Rerail rule pack: React
2
2
 
3
- Ports of eslint-plugin-react 7.37.5 and eslint-plugin-react-hooks 7.1.1 rules. A port starts in `candidates/rules/`
4
- and moves to `rules/` and `pack.json` once it passes the V1 rule validation gates
5
- ([nera-rule-validation](https://github.com/neralabs/nera-rule-validation)). While `pack.json` lists no rules, the pack
6
- ships none and is never recommended. Every port is scored against the plugins' own findings on the plugins' test cases
7
- and the pinned corpus, through the engine's production workspace path. The conformance check (`--check`, run in CI)
8
- scores the test cases only: it gates the ports in `rules/` and reports the candidates without gating them. The corpus
9
- is scored on demand, with `--pack react --corpus excalidraw`.
3
+ Ports of eslint-plugin-react 7.37.5 and eslint-plugin-react-hooks 7.1.1 rules. A port starts in `candidates/rules/` and
4
+ moves to `rules/` and `pack.json` once it passes the [port readiness gates](../../docs/port-readiness.md), which CI runs on every
5
+ port. While `pack.json` lists no rules, the pack ships none and is never recommended. Every port is scored against the
6
+ plugins' own findings on the plugins' test cases and the pinned corpus, through the engine's production workspace path.
7
+ The conformance check (`--check`, run in CI) scores the test cases only: it gates the ports in `rules/` and reports the
8
+ candidates without gating them. The corpus is scored on demand, with `--pack react --corpus excalidraw`.
9
+
10
+ Every rule runs on JavaScript and TypeScript files whose JSX runtime is React or not known; a file whose JSX belongs to
11
+ another library is skipped. The runtime is the file's `@jsxImportSource` pragma when it names React, Emotion
12
+ (`@emotion/react`) or Theme UI (React) or Preact, Solid, Vue, Stencil, Hono, Qwik, Inferno, Mithril or Hyperapp (another
13
+ library), or its `@jsx` pragma when that names `React`; else an `h` or `createElement` imported from Stencil, Preact,
14
+ Vue, Solid, Hyperapp or Mithril (another library); else its nearest `package.json`: React when it depends on react,
15
+ react-dom, react-native or next and on none of vue, @stencil/core, preact, solid-js, @builder.io/qwik, inferno or
16
+ mithril, another library in the reverse case, unknown otherwise. `react-in-jsx-scope` also skips files whose `@jsx`
17
+ pragma names another factory (Emotion's `jsx`, for one): the plugin then asks for that factory in scope, which the
18
+ port does not check.
10
19
 
11
20
  The pack follows the [pack structure and validation contract](../../docs/pack-format.md): it is checked by
12
21
  `npx vitest run test/engine/catalog/packs.test.ts -t "pack react"`.
@@ -15,7 +24,8 @@ The pack follows the [pack structure and validation contract](../../docs/pack-fo
15
24
  |---|---|
16
25
  | `pack.json` | The pack (`rerail.rule-pack/v1`): its match definition, and no rules until a port passes |
17
26
  | `conformance.json` | Every port (shipped under `rules/`, or a candidate under `candidates/rules/`): its upstream tool and rule, how findings compare and the capabilities it exercises; the pinned tools and the pinned corpus (excalidraw). Written by `candidates/build.mjs` |
18
- | `upstream/<tool>/` | The plugin's copied tests (`tests/`), the cases extracted from them (`fixtures/`), its recordings (`fixtures.expected.json`, `corpus-excalidraw.expected.json`) and the recorder (`generate.mjs`, sharing `upstream/common.mjs` and `conformance/recorders/eslint-record.mjs`) |
27
+ | `upstream/<tool>/` | The plugin's copied tests (`tests/`), the cases extracted from them (`fixtures/`), its recordings (`fixtures.expected.json`, `corpus-excalidraw.expected.json`) and the recorder (`generate.mjs`, sharing `upstream/common.mjs` and `conformance/recorders/eslint-record.mjs`); `UPSTREAM.md` lists the fixtures Rerail wrote beside them (`common.mjs` `AUTHORED`): files of other JSX libraries, which the plugins report and the ports skip, and React files whose JSX goes through Emotion, which both report |
28
+ | `divergences.json` | Where the ports and the recordings disagree by design: the plugins' findings on the authored files of other JSX libraries |
19
29
  | `licenses/<project>/` | The upstream licence and `UPSTREAM.md`, listing every copied file and extracted case |
20
30
  | `candidates/` | Ports still being evaluated, scored but never shipped: the code-rule documents (`rules/`, written by `build.mjs` from `specs.mjs`, except the hand-written `react-no-array-index-key.json`); `probes/` holds the hand-labelled React fact probes |
21
31