@neralabs/rerail-pack-next 0.1.3 → 0.1.4
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 +8 -5
- package/licenses/next.js/UPSTREAM.md +4 -4
- package/pack.json +15 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ The pack follows the [pack structure and validation contract](../../docs/pack-fo
|
|
|
12
12
|
| `pack.json` | The pack (`rerail.rule-pack/v1`): each rule's document, title and group; six rules carry examples |
|
|
13
13
|
| `rules/` | The code-rule documents (`rerail.policy/v1`) |
|
|
14
14
|
| `conformance.json` | Each ported rule's upstream rule, how findings compare, and the capabilities it exercises, the shipped rules first and then the candidates; the pinned plugin and the pinned corpora (shadcn-ui, next-examples, commerce) |
|
|
15
|
-
| `upstream/eslint-plugin-next/` | The plugin's copied rule tests (`tests/`) and the cases extracted from them (`fixtures/`), its recordings (`fixtures.expected.json`, `corpus-<name>.expected.json`, `fixtures.cases.json`) and the recorder (`generate.mjs`) |
|
|
15
|
+
| `upstream/eslint-plugin-next/` | The plugin's copied rule tests (`tests/`) and the cases extracted from them (`fixtures/`), its recordings (`fixtures.expected.json`, `corpus-<name>.expected.json`, `fixtures.cases.json`) and the recorder (`generate.mjs`). All but the recorder are pack test data, derived from the pins (`npm run fixtures:derive`) and archived in S3: `npm run fixtures:pull` |
|
|
16
16
|
| `candidates/` | Ports that cannot pass their fixtures yet or that fail the port readiness gates (`rules/`, none today; scored through `conformance.json`, never gating), the Next fact model's probes (`probes/`), and the generators that write them and `rules/` (`build-policies.mjs`, `build-probes.mjs`) |
|
|
17
17
|
| `licenses/next.js/` | Next.js's licence and `UPSTREAM.md`, listing every copied file |
|
|
18
18
|
|
|
@@ -23,11 +23,14 @@ node packs/next/candidates/build-policies.mjs
|
|
|
23
23
|
node packs/next/candidates/build-probes.mjs
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
Re-recording
|
|
27
|
-
|
|
26
|
+
Re-recording is a maintainer deriving the pack's test data from its pins and archiving it
|
|
27
|
+
([CONTRIBUTING.md](../../CONTRIBUTING.md#pack-test-data)); it is never committed. The recipe
|
|
28
|
+
(`scripts/pack-data/recipes/next.ts`) runs `upstream/eslint-plugin-next/generate.mjs` against the pinned plugin and
|
|
29
|
+
corpora (Node 23.6 or later):
|
|
28
30
|
|
|
29
31
|
```sh
|
|
30
|
-
|
|
32
|
+
npm run fixtures:derive -- --pack next
|
|
33
|
+
npm run fixtures:push -- --pack next # on your own branch: archive it and rewrite its test-data.lock
|
|
31
34
|
```
|
|
32
35
|
|
|
33
36
|
Scoring one rule, shipped or candidate, with every false positive and false negative printed:
|
|
@@ -92,7 +95,7 @@ Matches an import from `next/head` in a file whose path, between its first and s
|
|
|
92
95
|
|
|
93
96
|
### `next-no-img-element`
|
|
94
97
|
|
|
95
|
-
Matches an `<img>` opening element with attributes that is not a direct child of `<picture>`, unless the file is an app-dir metadata image route (path relative to the ESLint cwd matches `^(src/)?app/` and `/opengraph-image|twitter-image|icon.<ext>`). The violation message is upstream's plus Rerail additions
|
|
98
|
+
Matches an `<img>` opening element with attributes that is not a direct child of `<picture>`, unless the file is an app-dir metadata image route (path relative to the ESLint cwd matches `^(src/)?app/` and `/opengraph-image|twitter-image|icon.<ext>`). The violation message is upstream's plus Rerail additions: what `<Image />` needs (`width` and `height` or `fill`; a matching `images.remotePatterns` entry for a remote `src`) and the eslint-disable comment that keeps `<img>`.
|
|
96
99
|
|
|
97
100
|
### `next-no-location-assign-relative-destination`
|
|
98
101
|
|
|
@@ -217,8 +217,8 @@ Paths are relative to the pack directory, `packs/next/`.
|
|
|
217
217
|
| `upstream/eslint-plugin-next/fixtures/no-head-element/2a7f549f6c61.ts` | `test/unit/eslint-plugin-next/no-head-element.test.ts` | derived |
|
|
218
218
|
|
|
219
219
|
> `recording.json` is a port readiness recording, and no file of this pack, so it is recorded here rather than in the
|
|
220
|
-
> table above: the tool-pack's `recording.lock` names it
|
|
221
|
-
> It carries excerpts of this upstream's tests (`test/unit/eslint-plugin-next/*.test.ts`:
|
|
222
|
-
> case), redistributed under the licence above, together with Rerail's Apache-2.0;
|
|
223
|
-
> upstream's own, at the pinned commit.
|
|
220
|
+
> table above: the tool-pack's `recording.lock` names it by its sha256, and the bytes are an object in S3, not a file in
|
|
221
|
+
> git (docs/port-readiness.md). It carries excerpts of this upstream's tests (`test/unit/eslint-plugin-next/*.test.ts`:
|
|
222
|
+
> the `code` of each RuleTester case), redistributed under the licence above, together with Rerail's Apache-2.0;
|
|
223
|
+
> `LICENSE` beside this file is this upstream's own, at the pinned commit.
|
|
224
224
|
|
package/pack.json
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"id": "next-no-img-element",
|
|
23
23
|
"document": "rules/next-no-img-element.json",
|
|
24
24
|
"title": "No img element",
|
|
25
|
+
"mode": "log",
|
|
25
26
|
"group": "Next.js",
|
|
26
27
|
"examples": {
|
|
27
28
|
"caught": {
|
|
@@ -38,12 +39,14 @@
|
|
|
38
39
|
"id": "next-no-head-element",
|
|
39
40
|
"document": "rules/next-no-head-element.json",
|
|
40
41
|
"title": "No head element",
|
|
42
|
+
"mode": "log",
|
|
41
43
|
"group": "Next.js"
|
|
42
44
|
},
|
|
43
45
|
{
|
|
44
46
|
"id": "next-no-sync-scripts",
|
|
45
47
|
"document": "rules/next-no-sync-scripts.json",
|
|
46
48
|
"title": "No sync scripts",
|
|
49
|
+
"mode": "log",
|
|
47
50
|
"group": "Next.js",
|
|
48
51
|
"examples": {
|
|
49
52
|
"caught": {
|
|
@@ -60,30 +63,35 @@
|
|
|
60
63
|
"id": "next-no-css-tags",
|
|
61
64
|
"document": "rules/next-no-css-tags.json",
|
|
62
65
|
"title": "No css tags",
|
|
66
|
+
"mode": "log",
|
|
63
67
|
"group": "Next.js"
|
|
64
68
|
},
|
|
65
69
|
{
|
|
66
70
|
"id": "next-google-font-display",
|
|
67
71
|
"document": "rules/next-google-font-display.json",
|
|
68
72
|
"title": "Google font display",
|
|
73
|
+
"mode": "log",
|
|
69
74
|
"group": "Next.js"
|
|
70
75
|
},
|
|
71
76
|
{
|
|
72
77
|
"id": "next-google-font-preconnect",
|
|
73
78
|
"document": "rules/next-google-font-preconnect.json",
|
|
74
79
|
"title": "Google font preconnect",
|
|
80
|
+
"mode": "log",
|
|
75
81
|
"group": "Next.js"
|
|
76
82
|
},
|
|
77
83
|
{
|
|
78
84
|
"id": "next-next-script-for-ga",
|
|
79
85
|
"document": "rules/next-next-script-for-ga.json",
|
|
80
86
|
"title": "Next script for ga",
|
|
87
|
+
"mode": "log",
|
|
81
88
|
"group": "Next.js"
|
|
82
89
|
},
|
|
83
90
|
{
|
|
84
91
|
"id": "next-no-unwanted-polyfillio",
|
|
85
92
|
"document": "rules/next-no-unwanted-polyfillio.json",
|
|
86
93
|
"title": "No unwanted polyfillio",
|
|
94
|
+
"mode": "log",
|
|
87
95
|
"group": "Next.js"
|
|
88
96
|
},
|
|
89
97
|
{
|
|
@@ -118,6 +126,7 @@
|
|
|
118
126
|
"id": "next-no-styled-jsx-in-document",
|
|
119
127
|
"document": "rules/next-no-styled-jsx-in-document.json",
|
|
120
128
|
"title": "No styled jsx in document",
|
|
129
|
+
"mode": "log",
|
|
121
130
|
"group": "Next.js",
|
|
122
131
|
"examples": {
|
|
123
132
|
"caught": {
|
|
@@ -134,6 +143,7 @@
|
|
|
134
143
|
"id": "next-no-title-in-document-head",
|
|
135
144
|
"document": "rules/next-no-title-in-document-head.json",
|
|
136
145
|
"title": "No title in document head",
|
|
146
|
+
"mode": "log",
|
|
137
147
|
"group": "Next.js",
|
|
138
148
|
"examples": {
|
|
139
149
|
"caught": {
|
|
@@ -172,12 +182,14 @@
|
|
|
172
182
|
"id": "next-no-async-client-component",
|
|
173
183
|
"document": "rules/next-no-async-client-component.json",
|
|
174
184
|
"title": "No async client component",
|
|
185
|
+
"mode": "log",
|
|
175
186
|
"group": "Next.js"
|
|
176
187
|
},
|
|
177
188
|
{
|
|
178
189
|
"id": "next-no-before-interactive-script-outside-document",
|
|
179
190
|
"document": "rules/next-no-before-interactive-script-outside-document.json",
|
|
180
191
|
"title": "No before interactive script outside document",
|
|
192
|
+
"mode": "log",
|
|
181
193
|
"group": "Next.js"
|
|
182
194
|
},
|
|
183
195
|
{
|
|
@@ -190,18 +202,21 @@
|
|
|
190
202
|
"id": "next-no-typos",
|
|
191
203
|
"document": "rules/next-no-typos.json",
|
|
192
204
|
"title": "No typos",
|
|
205
|
+
"mode": "log",
|
|
193
206
|
"group": "Next.js"
|
|
194
207
|
},
|
|
195
208
|
{
|
|
196
209
|
"id": "next-no-page-custom-font",
|
|
197
210
|
"document": "rules/next-no-page-custom-font.json",
|
|
198
211
|
"title": "No page custom font",
|
|
212
|
+
"mode": "log",
|
|
199
213
|
"group": "Next.js"
|
|
200
214
|
},
|
|
201
215
|
{
|
|
202
216
|
"id": "next-no-location-assign-relative-destination",
|
|
203
217
|
"document": "rules/next-no-location-assign-relative-destination.json",
|
|
204
218
|
"title": "No location assign relative destination",
|
|
219
|
+
"mode": "log",
|
|
205
220
|
"group": "Next.js"
|
|
206
221
|
}
|
|
207
222
|
]
|