@pumpn/eslint-config 17.2.4 → 18.0.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.
Files changed (209) hide show
  1. package/_common/_exports.js +5 -0
  2. package/_common/all-extensions/_exports.js +1 -0
  3. package/_common/all-extensions/js-extensions.js +10 -0
  4. package/_common/all-extensions.js +6 -0
  5. package/_common/convert-extensions-to-glob.js +12 -0
  6. package/_common/js-jsx-extensions.js +3 -0
  7. package/_common/ts-extensions.js +10 -0
  8. package/_common/ts-jsx-extensions.js +3 -0
  9. package/config/_common/_exports.js +5 -0
  10. package/config/_common/add-prefix-to-rules.js +13 -0
  11. package/config/_common/core-json-rules.js +24 -0
  12. package/config/_common/json-plugins.js +9 -0
  13. package/config/_common/pick-unicorn-rules-for-language/_exports.js +2 -0
  14. package/config/_common/pick-unicorn-rules-for-language/pick-rules-for-language.js +52 -0
  15. package/config/_common/pick-unicorn-rules-for-language/unicorn/_exports.js +9 -0
  16. package/config/_common/pick-unicorn-rules-for-language/unicorn/binary-group-length.js +3 -0
  17. package/config/_common/pick-unicorn-rules-for-language/unicorn/hexadecimal-group-length.js +3 -0
  18. package/config/_common/pick-unicorn-rules-for-language/unicorn/maximum-nested-calls.js +3 -0
  19. package/config/_common/pick-unicorn-rules-for-language/unicorn/number-group-length.js +3 -0
  20. package/config/_common/pick-unicorn-rules-for-language/unicorn/octal-group-length.js +3 -0
  21. package/config/_common/pick-unicorn-rules-for-language/unicorn/patterns.js +28 -0
  22. package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-consistency-rules/_exports.js +1 -0
  23. package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-consistency-rules/consistent-function-style.js +3 -0
  24. package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-consistency-rules.js +66 -0
  25. package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-preference-rules.js +199 -0
  26. package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-redundancy-rules.js +47 -0
  27. package/config/_common/pick-unicorn-rules-for-language/unicorn.js +368 -0
  28. package/config/_common/pick-unicorn-rules-for-language.js +14 -0
  29. package/config/_exports.js +11 -0
  30. package/config/converted-globals.js +16 -0
  31. package/config/css-config/_exports.js +2 -0
  32. package/config/css-config/css-plugins.js +9 -0
  33. package/config/css-config/css-rules/_exports.js +1 -0
  34. package/config/css-config/css-rules/core-css-rules.js +25 -0
  35. package/config/css-config/css-rules.js +10 -0
  36. package/config/css-config.js +17 -0
  37. package/config/default-glob.js +6 -0
  38. package/config/html-config/_exports.js +2 -0
  39. package/config/html-config/html-plugins.js +9 -0
  40. package/config/html-config/html-rules/_exports.js +1 -0
  41. package/config/html-config/html-rules/core-html-rules/_exports.js +4 -0
  42. package/config/html-config/html-rules/core-html-rules/core-html-accessibility-rules.js +28 -0
  43. package/config/html-config/html-rules/core-html-rules/core-html-best-practice-rules.js +42 -0
  44. package/config/html-config/html-rules/core-html-rules/core-html-seo-rules.js +16 -0
  45. package/config/html-config/html-rules/core-html-rules/core-html-style-rules.js +23 -0
  46. package/config/html-config/html-rules/core-html-rules.js +27 -0
  47. package/config/html-config/html-rules.js +10 -0
  48. package/config/html-config.js +12 -0
  49. package/config/json-config/_exports.js +1 -0
  50. package/config/json-config/json-rules.js +9 -0
  51. package/config/json-config.js +13 -0
  52. package/config/jsonc-config/_exports.js +1 -0
  53. package/config/jsonc-config/jsonc-rules.js +9 -0
  54. package/config/jsonc-config.js +26 -0
  55. package/config/jsx-glob/_exports.js +1 -0
  56. package/config/jsx-glob/jsx-extensions.js +6 -0
  57. package/config/jsx-glob.js +7 -0
  58. package/config/md-config/_exports.js +2 -0
  59. package/config/md-config/md-plugins.js +9 -0
  60. package/config/md-config/md-rules/_exports.js +1 -0
  61. package/config/md-config/md-rules/core-md-rules.js +30 -0
  62. package/config/md-config/md-rules.js +10 -0
  63. package/config/md-config.js +15 -0
  64. package/{plugins.js → config/plugins.js} +7 -6
  65. package/{rules → config/rules}/_common/_exports.js +0 -1
  66. package/{rules → config/rules}/_exports.js +1 -4
  67. package/config/rules/better-tailwindcss/correctness.js +13 -0
  68. package/config/rules/better-tailwindcss/stylistic.js +42 -0
  69. package/config/rules/better-tailwindcss.js +15 -0
  70. package/config/rules/command.js +17 -0
  71. package/config/rules/depend.js +17 -0
  72. package/config/rules/eslint-comments/best-practices.js +14 -0
  73. package/config/rules/eslint-comments/stylistic-issues.js +17 -0
  74. package/config/rules/eslint-comments.js +15 -0
  75. package/config/rules/import-x/helpful-warnings.js +26 -0
  76. package/config/rules/import-x/module-systems.js +14 -0
  77. package/config/rules/import-x/static-analysis.js +40 -0
  78. package/config/rules/import-x/style-guide/_exports.js +1 -0
  79. package/config/rules/import-x/style-guide/max-dependencies.js +3 -0
  80. package/config/rules/import-x/style-guide.js +94 -0
  81. package/config/rules/import-x.js +22 -0
  82. package/config/rules/jsdoc.js +464 -0
  83. package/config/rules/no-secrets/_exports.js +1 -0
  84. package/config/rules/no-secrets/tolerance.js +3 -0
  85. package/config/rules/no-secrets.js +30 -0
  86. package/config/rules/perfectionist.js +331 -0
  87. package/config/rules/promise.js +53 -0
  88. package/config/rules/react/core.js +69 -0
  89. package/config/rules/react/debug.js +14 -0
  90. package/config/rules/react/dom.js +25 -0
  91. package/config/rules/react/jsx.js +23 -0
  92. package/config/rules/react/naming-convention.js +12 -0
  93. package/config/rules/react/rsc.js +10 -0
  94. package/config/rules/react/web-api.js +15 -0
  95. package/config/rules/react.js +28 -0
  96. package/config/rules/regexp/best-practices.js +47 -0
  97. package/config/rules/regexp/possible-errors.js +31 -0
  98. package/config/rules/regexp/stylistic-issues.js +79 -0
  99. package/config/rules/regexp.js +20 -0
  100. package/config/rules/security.js +31 -0
  101. package/config/rules/sonarjs/problem.js +134 -0
  102. package/config/rules/sonarjs/suggestion.js +167 -0
  103. package/config/rules/sonarjs.js +15 -0
  104. package/config/rules/stylistic/_common/_exports.js +1 -0
  105. package/{rules → config/rules}/stylistic/_exports.js +1 -1
  106. package/config/rules/stylistic/brackets/_exports.js +2 -0
  107. package/config/rules/stylistic/brackets/min-elements-for-curly-newline.js +3 -0
  108. package/config/rules/stylistic/brackets/wrap-multilines-default.js +3 -0
  109. package/config/rules/stylistic/brackets.js +90 -0
  110. package/config/rules/stylistic/commas.js +18 -0
  111. package/config/rules/stylistic/comments.js +13 -0
  112. package/config/rules/stylistic/disallow.js +36 -0
  113. package/config/rules/stylistic/indent.js +19 -0
  114. package/config/rules/stylistic/jsx.js +42 -0
  115. package/config/rules/stylistic/linebreaks/_exports.js +1 -0
  116. package/config/rules/stylistic/linebreaks/max-ignored-chain-depth.js +3 -0
  117. package/config/rules/stylistic/linebreaks.js +67 -0
  118. package/config/rules/stylistic/misc.js +49 -0
  119. package/config/rules/stylistic/operators.js +31 -0
  120. package/config/rules/stylistic/quotes.js +12 -0
  121. package/config/rules/stylistic/semis.js +19 -0
  122. package/config/rules/stylistic/spacing.js +68 -0
  123. package/config/rules/stylistic/types.js +12 -0
  124. package/config/rules/stylistic.js +40 -0
  125. package/config/rules/suggestions/_exports.js +9 -0
  126. package/config/rules/suggestions/max-classes-per-file.js +3 -0
  127. package/config/rules/suggestions/max-depth.js +3 -0
  128. package/config/rules/suggestions/max-identifier-length.js +3 -0
  129. package/config/rules/suggestions/max-lines-per-file.js +3 -0
  130. package/config/rules/suggestions/max-lines-per-function.js +3 -0
  131. package/config/rules/suggestions/max-nested-callbacks.js +3 -0
  132. package/config/rules/suggestions/max-parameters.js +3 -0
  133. package/config/rules/suggestions/max-statements.js +3 -0
  134. package/config/rules/suggestions/min-identifier-length.js +3 -0
  135. package/{rules → config/rules}/suggestions.js +17 -15
  136. package/config/rules.js +50 -0
  137. package/config/ts-glob.js +6 -0
  138. package/config.js +51 -53
  139. package/package.json +51 -38
  140. package/.ls-lint.yml +0 -6
  141. package/.vscode/settings.json +0 -18
  142. package/deno.json +0 -78
  143. package/deno.lock +0 -1632
  144. package/eslint.config.js +0 -25
  145. package/rules/better-tailwindcss/correctness.js +0 -7
  146. package/rules/better-tailwindcss/stylistic.js +0 -38
  147. package/rules/better-tailwindcss.js +0 -19
  148. package/rules/command.js +0 -12
  149. package/rules/depend.js +0 -12
  150. package/rules/eslint-comments/best-practices.js +0 -9
  151. package/rules/eslint-comments/stylistic-issues.js +0 -12
  152. package/rules/eslint-comments.js +0 -19
  153. package/rules/import-x/helpful-warnings.js +0 -21
  154. package/rules/import-x/module-systems.js +0 -9
  155. package/rules/import-x/static-analysis.js +0 -35
  156. package/rules/import-x/style-guide.js +0 -89
  157. package/rules/import-x.js +0 -19
  158. package/rules/jsdoc.js +0 -433
  159. package/rules/no-secrets.js +0 -25
  160. package/rules/perfectionist.js +0 -318
  161. package/rules/promise.js +0 -48
  162. package/rules/react/core.js +0 -59
  163. package/rules/react/debug.js +0 -6
  164. package/rules/react/dom.js +0 -15
  165. package/rules/react/jsx.js +0 -18
  166. package/rules/react/naming-convention.js +0 -6
  167. package/rules/react/rsc.js +0 -5
  168. package/rules/react/web-api.js +0 -10
  169. package/rules/react.js +0 -19
  170. package/rules/regexp/best-practices.js +0 -42
  171. package/rules/regexp/possible-errors.js +0 -26
  172. package/rules/regexp/stylistic-issues.js +0 -74
  173. package/rules/regexp.js +0 -19
  174. package/rules/security.js +0 -25
  175. package/rules/sonarjs/problem.js +0 -123
  176. package/rules/sonarjs/suggestion.js +0 -135
  177. package/rules/sonarjs.js +0 -19
  178. package/rules/stylistic/_common/_exports.js +0 -3
  179. package/rules/stylistic/brackets.js +0 -87
  180. package/rules/stylistic/commas.js +0 -13
  181. package/rules/stylistic/comments.js +0 -8
  182. package/rules/stylistic/disallow.js +0 -31
  183. package/rules/stylistic/indent.js +0 -14
  184. package/rules/stylistic/jsx.js +0 -37
  185. package/rules/stylistic/linebreaks.js +0 -63
  186. package/rules/stylistic/misc.js +0 -45
  187. package/rules/stylistic/operators.js +0 -26
  188. package/rules/stylistic/quotes.js +0 -7
  189. package/rules/stylistic/semis.js +0 -14
  190. package/rules/stylistic/spacing.js +0 -63
  191. package/rules/stylistic/types.js +0 -7
  192. package/rules/stylistic.js +0 -19
  193. package/rules/unicorn.js +0 -306
  194. package/rules.js +0 -19
  195. package/scripts/update-import-map.js +0 -47
  196. package/scripts/update-package-json.js +0 -66
  197. package/scripts/update-tsconfig.js +0 -46
  198. package/tsconfig.json +0 -27
  199. /package/{rules → config}/_common/tab-width.js +0 -0
  200. /package/{rules → config/rules}/_common/maximum-line-length.js +0 -0
  201. /package/{rules → config/rules}/better-tailwindcss/_exports.js +0 -0
  202. /package/{rules → config/rules}/eslint-comments/_exports.js +0 -0
  203. /package/{rules → config/rules}/import-x/_exports.js +0 -0
  204. /package/{rules → config/rules}/layout-and-formatting.js +0 -0
  205. /package/{rules → config/rules}/possible-problems.js +0 -0
  206. /package/{rules → config/rules}/react/_exports.js +0 -0
  207. /package/{rules → config/rules}/regexp/_exports.js +0 -0
  208. /package/{rules → config/rules}/sonarjs/_exports.js +0 -0
  209. /package/{rules → config/rules}/stylistic/_common/min-items-for-array-newline.js +0 -0
@@ -0,0 +1,331 @@
1
+ import addPrefixToRules from "../_common/add-prefix-to-rules.js";
2
+
3
+ /**
4
+ * @import { Linter } from "eslint";
5
+ */
6
+
7
+ /**
8
+ * @satisfies {Linter.RulesRecord}
9
+ */
10
+ const perfectionistRules = addPrefixToRules(
11
+ "perfectionist",
12
+ {
13
+ "sort-array-includes": [
14
+ "error",
15
+ {
16
+ groups: ["literal"]
17
+ }
18
+ ],
19
+ "sort-arrays": [
20
+ "error",
21
+ {
22
+ useConfigurationIf: {
23
+ matchesAstSelector: "NewExpression[callee.name=\"ReadonlySet\"] > ArrayExpression"
24
+ }
25
+ }
26
+ ],
27
+ "sort-classes": [
28
+ "error",
29
+ {
30
+ groups: [
31
+ "index-signature",
32
+ ["private-static-property", "private-static-accessor-property"],
33
+ ["private-static-get-method", "private-static-set-method"],
34
+ ["static-property", "static-accessor-property"],
35
+ ["static-get-method", "static-set-method"],
36
+ ["protected-static-property", "protected-static-accessor-property"],
37
+ ["protected-static-get-method", "protected-static-set-method"],
38
+ "static-block",
39
+ ["property", "accessor-property"],
40
+ ["get-method", "set-method"],
41
+ ["protected-property", "protected-accessor-property"],
42
+ ["protected-get-method", "protected-set-method"],
43
+ ["private-property", "private-accessor-property"],
44
+ ["private-get-method", "private-set-method"],
45
+ "constructor",
46
+ ["static-method", "static-function-property"],
47
+ ["protected-static-method", "protected-static-function-property"],
48
+ ["private-static-method", "private-static-function-property"],
49
+ ["method", "function-property"],
50
+ ["protected-method", "protected-function-property"],
51
+ ["private-method", "private-function-property"],
52
+ "unknown"
53
+ ],
54
+ partitionByComment: String.raw`\/\/`,
55
+ partitionByNewLine: false
56
+ }
57
+ ],
58
+ "sort-constructor-parameters": "off",
59
+ "sort-decorators": "error",
60
+ "sort-enums": "error",
61
+ "sort-export-attributes": "error",
62
+ "sort-exports": "error",
63
+ "sort-heritage-clauses": "error",
64
+ "sort-import-attributes": "error",
65
+ "sort-imports": [
66
+ "error",
67
+ {
68
+ customGroups: [
69
+ {
70
+ elementNamePattern: "^@/components/.*",
71
+ groupName: "components"
72
+ },
73
+ {
74
+ elementNamePattern: "^@/islands/.*",
75
+ groupName: "islands"
76
+ },
77
+ {
78
+ elementNamePattern: "^@/logic/.*",
79
+ groupName: "logic"
80
+ },
81
+ {
82
+ elementNamePattern: "^@/plugins/.*",
83
+ groupName: "plugins"
84
+ },
85
+ {
86
+ elementNamePattern: "^@std/.*",
87
+ groupName: "std"
88
+ },
89
+ {
90
+ elementNamePattern: "^@/utilities/.*",
91
+ groupName: "utilities"
92
+ }
93
+ ],
94
+ groups: [
95
+ "builtin",
96
+ "std",
97
+ "external",
98
+ "utilities",
99
+ "plugins",
100
+ "logic",
101
+ "components",
102
+ "islands",
103
+ "internal",
104
+ "type",
105
+ "type-internal",
106
+ "type-parent",
107
+ "type-sibling",
108
+ "type-index",
109
+ "parent",
110
+ "sibling",
111
+ "index",
112
+ "unknown"
113
+ ],
114
+ internalPattern: ["^@/.+"],
115
+ newlinesBetween: 1,
116
+ partitionByNewLine: false,
117
+ sortSideEffects: true
118
+ }
119
+ ],
120
+ "sort-interfaces": "error",
121
+ "sort-intersection-types": "error",
122
+ "sort-jsx-props": [
123
+ "error",
124
+ {
125
+ groups: ["shorthand-prop", "unknown", "multiline-prop"]
126
+ }
127
+ ],
128
+ "sort-maps": "error",
129
+ "sort-modules": "off",
130
+ "sort-named-exports": "error",
131
+ "sort-named-imports": ["error", { partitionByComment: false }],
132
+ "sort-object-types": "error",
133
+ "sort-objects": [
134
+ "error",
135
+ {
136
+ customGroups: [
137
+ {
138
+ elementNamePattern: ["^id$"],
139
+ groupName: "id"
140
+ },
141
+ {
142
+ elementNamePattern: ["^before.*"],
143
+ groupName: "groupBeforeAfter1"
144
+ },
145
+ {
146
+ elementNamePattern: ["^after.*"],
147
+ groupName: "groupBeforeAfter2"
148
+ },
149
+ {
150
+ elementNamePattern: ["^r$", "^l$"],
151
+ groupName: "groupColor1"
152
+ },
153
+ {
154
+ elementNamePattern: ["^g$", "^c$", "^a$"],
155
+ groupName: "groupColor2"
156
+ },
157
+ {
158
+ elementNamePattern: ["^b$", "^h$"],
159
+ groupName: "groupColor3"
160
+ },
161
+ {
162
+ elementNamePattern: ["^minimum(([A-Z].*)|$)"],
163
+ groupName: "groupMinimumMaximum1"
164
+ },
165
+ {
166
+ elementNamePattern: ["^maximum(([A-Z].*)|$)"],
167
+ groupName: "groupMinimumMaximum2"
168
+ },
169
+ {
170
+ elementNamePattern: ["^min(([A-Z_-].*)|$)"],
171
+ groupName: "groupMinMax1"
172
+ },
173
+ {
174
+ elementNamePattern: ["^max(([A-Z_-].*)|$)"],
175
+ groupName: "groupMinMax2"
176
+ },
177
+ {
178
+ elementNamePattern: ["^primary.*"],
179
+ groupName: "groupPrecedenceOrdinal1"
180
+ },
181
+ {
182
+ elementNamePattern: ["^secondary.*"],
183
+ groupName: "groupPrecedenceOrdinal2"
184
+ },
185
+ {
186
+ elementNamePattern: ["^tertiary.*"],
187
+ groupName: "groupPrecedenceOrdinal3"
188
+ },
189
+ {
190
+ elementNamePattern: ["^quaternary.*"],
191
+ groupName: "groupPrecedenceOrdinal4"
192
+ },
193
+ {
194
+ elementNamePattern: ["^quinary.*"],
195
+ groupName: "groupPrecedenceOrdinal5"
196
+ },
197
+ {
198
+ elementNamePattern: ["^senary.*"],
199
+ groupName: "groupPrecedenceOrdinal6"
200
+ },
201
+ {
202
+ elementNamePattern: ["^septenary.*"],
203
+ groupName: "groupPrecedenceOrdinal7"
204
+ },
205
+ {
206
+ elementNamePattern: ["^octonary.*"],
207
+ groupName: "groupPrecedenceOrdinal8"
208
+ },
209
+ {
210
+ elementNamePattern: ["^nonary.*"],
211
+ groupName: "groupPrecedenceOrdinal9"
212
+ },
213
+ {
214
+ elementNamePattern: ["^denary.*"],
215
+ groupName: "groupPrecedenceOrdinal10"
216
+ },
217
+ {
218
+ elementNamePattern: ["^ultimate.*"],
219
+ groupName: "groupPrecedenceOrdinalLast"
220
+ },
221
+ {
222
+ elementNamePattern: ["^previous.*"],
223
+ groupName: "groupPreviousNext1"
224
+ },
225
+ {
226
+ elementNamePattern: ["^next.*"],
227
+ groupName: "groupPreviousNext2"
228
+ },
229
+ {
230
+ elementNamePattern: ["^prev(?!ent).*"],
231
+ groupName: "groupPrevNext1"
232
+ },
233
+ {
234
+ elementNamePattern: ["^next.*"],
235
+ groupName: "groupPrevNext2"
236
+ },
237
+ {
238
+ elementNamePattern: ["^first.*"],
239
+ groupName: "groupSpatialOrdinal1"
240
+ },
241
+ {
242
+ elementNamePattern: ["^second.*"],
243
+ groupName: "groupSpatialOrdinal2"
244
+ },
245
+ {
246
+ elementNamePattern: ["^third.*"],
247
+ groupName: "groupSpatialOrdinal3"
248
+ },
249
+ {
250
+ elementNamePattern: ["^fourth.*"],
251
+ groupName: "groupSpatialOrdinal4"
252
+ },
253
+ {
254
+ elementNamePattern: ["^fifth.*"],
255
+ groupName: "groupSpatialOrdinal5"
256
+ },
257
+ {
258
+ elementNamePattern: ["^sixth.*"],
259
+ groupName: "groupSpatialOrdinal6"
260
+ },
261
+ {
262
+ elementNamePattern: ["^seventh.*"],
263
+ groupName: "groupSpatialOrdinal7"
264
+ },
265
+ {
266
+ elementNamePattern: ["^eighth.*"],
267
+ groupName: "groupSpatialOrdinal8"
268
+ },
269
+ {
270
+ elementNamePattern: ["^ninth.*"],
271
+ groupName: "groupSpatialOrdinal9"
272
+ },
273
+ {
274
+ elementNamePattern: ["^tenth.*"],
275
+ groupName: "groupSpatialOrdinal10"
276
+ },
277
+ {
278
+ elementNamePattern: ["^last.*"],
279
+ groupName: "groupSpatialOrdinalLast"
280
+ }
281
+ ],
282
+ groups: [
283
+ "id",
284
+ "groupBeforeAfter1",
285
+ "groupBeforeAfter2",
286
+ "groupMinMax1",
287
+ "groupMinMax2",
288
+ "groupMinimumMaximum1",
289
+ "groupMinimumMaximum2",
290
+ "groupPreviousNext1",
291
+ "groupPrevNext1",
292
+ "groupSpatialOrdinal1",
293
+ "groupSpatialOrdinal2",
294
+ "groupSpatialOrdinal3",
295
+ "groupSpatialOrdinal4",
296
+ "groupSpatialOrdinal5",
297
+ "groupSpatialOrdinal6",
298
+ "groupSpatialOrdinal7",
299
+ "groupSpatialOrdinal8",
300
+ "groupSpatialOrdinal9",
301
+ "groupSpatialOrdinal10",
302
+ "groupPreviousNext2",
303
+ "groupPrevNext2",
304
+ "groupSpatialOrdinalLast",
305
+ "groupPrecedenceOrdinal1",
306
+ "groupPrecedenceOrdinal2",
307
+ "groupPrecedenceOrdinal3",
308
+ "groupPrecedenceOrdinal4",
309
+ "groupPrecedenceOrdinal5",
310
+ "groupPrecedenceOrdinal6",
311
+ "groupPrecedenceOrdinal7",
312
+ "groupPrecedenceOrdinal8",
313
+ "groupPrecedenceOrdinal9",
314
+ "groupPrecedenceOrdinal10",
315
+ "groupPrecedenceOrdinalLast",
316
+ "groupColor1",
317
+ "groupColor2",
318
+ "groupColor3",
319
+ "unknown"
320
+ ],
321
+ sortBy: "name"
322
+ }
323
+ ],
324
+ "sort-sets": "error",
325
+ "sort-switch-case": "error",
326
+ "sort-union-types": "error",
327
+ "sort-variable-declarations": ["error", { partitionByComment: false }]
328
+ }
329
+ );
330
+
331
+ export default perfectionistRules;
@@ -0,0 +1,53 @@
1
+ import addPrefixToRules from "../_common/add-prefix-to-rules.js";
2
+
3
+ /**
4
+ * @import { Linter } from "eslint";
5
+ */
6
+
7
+ /**
8
+ * @satisfies {Linter.RulesRecord}
9
+ */
10
+ const promiseRules = addPrefixToRules(
11
+ "promise",
12
+ {
13
+ "always-return": [
14
+ "error",
15
+ {
16
+ ignoreAssignmentVariable: ["globalThis"],
17
+ ignoreLastCallback: false
18
+ }
19
+ ],
20
+ "avoid-new": "off",
21
+ "catch-or-return": [
22
+ "error",
23
+ {
24
+ allowFinally: false,
25
+ allowThen: false,
26
+ allowThenStrict: false,
27
+ terminationMethod: ["catch"]
28
+ }
29
+ ],
30
+ "no-callback-in-promise": "error",
31
+ "no-multiple-resolved": "error",
32
+ "no-native": "off",
33
+ "no-nesting": "error",
34
+ "no-new-statics": "error",
35
+ "no-promise-in-callback": ["error", { exemptDeclarations: false }],
36
+ "no-return-in-finally": "error",
37
+ "no-return-wrap": "error",
38
+ "param-names": [
39
+ "error",
40
+ {
41
+ rejectPattern: "^reject$",
42
+ resolvePattern: "^resolve$"
43
+ }
44
+ ],
45
+ "prefer-await-to-callbacks": "error",
46
+ "prefer-await-to-then": ["error", { strict: true }],
47
+ "prefer-catch": "error",
48
+ "spec-only": "error",
49
+ "valid-params": ["error", { exclude: [] }]
50
+ }
51
+ );
52
+
53
+ export default promiseRules;
@@ -0,0 +1,69 @@
1
+ import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
2
+
3
+ const coreRules = addPrefixToRules(
4
+ "@eslint-react",
5
+ {
6
+ "error-boundaries": "error",
7
+ "exhaustive-deps": "error",
8
+ globals: "error",
9
+ immutability: "error",
10
+ "no-access-state-in-setstate": "error",
11
+ "no-array-index-key": "error",
12
+ "no-children-count": "error",
13
+ "no-children-for-each": "error",
14
+ "no-children-map": "error",
15
+ "no-children-only": "error",
16
+ "no-children-to-array": "error",
17
+ "no-class-component": "error",
18
+ "no-clone-element": "error",
19
+ "no-component-will-mount": "error",
20
+ "no-component-will-receive-props": "error",
21
+ "no-component-will-update": "error",
22
+ "no-context-provider": "error",
23
+ "no-create-ref": "error",
24
+ "no-direct-mutation-state": "error",
25
+ "no-duplicate-key": "error",
26
+ "no-forward-ref": "error",
27
+ "no-implicit-children": "error",
28
+ "no-implicit-key": "error",
29
+ "no-implicit-ref": "error",
30
+ "no-leaked-conditional-rendering": "error",
31
+ "no-missing-component-display-name": "error",
32
+ "no-missing-context-display-name": "error",
33
+ "no-missing-key": "error",
34
+ "no-misused-capture-owner-stack": "error",
35
+ "no-nested-component-definitions": "error",
36
+ "no-nested-lazy-component-declarations": "error",
37
+ "no-set-state-in-component-did-mount": "error",
38
+ "no-set-state-in-component-did-update": "error",
39
+ "no-set-state-in-component-will-update": "error",
40
+ "no-unnecessary-use-prefix": "error",
41
+ "no-unsafe-component-will-mount": "error",
42
+ "no-unsafe-component-will-receive-props": "error",
43
+ "no-unsafe-component-will-update": "error",
44
+ "no-unstable-context-value": "error",
45
+ "no-unstable-default-props": "error",
46
+ "no-unused-class-component-members": "error",
47
+ "no-unused-props": "error",
48
+ "no-unused-state": "error",
49
+ "no-use-context": "error",
50
+ purity: "error",
51
+ refs: "error",
52
+ "rules-of-hooks": "error",
53
+ "set-state-in-effect": "error",
54
+ "set-state-in-render": "error",
55
+ "static-components": "error",
56
+ "unsupported-syntax": "error",
57
+ "use-memo": "error",
58
+ "use-state": [
59
+ "error",
60
+ {
61
+ enforceAssignment: true,
62
+ enforceLazyInitialization: true,
63
+ enforceSetterName: true
64
+ }
65
+ ]
66
+ }
67
+ );
68
+
69
+ export default coreRules;
@@ -0,0 +1,14 @@
1
+ import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
2
+
3
+ const debugRules = addPrefixToRules(
4
+ "@eslint-react/debug",
5
+ {
6
+ "function-component": "off",
7
+ hook: "off",
8
+ "is-from-react": "off",
9
+ "is-from-ref": "off",
10
+ jsx: "off"
11
+ }
12
+ );
13
+
14
+ export default debugRules;
@@ -0,0 +1,25 @@
1
+ import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
2
+
3
+ const domRules = addPrefixToRules(
4
+ "@eslint-react/dom",
5
+ {
6
+ "no-dangerously-set-innerhtml": "error",
7
+ "no-dangerously-set-innerhtml-with-children": "error",
8
+ "no-find-dom-node": "error",
9
+ "no-flush-sync": "error",
10
+ "no-hydrate": "error",
11
+ "no-missing-button-type": "error",
12
+ "no-missing-iframe-sandbox": "error",
13
+ "no-render": "error",
14
+ "no-render-return-value": "error",
15
+ "no-script-url": "error",
16
+ "no-string-style-prop": "error",
17
+ "no-unknown-property": "error",
18
+ "no-unsafe-iframe-sandbox": "error",
19
+ "no-unsafe-target-blank": "error",
20
+ "no-use-form-state": "error",
21
+ "no-void-elements-with-children": "error"
22
+ }
23
+ );
24
+
25
+ export default domRules;
@@ -0,0 +1,23 @@
1
+ import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
2
+
3
+ const jsxRules = addPrefixToRules(
4
+ "@eslint-react/jsx",
5
+ {
6
+ "no-children-prop": "error",
7
+ "no-children-prop-with-children": "error",
8
+ "no-comment-textnodes": "error",
9
+ "no-key-after-spread": "error",
10
+ "no-leaked-dollar": "error",
11
+ "no-leaked-semicolon": "error",
12
+ "no-namespace": "error",
13
+ "no-useless-fragment": [
14
+ "error",
15
+ {
16
+ allowEmptyFragment: false,
17
+ allowExpressions: true
18
+ }
19
+ ]
20
+ }
21
+ );
22
+
23
+ export default jsxRules;
@@ -0,0 +1,12 @@
1
+ import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
2
+
3
+ const namingConventionRules = addPrefixToRules(
4
+ "@eslint-react/naming-convention",
5
+ {
6
+ "context-name": "error",
7
+ "id-name": "error",
8
+ "ref-name": "off"
9
+ }
10
+ );
11
+
12
+ export default namingConventionRules;
@@ -0,0 +1,10 @@
1
+ import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
2
+
3
+ const rscRules = addPrefixToRules(
4
+ "@eslint-react/rsc",
5
+ {
6
+ "function-definition": "error"
7
+ }
8
+ );
9
+
10
+ export default rscRules;
@@ -0,0 +1,15 @@
1
+ import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
2
+
3
+ const webApiRules = addPrefixToRules(
4
+ "@eslint-react/web-api",
5
+ {
6
+ "no-leaked-event-listener": ["error"],
7
+ "no-leaked-fetch": ["error"],
8
+ "no-leaked-intersection-observer": ["error"],
9
+ "no-leaked-interval": ["error"],
10
+ "no-leaked-resize-observer": ["error"],
11
+ "no-leaked-timeout": ["error"]
12
+ }
13
+ );
14
+
15
+ export default webApiRules;
@@ -0,0 +1,28 @@
1
+ import {
2
+ coreRules,
3
+ debugRules,
4
+ domRules,
5
+ jsxRules,
6
+ namingConventionRules,
7
+ rscRules,
8
+ webApiRules
9
+ } from "./react/_exports.js";
10
+
11
+ /**
12
+ * @import { Linter } from "eslint";
13
+ */
14
+
15
+ /**
16
+ * @satisfies {Linter.RulesRecord}
17
+ */
18
+ const reactRules = {
19
+ ...coreRules,
20
+ ...debugRules,
21
+ ...domRules,
22
+ ...jsxRules,
23
+ ...namingConventionRules,
24
+ ...rscRules,
25
+ ...webApiRules
26
+ };
27
+
28
+ export default reactRules;
@@ -0,0 +1,47 @@
1
+ import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
2
+
3
+ const bestPracticesRules = addPrefixToRules(
4
+ "regexp",
5
+ {
6
+ "confusing-quantifier": "error",
7
+ "control-character-escape": "error",
8
+ negation: "error",
9
+ "no-dupe-characters-character-class": "error",
10
+ "no-empty-string-literal": "error",
11
+ "no-extra-lookaround-assertions": "error",
12
+ "no-invisible-character": "error",
13
+ "no-legacy-features": "error",
14
+ "no-non-standard-flag": "error",
15
+ "no-obscure-range": "error",
16
+ "no-octal": "error",
17
+ "no-standalone-backslash": "error",
18
+ "no-trivially-nested-assertion": "error",
19
+ "no-trivially-nested-quantifier": "error",
20
+ "no-unused-capturing-group": "error",
21
+ "no-useless-character-class": "error",
22
+ "no-useless-flag": "error",
23
+ "no-useless-lazy": "error",
24
+ "no-useless-quantifier": "error",
25
+ "no-useless-range": "error",
26
+ "no-useless-set-operand": "error",
27
+ "no-useless-string-literal": "error",
28
+ "no-useless-two-nums-quantifier": "error",
29
+ "no-zero-quantifier": "error",
30
+ "optimal-lookaround-quantifier": "error",
31
+ "optimal-quantifier-concatenation": "error",
32
+ "prefer-escape-replacement-dollar-char": "error",
33
+ "prefer-predefined-assertion": "error",
34
+ "prefer-quantifier": "error",
35
+ "prefer-range": "error",
36
+ "prefer-regexp-exec": "off",
37
+ "prefer-regexp-test": "off",
38
+ "prefer-set-operation": "error",
39
+ "require-unicode-regexp": "error",
40
+ "require-unicode-sets-regexp": "error",
41
+ "simplify-set-operations": "error",
42
+ "sort-alternatives": "error",
43
+ "use-ignore-case": "error"
44
+ }
45
+ );
46
+
47
+ export default bestPracticesRules;
@@ -0,0 +1,31 @@
1
+ import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
2
+
3
+ const possibleErrorsRules = addPrefixToRules(
4
+ "regexp",
5
+ {
6
+ "no-contradiction-with-assertion": "error",
7
+ "no-control-character": "error",
8
+ "no-dupe-disjunctions": "error",
9
+ "no-empty-alternative": "error",
10
+ "no-empty-capturing-group": "error",
11
+ "no-empty-character-class": "error",
12
+ "no-empty-group": "error",
13
+ "no-empty-lookarounds-assertion": "error",
14
+ "no-escape-backspace": "error",
15
+ "no-invalid-regexp": "error",
16
+ "no-lazy-ends": "error",
17
+ "no-misleading-capturing-group": "error",
18
+ "no-misleading-unicode-character": "error",
19
+ "no-missing-g-flag": "error",
20
+ "no-optional-assertion": "error",
21
+ "no-potentially-useless-backreference": "error",
22
+ "no-super-linear-backtracking": "error",
23
+ "no-super-linear-move": "error",
24
+ "no-useless-assertions": "error",
25
+ "no-useless-backreference": "error",
26
+ "no-useless-dollar-replacements": "error",
27
+ strict: "error"
28
+ }
29
+ );
30
+
31
+ export default possibleErrorsRules;