@autotelic/plumb 0.3.1 → 0.3.2

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 (266) hide show
  1. package/dist/effect/index.d.ts +3 -0
  2. package/dist/effect/index.js +56 -0
  3. package/dist/effect/rules/guarded-op-must-return-effect.d.ts +6 -0
  4. package/dist/effect/rules/guarded-op-must-return-effect.js +235 -0
  5. package/dist/effect/rules/guarded-op-must-return-option.d.ts +2 -0
  6. package/dist/effect/rules/guarded-op-must-return-option.js +88 -0
  7. package/dist/effect/rules/no-cascading-layer-provide.d.ts +6 -0
  8. package/dist/effect/rules/no-cascading-layer-provide.js +73 -0
  9. package/dist/effect/rules/no-decode-unknown-option.d.ts +7 -0
  10. package/dist/effect/rules/no-decode-unknown-option.js +34 -0
  11. package/dist/effect/rules/no-direct-browser-storage.d.ts +2 -0
  12. package/dist/effect/rules/no-direct-browser-storage.js +88 -0
  13. package/dist/effect/rules/no-direct-fetch.d.ts +2 -0
  14. package/dist/effect/rules/no-direct-fetch.js +37 -0
  15. package/dist/effect/rules/no-manual-field-guards.d.ts +6 -0
  16. package/dist/effect/rules/no-manual-field-guards.js +129 -0
  17. package/dist/effect/rules/no-nested-layer-provide.d.ts +2 -0
  18. package/dist/effect/rules/no-nested-layer-provide.js +50 -0
  19. package/dist/effect/rules/no-schema-class-modeling.d.ts +2 -0
  20. package/dist/effect/rules/no-schema-class-modeling.js +52 -0
  21. package/dist/effect/rules/no-service-constructor-imports.d.ts +2 -0
  22. package/dist/effect/rules/no-service-constructor-imports.js +42 -0
  23. package/dist/effect/rules/no-silent-error-swallow.d.ts +2 -0
  24. package/dist/effect/rules/no-silent-error-swallow.js +95 -0
  25. package/dist/effect/rules/no-static-effect-service-forwarders.d.ts +6 -0
  26. package/dist/effect/rules/no-static-effect-service-forwarders.js +222 -0
  27. package/dist/effect/rules/no-try-catch.d.ts +2 -0
  28. package/dist/effect/rules/no-try-catch.js +30 -0
  29. package/dist/effect/rules/no-unguarded-json-parse.d.ts +5 -0
  30. package/dist/effect/rules/no-unguarded-json-parse.js +200 -0
  31. package/dist/effect/rules/option-core-needs-effect-public.d.ts +5 -0
  32. package/dist/effect/rules/option-core-needs-effect-public.js +76 -0
  33. package/dist/effect/rules/prefer-die-for-precondition-defects.d.ts +5 -0
  34. package/dist/effect/rules/prefer-die-for-precondition-defects.js +112 -0
  35. package/dist/effect/rules/prefer-effect-gen-for-guard-ladders.d.ts +5 -0
  36. package/dist/effect/rules/prefer-effect-gen-for-guard-ladders.js +72 -0
  37. package/dist/effect/rules/prefer-effect-match.d.ts +2 -0
  38. package/dist/effect/rules/prefer-effect-match.js +74 -0
  39. package/dist/effect/rules/prefer-effect-predicate-over-boolean-function.d.ts +2 -0
  40. package/dist/effect/rules/prefer-effect-predicate-over-boolean-function.js +75 -0
  41. package/dist/effect/rules/prefer-named-guard-predicate.d.ts +2 -0
  42. package/dist/effect/rules/prefer-named-guard-predicate.js +93 -0
  43. package/dist/effect/rules/prefer-option-pipeline.d.ts +2 -0
  44. package/dist/effect/rules/prefer-option-pipeline.js +87 -0
  45. package/dist/effect/rules/prefer-ordering-match.d.ts +2 -0
  46. package/dist/effect/rules/prefer-ordering-match.js +135 -0
  47. package/dist/effect/rules/prefer-tagged-enum.d.ts +2 -0
  48. package/dist/effect/rules/prefer-tagged-enum.js +66 -0
  49. package/dist/effect/rules/require-schema-type-derivation.d.ts +7 -0
  50. package/dist/effect/rules/require-schema-type-derivation.js +80 -0
  51. package/dist/index.d.ts +3 -0
  52. package/dist/index.js +102 -0
  53. package/dist/meta/index.d.ts +7 -0
  54. package/{src/meta/index.ts → dist/meta/index.js} +13 -16
  55. package/dist/meta/rules/no-disable-directives.d.ts +6 -0
  56. package/dist/meta/rules/no-disable-directives.js +35 -0
  57. package/dist/meta/rules/no-manual-ancestor-walks.d.ts +2 -0
  58. package/dist/meta/rules/no-manual-ancestor-walks.js +26 -0
  59. package/dist/meta/rules/prefer-before-file-scope.d.ts +2 -0
  60. package/dist/meta/rules/prefer-before-file-scope.js +57 -0
  61. package/dist/meta/rules/require-create-once.d.ts +2 -0
  62. package/dist/meta/rules/require-create-once.js +51 -0
  63. package/dist/meta/rules/require-rule-tester.d.ts +2 -0
  64. package/dist/meta/rules/require-rule-tester.js +50 -0
  65. package/dist/rules/no-anonymous-wide-tuples.d.ts +7 -0
  66. package/dist/rules/no-anonymous-wide-tuples.js +34 -0
  67. package/dist/rules/no-barrel-export-star.d.ts +2 -0
  68. package/dist/rules/no-barrel-export-star.js +26 -0
  69. package/dist/rules/no-boolean-field-signals.d.ts +2 -0
  70. package/dist/rules/no-boolean-field-signals.js +279 -0
  71. package/dist/rules/no-builtin-throws.d.ts +6 -0
  72. package/dist/rules/no-builtin-throws.js +74 -0
  73. package/dist/rules/no-chained-type-assertions.d.ts +2 -0
  74. package/dist/rules/no-chained-type-assertions.js +54 -0
  75. package/dist/rules/no-conditional-empty-object-spread.d.ts +2 -0
  76. package/dist/rules/no-conditional-empty-object-spread.js +36 -0
  77. package/dist/rules/no-duplicated-literal-union.d.ts +6 -0
  78. package/dist/rules/no-duplicated-literal-union.js +62 -0
  79. package/dist/rules/no-exported-mutable-state.d.ts +7 -0
  80. package/dist/rules/no-exported-mutable-state.js +104 -0
  81. package/dist/rules/no-generic-export-names.d.ts +2 -0
  82. package/dist/rules/no-generic-export-names.js +141 -0
  83. package/dist/rules/no-impossible-branch-throw.d.ts +2 -0
  84. package/dist/rules/no-impossible-branch-throw.js +51 -0
  85. package/dist/rules/no-known-value-widening.d.ts +2 -0
  86. package/dist/rules/no-known-value-widening.js +176 -0
  87. package/dist/rules/no-module-mocking.d.ts +2 -0
  88. package/dist/rules/no-module-mocking.js +90 -0
  89. package/dist/rules/no-multiple-function-params.d.ts +2 -0
  90. package/dist/rules/no-multiple-function-params.js +155 -0
  91. package/dist/rules/no-nondeterministic-core.d.ts +6 -0
  92. package/dist/rules/no-nondeterministic-core.js +63 -0
  93. package/dist/rules/no-object-parameters.d.ts +2 -0
  94. package/dist/rules/no-object-parameters.js +95 -0
  95. package/dist/rules/no-optional-function-parameters.d.ts +7 -0
  96. package/dist/rules/no-optional-function-parameters.js +44 -0
  97. package/dist/rules/no-product-of-state-booleans.d.ts +2 -0
  98. package/dist/rules/no-product-of-state-booleans.js +79 -0
  99. package/dist/rules/no-redundant-derived-field.d.ts +6 -0
  100. package/dist/rules/no-redundant-derived-field.js +194 -0
  101. package/dist/rules/no-reflect-apply.d.ts +2 -0
  102. package/dist/rules/no-reflect-apply.js +29 -0
  103. package/dist/rules/no-reflect-get.d.ts +2 -0
  104. package/dist/rules/no-reflect-get.js +29 -0
  105. package/dist/rules/no-reinterpret-cast.d.ts +2 -0
  106. package/dist/rules/no-reinterpret-cast.js +68 -0
  107. package/dist/rules/no-runtime-typeof.d.ts +2 -0
  108. package/dist/rules/no-runtime-typeof.js +54 -0
  109. package/dist/rules/no-sentinel-comparison-union.d.ts +2 -0
  110. package/dist/rules/no-sentinel-comparison-union.js +139 -0
  111. package/dist/rules/no-shape-in-symbol-names.d.ts +2 -0
  112. package/dist/rules/no-shape-in-symbol-names.js +39 -0
  113. package/dist/rules/no-single-use-private-functions.d.ts +6 -0
  114. package/dist/rules/no-single-use-private-functions.js +295 -0
  115. package/dist/rules/no-stacked-jsdoc-blocks.d.ts +2 -0
  116. package/dist/rules/no-stacked-jsdoc-blocks.js +50 -0
  117. package/dist/rules/no-stray-inline-comments.d.ts +2 -0
  118. package/dist/rules/no-stray-inline-comments.js +74 -0
  119. package/dist/rules/no-swappable-primitive-params.d.ts +2 -0
  120. package/dist/rules/no-swappable-primitive-params.js +96 -0
  121. package/dist/rules/no-tag-ladder-assertions.d.ts +6 -0
  122. package/dist/rules/no-tag-ladder-assertions.js +63 -0
  123. package/dist/rules/no-transposed-field-reads.d.ts +8 -0
  124. package/dist/rules/no-transposed-field-reads.js +101 -0
  125. package/dist/rules/no-unit-return-validators.d.ts +2 -0
  126. package/dist/rules/no-unit-return-validators.js +64 -0
  127. package/dist/rules/no-unknown-parameters.d.ts +2 -0
  128. package/dist/rules/no-unknown-parameters.js +82 -0
  129. package/dist/rules/no-unknown-returns.d.ts +2 -0
  130. package/dist/rules/no-unknown-returns.js +86 -0
  131. package/dist/rules/no-unknown-type-aliases.d.ts +2 -0
  132. package/dist/rules/no-unknown-type-aliases.js +64 -0
  133. package/dist/rules/no-unsafe-dictionary-type.d.ts +2 -0
  134. package/dist/rules/no-unsafe-dictionary-type.js +116 -0
  135. package/dist/rules/no-vague-test-filenames.d.ts +2 -0
  136. package/dist/rules/no-vague-test-filenames.js +61 -0
  137. package/dist/rules/no-widen-then-assert.d.ts +2 -0
  138. package/dist/rules/no-widen-then-assert.js +268 -0
  139. package/dist/rules/prefer-payload-brand.d.ts +2 -0
  140. package/dist/rules/prefer-payload-brand.js +57 -0
  141. package/dist/rules/prefer-property-tests.d.ts +5 -0
  142. package/dist/rules/prefer-property-tests.js +39 -0
  143. package/dist/rules/require-canonical-stringify-for-identity.d.ts +8 -0
  144. package/dist/rules/require-canonical-stringify-for-identity.js +72 -0
  145. package/dist/rules/require-deprecated-tag-for-legacy-comments.d.ts +2 -0
  146. package/dist/rules/require-deprecated-tag-for-legacy-comments.js +34 -0
  147. package/dist/rules/require-exhaustive-tag-switch.d.ts +7 -0
  148. package/dist/rules/require-exhaustive-tag-switch.js +34 -0
  149. package/dist/rules/require-fc-block-predicate.d.ts +2 -0
  150. package/dist/rules/require-fc-block-predicate.js +37 -0
  151. package/dist/rules/require-jsdoc-on-exported.d.ts +2 -0
  152. package/dist/rules/require-jsdoc-on-exported.js +66 -0
  153. package/dist/rules/require-published-order.d.ts +2 -0
  154. package/dist/rules/require-published-order.js +102 -0
  155. package/dist/rules/require-safety-comment-for-type-assertion.d.ts +2 -0
  156. package/dist/rules/require-safety-comment-for-type-assertion.js +53 -0
  157. package/dist/rules/require-sort-comparator.d.ts +7 -0
  158. package/dist/rules/require-sort-comparator.js +34 -0
  159. package/dist/rules/test-utils.d.ts +35 -0
  160. package/dist/rules/test-utils.js +53 -0
  161. package/{src/shared/ancestors.ts → dist/shared/ancestors.d.ts} +1 -4
  162. package/dist/shared/ancestors.js +19 -0
  163. package/dist/shared/child-nodes.d.ts +12 -0
  164. package/dist/shared/child-nodes.js +26 -0
  165. package/dist/shared/dictionary-types.d.ts +55 -0
  166. package/dist/shared/dictionary-types.js +413 -0
  167. package/{src/shared/is-node.ts → dist/shared/is-node.d.ts} +2 -6
  168. package/dist/shared/is-node.js +10 -0
  169. package/dist/shared/lexical-type-parameters.d.ts +12 -0
  170. package/dist/shared/lexical-type-parameters.js +50 -0
  171. package/dist/shared/reflect-method.d.ts +15 -0
  172. package/dist/shared/reflect-method.js +32 -0
  173. package/{src/shared/rule-options.ts → dist/shared/rule-options.d.ts} +2 -7
  174. package/dist/shared/rule-options.js +12 -0
  175. package/{src/shared/structural.ts → dist/shared/structural.d.ts} +17 -44
  176. package/dist/shared/structural.js +40 -0
  177. package/{src/testing/index.ts → dist/testing/index.d.ts} +0 -1
  178. package/dist/testing/index.js +1 -0
  179. package/dist/testing/testable-rule.d.ts +38 -0
  180. package/dist/testing/testable-rule.js +70 -0
  181. package/package.json +7 -6
  182. package/src/effect/index.ts +0 -59
  183. package/src/effect/rules/guarded-op-must-return-effect.ts +0 -236
  184. package/src/effect/rules/guarded-op-must-return-option.ts +0 -97
  185. package/src/effect/rules/no-cascading-layer-provide.ts +0 -80
  186. package/src/effect/rules/no-decode-unknown-option.ts +0 -41
  187. package/src/effect/rules/no-direct-browser-storage.ts +0 -91
  188. package/src/effect/rules/no-direct-fetch.ts +0 -44
  189. package/src/effect/rules/no-manual-field-guards.ts +0 -144
  190. package/src/effect/rules/no-nested-layer-provide.ts +0 -51
  191. package/src/effect/rules/no-schema-class-modeling.ts +0 -59
  192. package/src/effect/rules/no-service-constructor-imports.ts +0 -50
  193. package/src/effect/rules/no-silent-error-swallow.ts +0 -99
  194. package/src/effect/rules/no-static-effect-service-forwarders.ts +0 -227
  195. package/src/effect/rules/no-try-catch.ts +0 -32
  196. package/src/effect/rules/no-unguarded-json-parse.ts +0 -211
  197. package/src/effect/rules/option-core-needs-effect-public.ts +0 -81
  198. package/src/effect/rules/prefer-die-for-precondition-defects.ts +0 -118
  199. package/src/effect/rules/prefer-effect-gen-for-guard-ladders.ts +0 -76
  200. package/src/effect/rules/prefer-effect-match.ts +0 -78
  201. package/src/effect/rules/prefer-effect-predicate-over-boolean-function.ts +0 -79
  202. package/src/effect/rules/prefer-named-guard-predicate.ts +0 -105
  203. package/src/effect/rules/prefer-option-pipeline.ts +0 -95
  204. package/src/effect/rules/prefer-ordering-match.ts +0 -152
  205. package/src/effect/rules/prefer-tagged-enum.ts +0 -68
  206. package/src/effect/rules/require-schema-type-derivation.ts +0 -83
  207. package/src/index.ts +0 -106
  208. package/src/meta/rules/no-disable-directives.ts +0 -38
  209. package/src/meta/rules/no-manual-ancestor-walks.ts +0 -27
  210. package/src/meta/rules/prefer-before-file-scope.ts +0 -57
  211. package/src/meta/rules/require-create-once.ts +0 -51
  212. package/src/meta/rules/require-rule-tester.ts +0 -57
  213. package/src/rules/no-anonymous-wide-tuples.ts +0 -38
  214. package/src/rules/no-barrel-export-star.ts +0 -30
  215. package/src/rules/no-boolean-field-signals.ts +0 -305
  216. package/src/rules/no-builtin-throws.ts +0 -83
  217. package/src/rules/no-chained-type-assertions.ts +0 -65
  218. package/src/rules/no-conditional-empty-object-spread.ts +0 -42
  219. package/src/rules/no-duplicated-literal-union.ts +0 -66
  220. package/src/rules/no-exported-mutable-state.ts +0 -111
  221. package/src/rules/no-generic-export-names.ts +0 -149
  222. package/src/rules/no-impossible-branch-throw.ts +0 -55
  223. package/src/rules/no-known-value-widening.ts +0 -225
  224. package/src/rules/no-module-mocking.ts +0 -95
  225. package/src/rules/no-multiple-function-params.ts +0 -192
  226. package/src/rules/no-nondeterministic-core.ts +0 -73
  227. package/src/rules/no-object-parameters.ts +0 -127
  228. package/src/rules/no-optional-function-parameters.ts +0 -49
  229. package/src/rules/no-product-of-state-booleans.ts +0 -80
  230. package/src/rules/no-redundant-derived-field.ts +0 -192
  231. package/src/rules/no-reflect-apply.ts +0 -32
  232. package/src/rules/no-reflect-get.ts +0 -32
  233. package/src/rules/no-reinterpret-cast.ts +0 -78
  234. package/src/rules/no-runtime-typeof.ts +0 -59
  235. package/src/rules/no-sentinel-comparison-union.ts +0 -148
  236. package/src/rules/no-shape-in-symbol-names.ts +0 -45
  237. package/src/rules/no-single-use-private-functions.ts +0 -329
  238. package/src/rules/no-stacked-jsdoc-blocks.ts +0 -65
  239. package/src/rules/no-stray-inline-comments.ts +0 -79
  240. package/src/rules/no-swappable-primitive-params.ts +0 -109
  241. package/src/rules/no-tag-ladder-assertions.ts +0 -71
  242. package/src/rules/no-transposed-field-reads.ts +0 -135
  243. package/src/rules/no-unit-return-validators.ts +0 -65
  244. package/src/rules/no-unknown-parameters.ts +0 -97
  245. package/src/rules/no-unknown-returns.ts +0 -120
  246. package/src/rules/no-unknown-type-aliases.ts +0 -70
  247. package/src/rules/no-unsafe-dictionary-type.ts +0 -132
  248. package/src/rules/no-vague-test-filenames.ts +0 -67
  249. package/src/rules/no-widen-then-assert.ts +0 -345
  250. package/src/rules/prefer-payload-brand.ts +0 -67
  251. package/src/rules/prefer-property-tests.ts +0 -43
  252. package/src/rules/require-canonical-stringify-for-identity.ts +0 -80
  253. package/src/rules/require-deprecated-tag-for-legacy-comments.ts +0 -45
  254. package/src/rules/require-exhaustive-tag-switch.ts +0 -42
  255. package/src/rules/require-fc-block-predicate.ts +0 -42
  256. package/src/rules/require-jsdoc-on-exported.ts +0 -74
  257. package/src/rules/require-published-order.ts +0 -109
  258. package/src/rules/require-safety-comment-for-type-assertion.ts +0 -61
  259. package/src/rules/require-sort-comparator.ts +0 -41
  260. package/src/rules/test-utils.ts +0 -68
  261. package/src/shared/child-nodes.ts +0 -27
  262. package/src/shared/dictionary-types.ts +0 -524
  263. package/src/shared/lexical-type-parameters.ts +0 -62
  264. package/src/shared/reflect-method.ts +0 -41
  265. package/src/testing/testable-rule.test.ts +0 -68
  266. package/src/testing/testable-rule.ts +0 -86
@@ -0,0 +1,268 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ import { ancestorsOf } from "../shared/ancestors.js";
3
+ const functionBoundaryTypes = new Set([
4
+ "ArrowFunctionExpression",
5
+ "FunctionDeclaration",
6
+ "FunctionExpression",
7
+ "TSDeclareFunction",
8
+ "TSEmptyBodyFunctionExpression",
9
+ ]);
10
+ function unwrapExpressionParentheses(expression) {
11
+ let current = expression;
12
+ while (current.type === "ParenthesizedExpression")
13
+ current = current.expression;
14
+ return current;
15
+ }
16
+ function unwrapTypeParentheses(type) {
17
+ let current = type;
18
+ while (current.type === "TSParenthesizedType")
19
+ current = current.typeAnnotation;
20
+ return current;
21
+ }
22
+ function typeReferenceName(type) {
23
+ return type.typeName.type === "Identifier" ? type.typeName.name : null;
24
+ }
25
+ function isUnknownOrAnyType(type) {
26
+ const unwrapped = unwrapTypeParentheses(type);
27
+ return unwrapped.type === "TSUnknownKeyword" || unwrapped.type === "TSAnyKeyword";
28
+ }
29
+ function isBroadRecordKeyType(type) {
30
+ const unwrapped = unwrapTypeParentheses(type);
31
+ if (unwrapped.type === "TSStringKeyword" ||
32
+ unwrapped.type === "TSNumberKeyword" ||
33
+ unwrapped.type === "TSSymbolKeyword") {
34
+ return true;
35
+ }
36
+ if (unwrapped.type === "TSUnionType")
37
+ return unwrapped.types.every(isBroadRecordKeyType);
38
+ return unwrapped.type === "TSTypeReference" && typeReferenceName(unwrapped) === "PropertyKey";
39
+ }
40
+ function isBroadRecordType(type) {
41
+ const unwrapped = unwrapTypeParentheses(type);
42
+ if (unwrapped.type === "TSTypeReference") {
43
+ if (typeReferenceName(unwrapped) === "Readonly") {
44
+ const [inner] = unwrapped.typeArguments?.params ?? [];
45
+ return inner !== undefined && isBroadRecordType(inner);
46
+ }
47
+ if (typeReferenceName(unwrapped) !== "Record")
48
+ return false;
49
+ const parameters = unwrapped.typeArguments?.params ?? [];
50
+ return (parameters.length === 2 &&
51
+ parameters[0] !== undefined &&
52
+ parameters[1] !== undefined &&
53
+ isBroadRecordKeyType(parameters[0]) &&
54
+ isUnknownOrAnyType(parameters[1]));
55
+ }
56
+ if (unwrapped.type !== "TSTypeLiteral" || unwrapped.members.length !== 1)
57
+ return false;
58
+ const [member] = unwrapped.members;
59
+ const [parameter] = member?.type === "TSIndexSignature" ? member.parameters : [];
60
+ return (member?.type === "TSIndexSignature" &&
61
+ member.parameters.length === 1 &&
62
+ parameter !== undefined &&
63
+ isBroadRecordKeyType(parameter.typeAnnotation.typeAnnotation) &&
64
+ isUnknownOrAnyType(member.typeAnnotation.typeAnnotation));
65
+ }
66
+ function broadTypeKind(type) {
67
+ const unwrapped = unwrapTypeParentheses(type);
68
+ if (unwrapped.type === "TSUnknownKeyword" || unwrapped.type === "TSAnyKeyword")
69
+ return "top";
70
+ if (unwrapped.type === "TSObjectKeyword")
71
+ return "object";
72
+ return isBroadRecordType(unwrapped) ? "record" : null;
73
+ }
74
+ function assertedExpression(node) {
75
+ return unwrapExpressionParentheses(node.expression);
76
+ }
77
+ function isDefinitelyObjectType(type) {
78
+ const unwrapped = unwrapTypeParentheses(type);
79
+ switch (unwrapped.type) {
80
+ case "TSArrayType":
81
+ case "TSConstructorType":
82
+ case "TSFunctionType":
83
+ case "TSMappedType":
84
+ case "TSObjectKeyword":
85
+ case "TSTupleType":
86
+ return true;
87
+ case "TSTypeLiteral":
88
+ return unwrapped.members.length > 0;
89
+ case "TSIntersectionType":
90
+ return unwrapped.types.every(isDefinitelyObjectType);
91
+ case "TSTypeOperator":
92
+ return unwrapped.operator === "readonly" && isDefinitelyObjectType(unwrapped.typeAnnotation);
93
+ default:
94
+ return false;
95
+ }
96
+ }
97
+ function isDefinitelyNarrowerRecordType(type) {
98
+ const unwrapped = unwrapTypeParentheses(type);
99
+ if (unwrapped.type === "TSTypeLiteral") {
100
+ return unwrapped.members.some((member) => member.type !== "TSIndexSignature");
101
+ }
102
+ if (unwrapped.type !== "TSTypeReference")
103
+ return false;
104
+ if (typeReferenceName(unwrapped) === "Readonly") {
105
+ const [inner] = unwrapped.typeArguments?.params ?? [];
106
+ return inner !== undefined && isDefinitelyNarrowerRecordType(inner);
107
+ }
108
+ if (typeReferenceName(unwrapped) !== "Record")
109
+ return false;
110
+ const parameters = unwrapped.typeArguments?.params ?? [];
111
+ return (parameters.length === 2 && parameters[1] !== undefined && !isUnknownOrAnyType(parameters[1]));
112
+ }
113
+ function functionBoundary(sourceCode, node) {
114
+ const ancestors = ancestorsOf(sourceCode, node);
115
+ for (let index = ancestors.length - 1; index >= 0; index--) {
116
+ const current = ancestors[index];
117
+ if (current.type === "Program")
118
+ break;
119
+ if (functionBoundaryTypes.has(current.type))
120
+ return current;
121
+ }
122
+ return null;
123
+ }
124
+ function resolvedVariableForIdentifier(scopes, identifier) {
125
+ for (const scope of scopes) {
126
+ const reference = scope.references.find((candidate) => candidate.identifier.start === identifier.start &&
127
+ candidate.identifier.end === identifier.end);
128
+ if (reference !== undefined)
129
+ return reference.resolved;
130
+ }
131
+ return null;
132
+ }
133
+ function variableDeclarator(variable) {
134
+ for (const definition of variable.defs) {
135
+ if (definition.type === "Variable" && definition.node.type === "VariableDeclarator") {
136
+ return definition.node;
137
+ }
138
+ }
139
+ return null;
140
+ }
141
+ function knownValueEvidence(sourceCode, expression, scopes, boundary, visitedVariables) {
142
+ const unwrapped = unwrapExpressionParentheses(expression);
143
+ if (unwrapped.type === "TSAsExpression" || unwrapped.type === "TSTypeAssertion") {
144
+ if (broadTypeKind(unwrapped.typeAnnotation) !== null)
145
+ return null;
146
+ return { type: unwrapped.typeAnnotation };
147
+ }
148
+ if (unwrapped.type === "Literal" || unwrapped.type === "TemplateLiteral") {
149
+ return { type: null };
150
+ }
151
+ if (unwrapped.type === "ArrayExpression" ||
152
+ unwrapped.type === "ArrowFunctionExpression" ||
153
+ unwrapped.type === "ClassExpression" ||
154
+ unwrapped.type === "FunctionExpression" ||
155
+ unwrapped.type === "NewExpression" ||
156
+ unwrapped.type === "ObjectExpression") {
157
+ return { type: null };
158
+ }
159
+ if (unwrapped.type !== "Identifier")
160
+ return null;
161
+ const variable = resolvedVariableForIdentifier(scopes, unwrapped);
162
+ if (variable === null || visitedVariables.has(variable))
163
+ return null;
164
+ const annotatedIdentifier = variable.identifiers.find((identifier) => identifier.typeAnnotation !== null && identifier.typeAnnotation !== undefined);
165
+ const annotation = annotatedIdentifier?.typeAnnotation?.typeAnnotation;
166
+ if (annotation !== undefined && annotatedIdentifier !== undefined) {
167
+ if (functionBoundary(sourceCode, annotatedIdentifier) !== boundary || broadTypeKind(annotation) !== null) {
168
+ return null;
169
+ }
170
+ return { type: annotation };
171
+ }
172
+ const declarator = variableDeclarator(variable);
173
+ const declaration = declarator === null ? null : ancestorsOf(sourceCode, declarator).at(-1);
174
+ if (declarator === null ||
175
+ declaration === null ||
176
+ declaration?.type !== "VariableDeclaration" ||
177
+ declaration?.kind !== "const" ||
178
+ declarator.init === null ||
179
+ variable.references.some((reference) => reference.isWrite() && !reference.init) ||
180
+ functionBoundary(sourceCode, declarator) !== boundary) {
181
+ return null;
182
+ }
183
+ return knownValueEvidence(sourceCode, declarator.init, scopes, boundary, new Set([...visitedVariables, variable]));
184
+ }
185
+ /** Detect immutable local bindings that erase a known type and are later asserted back to a narrower type. */
186
+ export const noWidenThenAssertRule = defineRule({
187
+ meta: {
188
+ type: "problem",
189
+ docs: {
190
+ description: "Disallow local const flows that explicitly widen a known value before asserting the widened binding to a narrower type.",
191
+ },
192
+ messages: {
193
+ widenThenAssert: 'Binding "{{name}}" discards type evidence and later recreates it with an assertion. Keep the precise type from initialization through use; parse boundary input once.',
194
+ },
195
+ },
196
+ createOnce(context) {
197
+ let scopes = [];
198
+ const checkAssertion = (node) => {
199
+ const expression = assertedExpression(node);
200
+ if (expression.type !== "Identifier")
201
+ return;
202
+ const variable = resolvedVariableForIdentifier(scopes, expression);
203
+ if (variable === null)
204
+ return;
205
+ const declarator = variableDeclarator(variable);
206
+ const declaration = declarator === null ? null : ancestorsOf(context.sourceCode, declarator).at(-1);
207
+ if (declarator === null ||
208
+ declaration === null ||
209
+ declaration?.type !== "VariableDeclaration" ||
210
+ declaration?.kind !== "const" ||
211
+ declarator.id.type !== "Identifier" ||
212
+ declarator.init === null ||
213
+ variable.references.some((reference) => reference.isWrite() && !reference.init)) {
214
+ return;
215
+ }
216
+ const boundary = functionBoundary(context.sourceCode, declarator);
217
+ const declaredType = declarator.id.typeAnnotation?.typeAnnotation;
218
+ const initializerUnwrapped = unwrapExpressionParentheses(declarator.init);
219
+ const initializerAssertion = initializerUnwrapped.type === "TSAsExpression" || initializerUnwrapped.type === "TSTypeAssertion"
220
+ ? initializerUnwrapped
221
+ : null;
222
+ const initializerBroadKind = initializerAssertion === null ? null : broadTypeKind(initializerAssertion.typeAnnotation);
223
+ const declaredBroadKind = declaredType === undefined ? null : broadTypeKind(declaredType);
224
+ const broadKind = declaredBroadKind ?? initializerBroadKind;
225
+ if (broadKind === null)
226
+ return;
227
+ const originalExpression = initializerAssertion !== null && initializerBroadKind !== null
228
+ ? assertedExpression(initializerAssertion)
229
+ : declarator.init;
230
+ const evidence = knownValueEvidence(context.sourceCode, originalExpression, scopes, boundary, new Set([variable]));
231
+ if (evidence === null)
232
+ return;
233
+ if (node.start <= declarator.end || functionBoundary(context.sourceCode, node) !== boundary) {
234
+ return;
235
+ }
236
+ const assertedType = node.typeAnnotation;
237
+ if (broadTypeKind(assertedType) !== null)
238
+ return;
239
+ if (broadKind !== "top") {
240
+ const normalized = (type) => context.sourceCode.text.slice(type.start, type.end).replaceAll(/\s+/gu, "");
241
+ const sameSyntax = evidence.type !== null &&
242
+ normalized(unwrapTypeParentheses(evidence.type)) ===
243
+ normalized(unwrapTypeParentheses(assertedType));
244
+ if (!sameSyntax) {
245
+ if (broadKind === "object") {
246
+ if (!isDefinitelyObjectType(assertedType))
247
+ return;
248
+ }
249
+ else if (!isDefinitelyNarrowerRecordType(assertedType)) {
250
+ return;
251
+ }
252
+ }
253
+ }
254
+ context.report({
255
+ node,
256
+ messageId: "widenThenAssert",
257
+ data: { name: expression.name },
258
+ });
259
+ };
260
+ return {
261
+ Program() {
262
+ scopes = context.sourceCode.scopeManager.scopes;
263
+ },
264
+ TSAsExpression: checkAssertion,
265
+ TSTypeAssertion: checkAssertion,
266
+ };
267
+ },
268
+ });
@@ -0,0 +1,2 @@
1
+ /** Opaque brand interfaces hide their payload behind casts; carry the payload in the brand. */
2
+ export declare const preferPayloadBrandRule: import("@oxlint/plugins").Rule;
@@ -0,0 +1,57 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ /** True for a heritage clause referencing Brand.Brand (any ESTree spelling).
3
+ *
4
+ * @param {ESTree.TSTypeName | ESTree.Expression | ESTree.PrivateIdentifier} expression - Heritage clause expression.
5
+ * @returns {boolean} True when the expression is the Brand.Brand reference.
6
+ */
7
+ function isBrandBrandReference(expression) {
8
+ if (expression.type === "TSQualifiedName") {
9
+ return (expression.left.type === "Identifier" &&
10
+ expression.left.name === "Brand" &&
11
+ expression.right.type === "Identifier" &&
12
+ expression.right.name === "Brand");
13
+ }
14
+ if (expression.type === "MemberExpression") {
15
+ return (expression.object.type === "Identifier" &&
16
+ expression.object.name === "Brand" &&
17
+ expression.property.type === "Identifier" &&
18
+ expression.property.name === "Brand");
19
+ }
20
+ return false;
21
+ }
22
+ /** Opaque brand interfaces hide their payload behind casts; carry the payload in the brand. */
23
+ export const preferPayloadBrandRule = defineRule({
24
+ meta: {
25
+ type: "problem",
26
+ docs: {
27
+ description: "Prefer payload-carrying brands (type X = Base & Brand.Brand<\"X\">) over opaque brand interfaces so the payload stays recoverable without type assertions.",
28
+ },
29
+ messages: {
30
+ opaqueBrand: "Opaque brand interface `{{name}}` hides its payload behind casts. Carry the payload in the brand instead: `type {{name}} = Base & Brand.Brand<\"{{name}}\">` with a cast-free `un{{name}}` accessor.",
31
+ },
32
+ },
33
+ createOnce(context) {
34
+ return {
35
+ Program(node) {
36
+ for (const statement of node.body) {
37
+ const declaration = statement.type === "ExportNamedDeclaration" ||
38
+ statement.type === "ExportDefaultDeclaration"
39
+ ? (statement.declaration ?? null)
40
+ : statement;
41
+ if (declaration?.type !== "TSInterfaceDeclaration")
42
+ continue;
43
+ const heritages = declaration.extends ?? [];
44
+ if (heritages.length !== 1)
45
+ continue;
46
+ if (!isBrandBrandReference(heritages[0].expression))
47
+ continue;
48
+ context.report({
49
+ node: declaration.id,
50
+ messageId: "opaqueBrand",
51
+ data: { name: declaration.id.name },
52
+ });
53
+ }
54
+ },
55
+ };
56
+ },
57
+ });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * We default to property-based testing: a test suite without fast-check only
3
+ * pins examples. Escape hatch is an explicit inline disable with a reason.
4
+ */
5
+ export declare const preferPropertyTestsRule: import("@oxlint/plugins").Rule;
@@ -0,0 +1,39 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ const TEST_FILE = /\.(?:test|spec)\.[cm]?[jt]sx?$/u;
3
+ /**
4
+ * We default to property-based testing: a test suite without fast-check only
5
+ * pins examples. Escape hatch is an explicit inline disable with a reason.
6
+ */
7
+ export const preferPropertyTestsRule = defineRule({
8
+ meta: {
9
+ type: "suggestion",
10
+ docs: {
11
+ description: "Require `fast-check` in every test file; suites that genuinely cannot use properties must disable this rule inline with a justification.",
12
+ },
13
+ messages: {
14
+ useFastCheck: "No `fast-check` import: this suite only exercises hand-picked examples. Add property-based coverage (generate inputs, assert invariants), or disable this rule inline with a reason if the behavior is truly non-property-testable.",
15
+ },
16
+ },
17
+ createOnce(context) {
18
+ let program = null;
19
+ let sawFastCheck = false;
20
+ return {
21
+ before() {
22
+ if (!TEST_FILE.test(context.filename.replaceAll("\\", "/")))
23
+ return false;
24
+ },
25
+ Program(node) {
26
+ program = node;
27
+ },
28
+ ImportDeclaration(node) {
29
+ if (node.source.value === "fast-check")
30
+ sawFastCheck = true;
31
+ },
32
+ "Program:exit"() {
33
+ if (!sawFastCheck && program !== null) {
34
+ context.report({ node: program, messageId: "useFastCheck" });
35
+ }
36
+ },
37
+ };
38
+ },
39
+ });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Canonical form: JSON.stringify walks insertion order, so structurally
3
+ * equal data can serialise to different strings depending on construction
4
+ * history. As an identity function (comparison, Map/Set key, hash input),
5
+ * that is a false-negative machine. Only a canonical (key-sorted)
6
+ * serializer may stand in for structural equality there.
7
+ */
8
+ export declare const requireCanonicalStringifyForIdentityRule: import("@oxlint/plugins").Rule;
@@ -0,0 +1,72 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ import { ancestorsOf } from "../shared/ancestors.js";
3
+ const COMPARISON_OPERATORS = new Set(["===", "!==", "==", "!="]);
4
+ const MAP_KEY_METHODS = new Set(["get", "has", "delete"]);
5
+ const SET_KEY_METHODS = new Set(["add", "has", "delete"]);
6
+ /**
7
+ * Canonical form: JSON.stringify walks insertion order, so structurally
8
+ * equal data can serialise to different strings depending on construction
9
+ * history. As an identity function (comparison, Map/Set key, hash input),
10
+ * that is a false-negative machine. Only a canonical (key-sorted)
11
+ * serializer may stand in for structural equality there.
12
+ */
13
+ export const requireCanonicalStringifyForIdentityRule = defineRule({
14
+ meta: {
15
+ type: "problem",
16
+ docs: {
17
+ description: "Disallow JSON.stringify as an identity function (equality comparison, Map/Set key, hash input); use a canonical key-sorted serializer instead.",
18
+ },
19
+ messages: {
20
+ nonCanonicalIdentity: "`JSON.stringify` here follows property insertion order, so equal data can produce different strings and identical-looking data can hide inequality. Use a canonical serializer (recursively key-sorted) before using the result for {{use}}.",
21
+ },
22
+ },
23
+ createOnce(context) {
24
+ function report(payload) {
25
+ context.report({
26
+ node: payload.node,
27
+ messageId: "nonCanonicalIdentity",
28
+ data: { use: payload.use },
29
+ });
30
+ }
31
+ return {
32
+ CallExpression(node) {
33
+ const callee = node.callee;
34
+ if (node.type !== "CallExpression" ||
35
+ callee.type !== "MemberExpression" ||
36
+ callee.computed ||
37
+ callee.object.type !== "Identifier" ||
38
+ callee.object.name !== "JSON" ||
39
+ callee.property.type !== "Identifier" ||
40
+ callee.property.name !== "stringify")
41
+ return;
42
+ const parent = (ancestorsOf(context.sourceCode, node)).at(-1);
43
+ if (parent === null || parent === undefined)
44
+ return;
45
+ if (parent.type === "BinaryExpression" && COMPARISON_OPERATORS.has(parent.operator)) {
46
+ report({ node, use: "equality comparison" });
47
+ return;
48
+ }
49
+ if (parent.type === "MemberExpression" && parent.computed) {
50
+ report({ node, use: "property lookup" });
51
+ return;
52
+ }
53
+ if (parent.type === "CallExpression" && parent.callee.type === "MemberExpression" && !parent.callee.computed) {
54
+ const method = parent.callee.property;
55
+ if (method.type !== "Identifier")
56
+ return;
57
+ if (MAP_KEY_METHODS.has(method.name) && parent.arguments[0] === node) {
58
+ report({ node, use: `${method.name}() on a map` });
59
+ return;
60
+ }
61
+ if (SET_KEY_METHODS.has(method.name) && parent.arguments[0] === node) {
62
+ report({ node, use: `${method.name}() on a set` });
63
+ return;
64
+ }
65
+ if (method.name === "set" && parent.arguments[0] === node) {
66
+ report({ node, use: "a map key" });
67
+ }
68
+ }
69
+ },
70
+ };
71
+ },
72
+ });
@@ -0,0 +1,2 @@
1
+ /** Prose-only retirement notes are invisible to tooling; require the machine-readable tag. */
2
+ export declare const requireDeprecatedTagForLegacyCommentsRule: import("@oxlint/plugins").Rule;
@@ -0,0 +1,34 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ import { getAllComments } from "../shared/structural.js";
3
+ const LEGACY_PROSE = /\b(?:deprecat\w*|legacy|obsolete|superseded|do not use|don't use|no longer (?:used?|supported|maintained))\b/iu;
4
+ const DEPRECATED_TAG = /@deprecated\b/iu;
5
+ /** Prose-only retirement notes are invisible to tooling; require the machine-readable tag. */
6
+ export const requireDeprecatedTagForLegacyCommentsRule = defineRule({
7
+ meta: {
8
+ type: "problem",
9
+ docs: {
10
+ description: "Require an @deprecated tag whenever a comment describes code as deprecated/legacy/obsolete/do-not-use; prose-only warnings are invisible to editors and agents, who will otherwise discover and use paths you want retired.",
11
+ },
12
+ messages: {
13
+ missingDeprecatedTag: "Comment says this code is deprecated/legacy but carries no @deprecated tag; prose warnings are invisible to tooling. Add `@deprecated` (with a pointer to the replacement) so agents and editors see it.",
14
+ },
15
+ },
16
+ createOnce(context) {
17
+ return {
18
+ Program(node) {
19
+ for (const comment of getAllComments(context.sourceCode)) {
20
+ if (comment.type !== "Block")
21
+ continue;
22
+ if (!LEGACY_PROSE.test(comment.value))
23
+ continue;
24
+ if (DEPRECATED_TAG.test(comment.value))
25
+ continue;
26
+ context.report({
27
+ node,
28
+ messageId: "missingDeprecatedTag",
29
+ });
30
+ }
31
+ },
32
+ };
33
+ },
34
+ });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Bounded touch points: adding a variant should be caught by the compiler at
3
+ * every place that must change. A `default` arm on a tag switch, even a
4
+ * throwing one, silences that check, so unhandled variants slip through
5
+ * silently or via hand-rolled fallbacks instead of failing type-check.
6
+ */
7
+ export declare const requireExhaustiveTagSwitchRule: import("@oxlint/plugins").Rule;
@@ -0,0 +1,34 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ const DISCRIMINANTS = new Set(["_tag", "tag"]);
3
+ /**
4
+ * Bounded touch points: adding a variant should be caught by the compiler at
5
+ * every place that must change. A `default` arm on a tag switch, even a
6
+ * throwing one, silences that check, so unhandled variants slip through
7
+ * silently or via hand-rolled fallbacks instead of failing type-check.
8
+ */
9
+ export const requireExhaustiveTagSwitchRule = defineRule({
10
+ meta: {
11
+ type: "suggestion",
12
+ docs: {
13
+ description: "Require `default`-free switches over a `_tag` discriminant so exhaustiveness checking flags every site a new variant must touch.",
14
+ },
15
+ messages: {
16
+ noDefault: "This switch matches on `_tag` but has a `default` arm, which hides unhandled variants from exhaustiveness checking. Remove it and list every variant explicitly so adding one fails type-check here.",
17
+ },
18
+ },
19
+ createOnce(context) {
20
+ return {
21
+ SwitchStatement(node) {
22
+ const discriminant = node.discriminant;
23
+ if (discriminant.type !== "MemberExpression" ||
24
+ discriminant.computed ||
25
+ discriminant.property.type !== "Identifier" ||
26
+ !DISCRIMINANTS.has(discriminant.property.name))
27
+ return;
28
+ if (node.cases.some((clause) => clause.test === null)) {
29
+ context.report({ node, messageId: "noDefault" });
30
+ }
31
+ },
32
+ };
33
+ },
34
+ });
@@ -0,0 +1,2 @@
1
+ /** fast-check scores a predicate's implicit return; expression-bodied arrows return matchers. */
2
+ export declare const requireFcBlockPredicateRule: import("@oxlint/plugins").Rule;
@@ -0,0 +1,37 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ /** Whether the callee accesses `.property` or `.asyncProperty`.
3
+ * @param {ESTree.CallExpression["callee"]} callee - The callee expression of a call being inspected.
4
+ * @returns {boolean} True when the callee is a property access matching fastcheck patterns. */
5
+ function isPropertyCall(callee) {
6
+ return (callee.type === "MemberExpression" &&
7
+ callee.property.type === "Identifier" &&
8
+ (callee.property.name === "property" || callee.property.name === "asyncProperty"));
9
+ }
10
+ /** fast-check scores a predicate's implicit return; expression-bodied arrows return matchers. */
11
+ export const requireFcBlockPredicateRule = defineRule({
12
+ meta: {
13
+ type: "problem",
14
+ docs: {
15
+ description: "Require fast-check property predicates to use block bodies: an expression-bodied arrow returns its last expression (often a vitest matcher object), which fast-check scores as a falsy result and fails the property.",
16
+ },
17
+ messages: {
18
+ blockBody: "This property predicate returns its expression value, which fast-check may score as `false`. Use a block body (`=> { ...; }`) so the predicate returns void.",
19
+ },
20
+ },
21
+ createOnce(context) {
22
+ const checkArguments = (node) => {
23
+ if (!isPropertyCall(node.callee))
24
+ return;
25
+ for (const argument of node.arguments) {
26
+ if (argument.type !== "ArrowFunctionExpression")
27
+ continue;
28
+ if (argument.body.type === "BlockStatement")
29
+ continue;
30
+ context.report({ node: argument, messageId: "blockBody" });
31
+ }
32
+ };
33
+ return {
34
+ CallExpression: checkArguments,
35
+ };
36
+ },
37
+ });
@@ -0,0 +1,2 @@
1
+ /** Every exported function carries a complete JSDoc contract. */
2
+ export declare const requireJsdocOnExportedRule: import("@oxlint/plugins").Rule;
@@ -0,0 +1,66 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ import { getAllComments } from "../shared/structural.js";
3
+ const TEST_FILE = /.(?:test|spec).[cm]?[jt]sx?$/u;
4
+ /** Every exported function carries a complete JSDoc contract. */
5
+ export const requireJsdocOnExportedRule = defineRule({
6
+ meta: {
7
+ type: "problem",
8
+ docs: {
9
+ description: "Require exported functions (declarations and arrow/function-expression consts) to carry an attached JSDoc block; the jsdoc rules only check blocks that exist, so undocumented exports otherwise escape the contract rules entirely.",
10
+ },
11
+ messages: {
12
+ missingJsdoc: "Exported function `{{name}}` has no JSDoc block. Document the contract with @param/@returns so the jsdoc rules can enforce it.",
13
+ },
14
+ },
15
+ createOnce(context) {
16
+ const jsdocFollowsLines = new Set();
17
+ return {
18
+ before() {
19
+ if (TEST_FILE.test(context.filename.replaceAll("\\", "/")))
20
+ return false;
21
+ jsdocFollowsLines.clear();
22
+ },
23
+ Program(node) {
24
+ jsdocFollowsLines.clear();
25
+ for (const comment of getAllComments(context.sourceCode)) {
26
+ if (comment.type !== "Block" || !comment.value.startsWith("*"))
27
+ continue;
28
+ const endLine = comment.loc?.end?.line;
29
+ if (endLine !== undefined)
30
+ jsdocFollowsLines.add(endLine + 1);
31
+ }
32
+ },
33
+ ExportNamedDeclaration(node) {
34
+ const declaration = node.declaration;
35
+ if (declaration === null || declaration === undefined)
36
+ return;
37
+ const startLine = declaration.loc?.start?.line;
38
+ if (startLine === undefined || jsdocFollowsLines.has(startLine))
39
+ return;
40
+ if (declaration.type === "FunctionDeclaration" && declaration.id !== null) {
41
+ context.report({
42
+ node: declaration,
43
+ messageId: "missingJsdoc",
44
+ data: { name: declaration.id.name },
45
+ });
46
+ return;
47
+ }
48
+ if (declaration.type !== "VariableDeclaration")
49
+ return;
50
+ for (const declarator of declaration.declarations) {
51
+ if (declarator.id.type !== "Identifier")
52
+ continue;
53
+ const init = declarator.init;
54
+ if (init?.type === "ArrowFunctionExpression" ||
55
+ init?.type === "FunctionExpression") {
56
+ context.report({
57
+ node: declarator.id,
58
+ messageId: "missingJsdoc",
59
+ data: { name: declarator.id.name },
60
+ });
61
+ }
62
+ }
63
+ },
64
+ };
65
+ },
66
+ });
@@ -0,0 +1,2 @@
1
+ /** A module exporting comparators must publish a named Order built from them. */
2
+ export declare const requirePublishedOrderRule: import("@oxlint/plugins").Rule;