@neralabs/rerail-pack-next 0.1.6 → 0.1.8

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,5 +1,7 @@
1
1
  # Rerail rule pack: Next.js
2
2
 
3
+ **Linter-equivalent to @next/eslint-plugin-next 16.3.8.** Each rule flags what the original flags, bar declared differences. [What this means](../../docs/rule-packs.md#linter-equivalent).
4
+
3
5
  21 code rules for Next.js projects, ported from `@next/eslint-plugin-next` 16.3.8. Each is scored against the
4
6
  plugin's own findings on the plugin's rule tests and on their rename variants (`holds-under-rename`), and against the
5
7
  labelled lines of real-code samples ([docs/upstream.md](../../docs/upstream.md#samples)), through the engine's
@@ -67,7 +69,7 @@ Matches a `<script>` with a literal `src` containing the Google Analytics or gta
67
69
 
68
70
  ### `next-no-assign-module-variable`
69
71
 
70
- Matches any variable declaration with a declarator whose identifier is `module`.
72
+ Matches any variable declaration with a declarator whose identifier is `module`, including a `for…of` or `for…in` head such as `for (const module of mods)`, reported at its keyword as upstream does.
71
73
 
72
74
  ### `next-no-async-client-component`
73
75
 
package/pack.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "id": "next",
4
4
  "name": "Next.js",
5
5
  "category": "framework",
6
- "covers": "The Next.js ESLint plugin's rules for pages, images, fonts and scripts.",
6
+ "covers": "Linter-equivalent to @next/eslint-plugin-next 16.3.8, for pages, images, fonts and scripts.",
7
7
  "reason": "matches Next.js",
8
8
  "match": {
9
9
  "any": [
package/package.json CHANGED
@@ -1,7 +1,16 @@
1
1
  {
2
2
  "name": "@neralabs/rerail-pack-next",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Rerail rule pack: @next/eslint-plugin-next rules ported to Rerail code rules.",
5
+ "keywords": [
6
+ "rerail",
7
+ "rerail-pack",
8
+ "coding-agent",
9
+ "rules",
10
+ "nextjs",
11
+ "react",
12
+ "eslint-plugin-next"
13
+ ],
5
14
  "license": "Apache-2.0 AND MIT",
6
15
  "repository": {
7
16
  "type": "git",
@@ -17,7 +26,7 @@
17
26
  "README.md"
18
27
  ],
19
28
  "peerDependencies": {
20
- "@neralabs/rerail": ">=0.1.0-0 <0.2.0"
29
+ "@neralabs/rerail": ">=0.1.0-0"
21
30
  },
22
31
  "peerDependenciesMeta": {
23
32
  "@neralabs/rerail": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "format": "rerail.policy/v1",
3
3
  "id": "next-no-assign-module-variable",
4
- "revision": 2,
4
+ "revision": 3,
5
5
  "mode": "steer",
6
6
  "description": "Don't declare a variable named module in Next.js code; it shadows the module object Node.js and the bundler rely on.",
7
7
  "scope": {
@@ -26,20 +26,36 @@
26
26
  "rule": {
27
27
  "any": [
28
28
  {
29
- "kind": "lexical_declaration"
29
+ "any": [
30
+ {
31
+ "kind": "lexical_declaration"
32
+ },
33
+ {
34
+ "kind": "variable_declaration"
35
+ }
36
+ ],
37
+ "has": {
38
+ "kind": "variable_declarator",
39
+ "has": {
40
+ "field": "name",
41
+ "kind": "identifier",
42
+ "regex": "^module$"
43
+ }
44
+ }
30
45
  },
31
46
  {
32
- "kind": "variable_declaration"
47
+ "regex": "^(?:const|let|var)$",
48
+ "inside": {
49
+ "kind": "for_in_statement",
50
+ "field": "kind",
51
+ "has": {
52
+ "field": "left",
53
+ "kind": "identifier",
54
+ "regex": "^module$"
55
+ }
56
+ }
33
57
  }
34
- ],
35
- "has": {
36
- "kind": "variable_declarator",
37
- "has": {
38
- "field": "name",
39
- "kind": "identifier",
40
- "regex": "^module$"
41
- }
42
- }
58
+ ]
43
59
  }
44
60
  }
45
61
  },