@autotelic/plumb 0.5.2 → 0.6.1

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 (282) hide show
  1. package/README.md +81 -8
  2. package/dist/configs/recommended-rules.d.ts +36 -0
  3. package/dist/configs/recommended-rules.js +57 -0
  4. package/dist/effect/index.js +4 -0
  5. package/dist/effect/rules/guarded-op-must-return-effect.js +1 -1
  6. package/dist/effect/rules/no-cascading-layer-provide.js +1 -1
  7. package/dist/effect/rules/no-decode-unknown-option.js +1 -1
  8. package/dist/effect/rules/no-direct-browser-storage.js +3 -3
  9. package/dist/effect/rules/no-direct-fetch.js +1 -1
  10. package/dist/effect/rules/no-manual-field-guards.js +1 -1
  11. package/dist/effect/rules/no-nested-layer-provide.js +1 -1
  12. package/dist/effect/rules/no-nullish-default-on-partial-input.d.ts +13 -0
  13. package/dist/effect/rules/no-nullish-default-on-partial-input.js +109 -0
  14. package/dist/effect/rules/no-raw-error-forwarding.d.ts +16 -0
  15. package/dist/effect/rules/no-raw-error-forwarding.js +108 -0
  16. package/dist/effect/rules/no-silent-error-swallow.js +1 -1
  17. package/dist/effect/rules/no-static-effect-service-forwarders.js +5 -4
  18. package/dist/effect/rules/no-try-catch.js +1 -1
  19. package/dist/effect/rules/no-unguarded-json-parse.js +1 -1
  20. package/dist/effect/rules/option-core-needs-effect-public.js +1 -1
  21. package/dist/effect/rules/prefer-die-for-precondition-defects.js +1 -1
  22. package/dist/effect/rules/prefer-effect-gen-for-guard-ladders.js +1 -1
  23. package/dist/effect/rules/prefer-effect-match.js +2 -2
  24. package/dist/effect/rules/prefer-effect-predicate-over-boolean-function.js +1 -1
  25. package/dist/effect/rules/prefer-named-guard-predicate.js +1 -1
  26. package/dist/effect/rules/prefer-option-pipeline.js +13 -12
  27. package/dist/effect/rules/prefer-ordering-match.js +1 -1
  28. package/dist/effect/rules/prefer-tagged-enum.js +1 -1
  29. package/dist/effect/rules/require-schema-type-derivation.d.ts +8 -2
  30. package/dist/effect/rules/require-schema-type-derivation.js +14 -4
  31. package/dist/index.js +10 -0
  32. package/dist/react/rules/require-dot-notation-exports.js +1 -1
  33. package/dist/react/rules/require-guarded-context-hook.js +1 -1
  34. package/dist/react/rules/require-tripartite-context.js +1 -1
  35. package/dist/react/rules/use-encapsulation.js +1 -1
  36. package/dist/rules/no-adapter-in-values.d.ts +12 -0
  37. package/dist/rules/no-adapter-in-values.js +110 -0
  38. package/dist/rules/no-builtin-throws.js +1 -1
  39. package/dist/rules/no-duplicated-literal-union.d.ts +7 -0
  40. package/dist/rules/no-duplicated-literal-union.js +5 -1
  41. package/dist/rules/no-generic-export-names.js +1 -1
  42. package/dist/rules/no-multiple-function-params.js +26 -12
  43. package/dist/rules/no-mutable-environment-capture.js +2 -2
  44. package/dist/rules/no-nondeterministic-core.js +1 -1
  45. package/dist/rules/no-nullable-value-field.d.ts +16 -0
  46. package/dist/rules/no-nullable-value-field.js +117 -0
  47. package/dist/rules/no-optional-function-parameters.js +1 -1
  48. package/dist/rules/no-row-coercion.d.ts +13 -0
  49. package/dist/rules/no-row-coercion.js +135 -0
  50. package/dist/rules/no-single-use-private-functions.js +1 -1
  51. package/dist/rules/no-sql-string-interpolation.d.ts +7 -0
  52. package/dist/rules/no-sql-string-interpolation.js +62 -0
  53. package/dist/rules/no-stray-inline-comments.js +1 -1
  54. package/dist/rules/no-string-instant.d.ts +15 -0
  55. package/dist/rules/no-string-instant.js +108 -0
  56. package/dist/rules/no-swappable-primitive-params.js +1 -1
  57. package/dist/rules/no-tag-ladder-assertions.js +1 -1
  58. package/dist/rules/no-vague-test-filenames.js +1 -1
  59. package/dist/rules/prefer-property-tests.d.ts +5 -0
  60. package/dist/rules/prefer-property-tests.js +7 -0
  61. package/dist/rules/require-jsdoc-on-exported.js +1 -1
  62. package/dist/shared/ancestors.d.ts +1 -1
  63. package/dist/shared/ancestors.js +1 -1
  64. package/dist/shared/values-path.d.ts +12 -0
  65. package/dist/shared/values-path.js +56 -0
  66. package/dist/src/configs/recommended-rules.d.ts +20 -0
  67. package/dist/src/configs/recommended-rules.js +22 -0
  68. package/dist/src/effect/index.d.ts +3 -0
  69. package/dist/src/effect/index.js +60 -0
  70. package/dist/src/effect/rules/guarded-op-must-return-effect.d.ts +6 -0
  71. package/dist/src/effect/rules/guarded-op-must-return-effect.js +235 -0
  72. package/dist/src/effect/rules/guarded-op-must-return-option.d.ts +2 -0
  73. package/dist/src/effect/rules/guarded-op-must-return-option.js +88 -0
  74. package/dist/src/effect/rules/no-cascading-layer-provide.d.ts +6 -0
  75. package/dist/src/effect/rules/no-cascading-layer-provide.js +73 -0
  76. package/dist/src/effect/rules/no-decode-unknown-option.d.ts +7 -0
  77. package/dist/src/effect/rules/no-decode-unknown-option.js +34 -0
  78. package/dist/src/effect/rules/no-direct-browser-storage.d.ts +2 -0
  79. package/dist/src/effect/rules/no-direct-browser-storage.js +88 -0
  80. package/dist/src/effect/rules/no-direct-fetch.d.ts +2 -0
  81. package/dist/src/effect/rules/no-direct-fetch.js +37 -0
  82. package/dist/src/effect/rules/no-manual-field-guards.d.ts +6 -0
  83. package/dist/src/effect/rules/no-manual-field-guards.js +129 -0
  84. package/dist/src/effect/rules/no-nested-layer-provide.d.ts +2 -0
  85. package/dist/src/effect/rules/no-nested-layer-provide.js +50 -0
  86. package/dist/src/effect/rules/no-nullish-default-on-partial-input.d.ts +13 -0
  87. package/dist/src/effect/rules/no-nullish-default-on-partial-input.js +109 -0
  88. package/dist/src/effect/rules/no-raw-error-forwarding.d.ts +12 -0
  89. package/dist/src/effect/rules/no-raw-error-forwarding.js +103 -0
  90. package/dist/src/effect/rules/no-schema-class-modeling.d.ts +2 -0
  91. package/dist/src/effect/rules/no-schema-class-modeling.js +52 -0
  92. package/dist/src/effect/rules/no-service-constructor-imports.d.ts +2 -0
  93. package/dist/src/effect/rules/no-service-constructor-imports.js +42 -0
  94. package/dist/src/effect/rules/no-silent-error-swallow.d.ts +2 -0
  95. package/dist/src/effect/rules/no-silent-error-swallow.js +95 -0
  96. package/dist/src/effect/rules/no-static-effect-service-forwarders.d.ts +6 -0
  97. package/dist/src/effect/rules/no-static-effect-service-forwarders.js +222 -0
  98. package/dist/src/effect/rules/no-try-catch.d.ts +2 -0
  99. package/dist/src/effect/rules/no-try-catch.js +30 -0
  100. package/dist/src/effect/rules/no-unguarded-json-parse.d.ts +5 -0
  101. package/dist/src/effect/rules/no-unguarded-json-parse.js +200 -0
  102. package/dist/src/effect/rules/option-core-needs-effect-public.d.ts +5 -0
  103. package/dist/src/effect/rules/option-core-needs-effect-public.js +76 -0
  104. package/dist/src/effect/rules/prefer-die-for-precondition-defects.d.ts +5 -0
  105. package/dist/src/effect/rules/prefer-die-for-precondition-defects.js +112 -0
  106. package/dist/src/effect/rules/prefer-effect-gen-for-guard-ladders.d.ts +5 -0
  107. package/dist/src/effect/rules/prefer-effect-gen-for-guard-ladders.js +72 -0
  108. package/dist/src/effect/rules/prefer-effect-match.d.ts +2 -0
  109. package/dist/src/effect/rules/prefer-effect-match.js +74 -0
  110. package/dist/src/effect/rules/prefer-effect-predicate-over-boolean-function.d.ts +2 -0
  111. package/dist/src/effect/rules/prefer-effect-predicate-over-boolean-function.js +75 -0
  112. package/dist/src/effect/rules/prefer-named-guard-predicate.d.ts +2 -0
  113. package/dist/src/effect/rules/prefer-named-guard-predicate.js +93 -0
  114. package/dist/src/effect/rules/prefer-option-pipeline.d.ts +2 -0
  115. package/dist/src/effect/rules/prefer-option-pipeline.js +87 -0
  116. package/dist/src/effect/rules/prefer-ordering-match.d.ts +2 -0
  117. package/dist/src/effect/rules/prefer-ordering-match.js +135 -0
  118. package/dist/src/effect/rules/prefer-tagged-enum.d.ts +2 -0
  119. package/dist/src/effect/rules/prefer-tagged-enum.js +66 -0
  120. package/dist/src/effect/rules/require-schema-type-derivation.d.ts +7 -0
  121. package/dist/src/effect/rules/require-schema-type-derivation.js +80 -0
  122. package/dist/src/index.d.ts +3 -0
  123. package/dist/src/index.js +106 -0
  124. package/dist/src/meta/index.d.ts +7 -0
  125. package/dist/src/meta/index.js +22 -0
  126. package/dist/src/meta/rules/no-disable-directives.d.ts +6 -0
  127. package/dist/src/meta/rules/no-disable-directives.js +35 -0
  128. package/dist/src/meta/rules/no-manual-ancestor-walks.d.ts +2 -0
  129. package/dist/src/meta/rules/no-manual-ancestor-walks.js +26 -0
  130. package/dist/src/meta/rules/prefer-before-file-scope.d.ts +2 -0
  131. package/dist/src/meta/rules/prefer-before-file-scope.js +57 -0
  132. package/dist/src/meta/rules/require-create-once.d.ts +2 -0
  133. package/dist/src/meta/rules/require-create-once.js +51 -0
  134. package/dist/src/meta/rules/require-rule-tester.d.ts +2 -0
  135. package/dist/src/meta/rules/require-rule-tester.js +50 -0
  136. package/dist/src/react/index.d.ts +3 -0
  137. package/dist/src/react/index.js +16 -0
  138. package/dist/src/react/role.d.ts +23 -0
  139. package/dist/src/react/role.js +30 -0
  140. package/dist/src/react/rules/require-dot-notation-exports.d.ts +27 -0
  141. package/dist/src/react/rules/require-dot-notation-exports.js +144 -0
  142. package/dist/src/react/rules/require-guarded-context-hook.d.ts +19 -0
  143. package/dist/src/react/rules/require-guarded-context-hook.js +167 -0
  144. package/dist/src/react/rules/require-tripartite-context.d.ts +17 -0
  145. package/dist/src/react/rules/require-tripartite-context.js +160 -0
  146. package/dist/src/react/rules/use-encapsulation.d.ts +22 -0
  147. package/dist/src/react/rules/use-encapsulation.js +97 -0
  148. package/dist/src/rules/no-anonymous-wide-tuples.d.ts +7 -0
  149. package/dist/src/rules/no-anonymous-wide-tuples.js +34 -0
  150. package/dist/src/rules/no-barrel-export-star.d.ts +2 -0
  151. package/dist/src/rules/no-barrel-export-star.js +26 -0
  152. package/dist/src/rules/no-boolean-field-signals.d.ts +2 -0
  153. package/dist/src/rules/no-boolean-field-signals.js +279 -0
  154. package/dist/src/rules/no-builtin-throws.d.ts +6 -0
  155. package/dist/src/rules/no-builtin-throws.js +74 -0
  156. package/dist/src/rules/no-chained-type-assertions.d.ts +2 -0
  157. package/dist/src/rules/no-chained-type-assertions.js +54 -0
  158. package/dist/src/rules/no-conditional-empty-object-spread.d.ts +2 -0
  159. package/dist/src/rules/no-conditional-empty-object-spread.js +36 -0
  160. package/dist/src/rules/no-duplicated-literal-union.d.ts +6 -0
  161. package/dist/src/rules/no-duplicated-literal-union.js +66 -0
  162. package/dist/src/rules/no-exported-mutable-state.d.ts +7 -0
  163. package/dist/src/rules/no-exported-mutable-state.js +104 -0
  164. package/dist/src/rules/no-generic-export-names.d.ts +2 -0
  165. package/dist/src/rules/no-generic-export-names.js +141 -0
  166. package/dist/src/rules/no-impossible-branch-throw.d.ts +2 -0
  167. package/dist/src/rules/no-impossible-branch-throw.js +51 -0
  168. package/dist/src/rules/no-known-value-widening.d.ts +2 -0
  169. package/dist/src/rules/no-known-value-widening.js +176 -0
  170. package/dist/src/rules/no-module-mocking.d.ts +2 -0
  171. package/dist/src/rules/no-module-mocking.js +90 -0
  172. package/dist/src/rules/no-multiple-function-params.d.ts +2 -0
  173. package/dist/src/rules/no-multiple-function-params.js +155 -0
  174. package/dist/src/rules/no-mutable-environment-capture.d.ts +7 -0
  175. package/dist/src/rules/no-mutable-environment-capture.js +134 -0
  176. package/dist/src/rules/no-nondeterministic-core.d.ts +6 -0
  177. package/dist/src/rules/no-nondeterministic-core.js +63 -0
  178. package/dist/src/rules/no-object-parameters.d.ts +2 -0
  179. package/dist/src/rules/no-object-parameters.js +95 -0
  180. package/dist/src/rules/no-optional-function-parameters.d.ts +7 -0
  181. package/dist/src/rules/no-optional-function-parameters.js +44 -0
  182. package/dist/src/rules/no-product-of-state-booleans.d.ts +2 -0
  183. package/dist/src/rules/no-product-of-state-booleans.js +79 -0
  184. package/dist/src/rules/no-redundant-derived-field.d.ts +6 -0
  185. package/dist/src/rules/no-redundant-derived-field.js +194 -0
  186. package/dist/src/rules/no-reflect-apply.d.ts +2 -0
  187. package/dist/src/rules/no-reflect-apply.js +29 -0
  188. package/dist/src/rules/no-reflect-get.d.ts +2 -0
  189. package/dist/src/rules/no-reflect-get.js +29 -0
  190. package/dist/src/rules/no-reinterpret-cast.d.ts +2 -0
  191. package/dist/src/rules/no-reinterpret-cast.js +68 -0
  192. package/dist/src/rules/no-runtime-typeof.d.ts +2 -0
  193. package/dist/src/rules/no-runtime-typeof.js +54 -0
  194. package/dist/src/rules/no-sentinel-comparison-union.d.ts +2 -0
  195. package/dist/src/rules/no-sentinel-comparison-union.js +139 -0
  196. package/dist/src/rules/no-shape-in-symbol-names.d.ts +2 -0
  197. package/dist/src/rules/no-shape-in-symbol-names.js +39 -0
  198. package/dist/src/rules/no-single-use-private-functions.d.ts +17 -0
  199. package/dist/src/rules/no-single-use-private-functions.js +419 -0
  200. package/dist/src/rules/no-sql-string-interpolation.d.ts +7 -0
  201. package/dist/src/rules/no-sql-string-interpolation.js +62 -0
  202. package/dist/src/rules/no-stacked-jsdoc-blocks.d.ts +2 -0
  203. package/dist/src/rules/no-stacked-jsdoc-blocks.js +50 -0
  204. package/dist/src/rules/no-stray-inline-comments.d.ts +2 -0
  205. package/dist/src/rules/no-stray-inline-comments.js +74 -0
  206. package/dist/src/rules/no-swappable-primitive-params.d.ts +2 -0
  207. package/dist/src/rules/no-swappable-primitive-params.js +96 -0
  208. package/dist/src/rules/no-tag-ladder-assertions.d.ts +6 -0
  209. package/dist/src/rules/no-tag-ladder-assertions.js +63 -0
  210. package/dist/src/rules/no-transposed-field-reads.d.ts +8 -0
  211. package/dist/src/rules/no-transposed-field-reads.js +101 -0
  212. package/dist/src/rules/no-unit-return-validators.d.ts +2 -0
  213. package/dist/src/rules/no-unit-return-validators.js +64 -0
  214. package/dist/src/rules/no-unknown-parameters.d.ts +2 -0
  215. package/dist/src/rules/no-unknown-parameters.js +82 -0
  216. package/dist/src/rules/no-unknown-returns.d.ts +2 -0
  217. package/dist/src/rules/no-unknown-returns.js +86 -0
  218. package/dist/src/rules/no-unknown-type-aliases.d.ts +2 -0
  219. package/dist/src/rules/no-unknown-type-aliases.js +64 -0
  220. package/dist/src/rules/no-unsafe-dictionary-type.d.ts +2 -0
  221. package/dist/src/rules/no-unsafe-dictionary-type.js +116 -0
  222. package/dist/src/rules/no-vague-test-filenames.d.ts +2 -0
  223. package/dist/src/rules/no-vague-test-filenames.js +61 -0
  224. package/dist/src/rules/no-widen-then-assert.d.ts +2 -0
  225. package/dist/src/rules/no-widen-then-assert.js +268 -0
  226. package/dist/src/rules/prefer-payload-brand.d.ts +2 -0
  227. package/dist/src/rules/prefer-payload-brand.js +57 -0
  228. package/dist/src/rules/prefer-property-tests.d.ts +5 -0
  229. package/dist/src/rules/prefer-property-tests.js +39 -0
  230. package/dist/src/rules/require-canonical-stringify-for-identity.d.ts +8 -0
  231. package/dist/src/rules/require-canonical-stringify-for-identity.js +72 -0
  232. package/dist/src/rules/require-deprecated-tag-for-legacy-comments.d.ts +2 -0
  233. package/dist/src/rules/require-deprecated-tag-for-legacy-comments.js +34 -0
  234. package/dist/src/rules/require-exhaustive-tag-switch.d.ts +7 -0
  235. package/dist/src/rules/require-exhaustive-tag-switch.js +34 -0
  236. package/dist/src/rules/require-fc-block-predicate.d.ts +2 -0
  237. package/dist/src/rules/require-fc-block-predicate.js +37 -0
  238. package/dist/src/rules/require-jsdoc-on-exported.d.ts +2 -0
  239. package/dist/src/rules/require-jsdoc-on-exported.js +66 -0
  240. package/dist/src/rules/require-published-order.d.ts +2 -0
  241. package/dist/src/rules/require-published-order.js +102 -0
  242. package/dist/src/rules/require-safety-comment-for-type-assertion.d.ts +2 -0
  243. package/dist/src/rules/require-safety-comment-for-type-assertion.js +53 -0
  244. package/dist/src/rules/require-sort-comparator.d.ts +7 -0
  245. package/dist/src/rules/require-sort-comparator.js +34 -0
  246. package/dist/src/rules/test-utils.d.ts +35 -0
  247. package/dist/src/rules/test-utils.js +53 -0
  248. package/dist/src/shared/ancestors.d.ts +18 -0
  249. package/dist/src/shared/ancestors.js +19 -0
  250. package/dist/src/shared/child-nodes.d.ts +12 -0
  251. package/dist/src/shared/child-nodes.js +26 -0
  252. package/dist/src/shared/dictionary-types.d.ts +55 -0
  253. package/dist/src/shared/dictionary-types.js +413 -0
  254. package/dist/src/shared/is-node.d.ts +9 -0
  255. package/dist/src/shared/is-node.js +10 -0
  256. package/dist/src/shared/lexical-type-parameters.d.ts +12 -0
  257. package/dist/src/shared/lexical-type-parameters.js +50 -0
  258. package/dist/src/shared/reflect-method.d.ts +15 -0
  259. package/dist/src/shared/reflect-method.js +32 -0
  260. package/dist/src/shared/rule-options.d.ts +18 -0
  261. package/dist/src/shared/rule-options.js +12 -0
  262. package/dist/src/shared/structural.d.ts +54 -0
  263. package/dist/src/shared/structural.js +40 -0
  264. package/dist/src/testing/index.d.ts +2 -0
  265. package/dist/src/testing/index.js +1 -0
  266. package/dist/src/testing/testable-rule.d.ts +39 -0
  267. package/dist/src/testing/testable-rule.js +84 -0
  268. package/dist/src/ui/index.d.ts +12 -0
  269. package/dist/src/ui/index.js +18 -0
  270. package/dist/src/ui/manifest.d.ts +34 -0
  271. package/dist/src/ui/manifest.js +75 -0
  272. package/dist/src/ui/rules/no-deprecated-parts.d.ts +3 -0
  273. package/dist/src/ui/rules/no-deprecated-parts.js +131 -0
  274. package/dist/testing/testable-rule.d.ts +6 -5
  275. package/dist/testing/testable-rule.js +20 -6
  276. package/dist/ui/index.d.ts +12 -0
  277. package/dist/ui/index.js +18 -0
  278. package/dist/ui/manifest.d.ts +49 -0
  279. package/dist/ui/manifest.js +90 -0
  280. package/dist/ui/rules/no-deprecated-parts.d.ts +3 -0
  281. package/dist/ui/rules/no-deprecated-parts.js +172 -0
  282. package/package.json +20 -11
@@ -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;
@@ -0,0 +1,102 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ /** True for the numeric ordering sentinels -1, 0 and 1 in a type position.
3
+ *
4
+ * @param {ESTree.TSType} type - The union constituent to inspect.
5
+ * @returns {boolean} True when the type is one of the sentinel literals.
6
+ */
7
+ function isSentinelLiteral(type) {
8
+ if (type.type !== "TSLiteralType")
9
+ return false;
10
+ const literal = type.literal;
11
+ if (literal.type === "UnaryExpression") {
12
+ return (literal.operator === "-" &&
13
+ literal.argument.type === "Literal" &&
14
+ literal.argument.value === 1);
15
+ }
16
+ return literal.type === "Literal" && (literal.value === 0 || literal.value === 1);
17
+ }
18
+ /** True for a reference to Effect's Ordering (or its -1 | 0 | 1 spelling).
19
+ *
20
+ * @param {ESTree.TSType} type - The annotation to inspect.
21
+ * @returns {boolean} True when the type names Ordering.
22
+ */
23
+ function isOrderingReference(type) {
24
+ if (type.type !== "TSTypeReference")
25
+ return false;
26
+ const name = type.typeName;
27
+ if (name.type === "Identifier")
28
+ return name.name === "Ordering";
29
+ return (name.type === "TSQualifiedName" &&
30
+ name.left.type === "Identifier" &&
31
+ name.left.name === "Ordering" &&
32
+ name.right.type === "Identifier" &&
33
+ name.right.name === "Ordering");
34
+ }
35
+ function returnsComparatorOrdering(returnType) {
36
+ if (returnType === null || returnType === undefined)
37
+ return false;
38
+ const annotation = returnType.typeAnnotation;
39
+ if (annotation.type === "TSUnionType")
40
+ return annotation.types.every(isSentinelLiteral);
41
+ return isOrderingReference(annotation);
42
+ }
43
+ /** A module exporting comparators must publish a named Order built from them. */
44
+ export const requirePublishedOrderRule = defineRule({
45
+ meta: {
46
+ type: "problem",
47
+ docs: {
48
+ description: "Require modules that export comparators to publish a named Order (Order.make) so call sites compose through one total order instead of hand-rolling comparisons.",
49
+ },
50
+ messages: {
51
+ missingPublishedOrder: "`{{name}}` exposes an ordering but the module publishes no named order. Export `export const Order = Order.make({{name}})` so comparisons compose through one total order.",
52
+ },
53
+ },
54
+ createOnce(context) {
55
+ return {
56
+ Program(node) {
57
+ let hasPublishedOrder = false;
58
+ const comparators = [];
59
+ for (const statement of node.body) {
60
+ const declaration = statement.type === "ExportNamedDeclaration" ||
61
+ statement.type === "ExportDefaultDeclaration"
62
+ ? (statement.declaration ?? null)
63
+ : statement;
64
+ if (declaration?.type === "VariableDeclaration") {
65
+ for (const declarator of declaration.declarations) {
66
+ if (declarator.id.type !== "Identifier")
67
+ continue;
68
+ const name = declarator.id.name;
69
+ if (name === "Order")
70
+ hasPublishedOrder = true;
71
+ if (!/^compare/u.test(name))
72
+ continue;
73
+ const init = declarator.init;
74
+ if ((init?.type === "ArrowFunctionExpression" ||
75
+ init?.type === "FunctionExpression") &&
76
+ returnsComparatorOrdering(init.returnType)) {
77
+ comparators.push({ name, node: declarator.id });
78
+ }
79
+ }
80
+ }
81
+ if (declaration?.type === "FunctionDeclaration" && declaration.id !== null) {
82
+ const name = declaration.id.name;
83
+ if (!/^compare/u.test(name))
84
+ continue;
85
+ if (returnsComparatorOrdering(declaration.returnType)) {
86
+ comparators.push({ name, node: declaration.id });
87
+ }
88
+ }
89
+ }
90
+ if (hasPublishedOrder)
91
+ return;
92
+ for (const comparator of comparators) {
93
+ context.report({
94
+ node: comparator.node,
95
+ messageId: "missingPublishedOrder",
96
+ data: { name: comparator.name },
97
+ });
98
+ }
99
+ },
100
+ };
101
+ },
102
+ });
@@ -0,0 +1,2 @@
1
+ /** Require every non-const type assertion to state the invariant TypeScript cannot express. */
2
+ export declare const requireSafetyCommentForTypeAssertionRule: import("@oxlint/plugins").Rule;
@@ -0,0 +1,53 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ import { ancestorsOf } from "../shared/ancestors.js";
3
+ const commentOwnerKinds = new Set([
4
+ "ExpressionStatement",
5
+ "PropertyDefinition",
6
+ "ReturnStatement",
7
+ "ThrowStatement",
8
+ "VariableDeclaration",
9
+ ]);
10
+ /** Require every non-const type assertion to state the invariant TypeScript cannot express. */
11
+ export const requireSafetyCommentForTypeAssertionRule = defineRule({
12
+ meta: {
13
+ type: "problem",
14
+ docs: {
15
+ description: "Require a nearby SAFETY comment for every TypeScript type assertion except const assertions.",
16
+ },
17
+ messages: {
18
+ missingSafetyComment: "This type assertion has no `SAFETY:` justification. State the checked invariant immediately before the assertion or its containing statement.",
19
+ },
20
+ },
21
+ createOnce(context) {
22
+ const checkAssertion = (node) => {
23
+ const isConstAssertion = node.typeAnnotation.type === "TSTypeReference" &&
24
+ node.typeAnnotation.typeName.type === "Identifier" &&
25
+ node.typeAnnotation.typeName.name === "const";
26
+ if (isConstAssertion)
27
+ return;
28
+ const ancestors = ancestorsOf(context.sourceCode, node);
29
+ const chain = [node, ...[...ancestors].reverse()];
30
+ let justified = false;
31
+ for (let index = 0; index < chain.length; index += 1) {
32
+ const current = chain[index];
33
+ if (context.sourceCode
34
+ .getCommentsBefore(current)
35
+ .some((comment) => comment.end <= node.start && /\bSAFETY\s*:/u.test(comment.value))) {
36
+ justified = true;
37
+ break;
38
+ }
39
+ if (commentOwnerKinds.has(current.type))
40
+ break;
41
+ const parent = chain[index + 1];
42
+ if (parent === undefined || parent.type === "Program")
43
+ break;
44
+ }
45
+ if (!justified)
46
+ context.report({ node, messageId: "missingSafetyComment" });
47
+ };
48
+ return {
49
+ TSAsExpression: checkAssertion,
50
+ TSTypeAssertion: checkAssertion,
51
+ };
52
+ },
53
+ });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Canonical form requires intentional order. The default sort coerces
3
+ * elements to strings and compares lexicographically, so the "natural"
4
+ * ordering silently depends on element encoding; an explicit comparator
5
+ * makes the canonical order deliberate and reviewable.
6
+ */
7
+ export declare const requireSortComparatorRule: import("@oxlint/plugins").Rule;
@@ -0,0 +1,34 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ /**
3
+ * Canonical form requires intentional order. The default sort coerces
4
+ * elements to strings and compares lexicographically, so the "natural"
5
+ * ordering silently depends on element encoding; an explicit comparator
6
+ * makes the canonical order deliberate and reviewable.
7
+ */
8
+ export const requireSortComparatorRule = defineRule({
9
+ meta: {
10
+ type: "problem",
11
+ docs: {
12
+ description: "Require an explicit comparator on .sort()/.toSorted(); the default lexicographic sort makes canonical order accidental.",
13
+ },
14
+ messages: {
15
+ missingComparator: "This sort has no comparator, so ordering defaults to string comparison and the canonical order is accidental. Pass an explicit comparator so the intended order is stated here.",
16
+ },
17
+ },
18
+ createOnce(context) {
19
+ return {
20
+ CallExpression(node) {
21
+ const callee = node.callee;
22
+ if (callee.type !== "MemberExpression" ||
23
+ callee.computed ||
24
+ callee.property.type !== "Identifier" ||
25
+ (callee.property.name !== "sort" && callee.property.name !== "toSorted")) {
26
+ return;
27
+ }
28
+ if (node.arguments.length === 0) {
29
+ context.report({ node, messageId: "missingComparator" });
30
+ }
31
+ },
32
+ };
33
+ },
34
+ });
@@ -0,0 +1,35 @@
1
+ import fc from "fast-check";
2
+ import { RuleTester } from "oxlint/plugins-dev";
3
+ import type { ESTree, Rule } from "@oxlint/plugins";
4
+ type Recorded = {
5
+ messageId: string;
6
+ };
7
+ /** Wrap a raw createOnce rule in the compat layer so it can run anywhere.
8
+ *
9
+ * @param {string} name - The rule name to register under.
10
+ * @param {unknown} rule - The raw rule implementation.
11
+ * @returns {Rule} The compat-wrapped rule.
12
+ */
13
+ export declare function wrap(name: string, rule: unknown): Rule;
14
+ /** Drive a createOnce rule visitor directly against a synthetic node.
15
+ *
16
+ * @param {Rule} rule - The rule to probe.
17
+ * @param {string} visitorKey - The visitor method name to invoke.
18
+ * @param {unknown} node - The synthetic node passed to the visitor.
19
+ * @returns {Array<Recorded>} Reports collected from the probe.
20
+ */
21
+ export declare function collectReports(rule: Rule, visitorKey: string, node: unknown): Array<Recorded>;
22
+ /** Bind vitest reporting into RuleTester so suites run under the project runner.
23
+ *
24
+ * @returns {RuleTester} A RuleTester wired to vitest's describe/it.
25
+ */
26
+ export declare function makeTester(): RuleTester;
27
+ /** Build an ESTree member expression on a fixed `node` object for visitor probes.
28
+ *
29
+ * @param {boolean} computed - Whether the member access is computed.
30
+ * @param {string} propertyName_ - The property identifier name.
31
+ * @returns {ESTree.Node} The synthetic member expression node.
32
+ */
33
+ export declare function memberExpression(computed: boolean, propertyName_: string): ESTree.Node;
34
+ export declare const identifiers: fc.Arbitrary<string>;
35
+ export {};
@@ -0,0 +1,53 @@
1
+ import { defineRule, eslintCompatPlugin } from "@oxlint/plugins";
2
+ import fc from "fast-check";
3
+ import { describe, it } from "vitest";
4
+ import { RuleTester } from "oxlint/plugins-dev";
5
+ /** Wrap a raw createOnce rule in the compat layer so it can run anywhere.
6
+ *
7
+ * @param {string} name - The rule name to register under.
8
+ * @param {unknown} rule - The raw rule implementation.
9
+ * @returns {Rule} The compat-wrapped rule.
10
+ */
11
+ export function wrap(name, rule) {
12
+ const plugin = eslintCompatPlugin({ meta: { name: "plumb-test" }, rules: { [name]: rule } });
13
+ return plugin.rules[name];
14
+ }
15
+ /** Drive a createOnce rule visitor directly against a synthetic node.
16
+ *
17
+ * @param {Rule} rule - The rule to probe.
18
+ * @param {string} visitorKey - The visitor method name to invoke.
19
+ * @param {unknown} node - The synthetic node passed to the visitor.
20
+ * @returns {Array<Recorded>} Reports collected from the probe.
21
+ */
22
+ export function collectReports(rule, visitorKey, node) {
23
+ const reports = [];
24
+ const visitor = wrap("probe", rule);
25
+ visitor.create({ report: (d) => reports.push(d) })[visitorKey]?.(node);
26
+ return reports;
27
+ }
28
+ /** Bind vitest reporting into RuleTester so suites run under the project runner.
29
+ *
30
+ * @returns {RuleTester} A RuleTester wired to vitest's describe/it.
31
+ */
32
+ export function makeTester() {
33
+ RuleTester.describe = (name, fn) => describe(name, fn);
34
+ RuleTester.it = (name, fn) => it(name, fn);
35
+ return new RuleTester({ languageOptions: { parserOptions: { lang: "ts" } } });
36
+ }
37
+ /** Build an ESTree member expression on a fixed `node` object for visitor probes.
38
+ *
39
+ * @param {boolean} computed - Whether the member access is computed.
40
+ * @param {string} propertyName_ - The property identifier name.
41
+ * @returns {ESTree.Node} The synthetic member expression node.
42
+ */
43
+ export function memberExpression(computed, propertyName_) {
44
+ return {
45
+ type: "MemberExpression",
46
+ computed,
47
+ object: { type: "Identifier", name: "node" },
48
+ property: { type: "Identifier", name: propertyName_ },
49
+ };
50
+ }
51
+ export const identifiers = fc
52
+ .stringMatching(/^[a-zA-Z_$][a-zA-Z0-9_$]{0,7}$/u)
53
+ .filter((s) => !["const", "let", "var", "function", "class"].includes(s));
@@ -0,0 +1,18 @@
1
+ import type { ESTree, SourceCode } from "@oxlint/plugins";
2
+ /**
3
+ * Ancestor chain accessor returning oxlint's native order: outermost-first
4
+ * (Program at index 0, immediate parent last). Reverse it to walk outward
5
+ * from a node.
6
+ *
7
+ * Oxlint types `getAncestors` as returning an opaque span-only `Node`, not
8
+ * the exported ESTree union; recover that union once here.
9
+ *
10
+ * Oxlint's `sourceCode.getAncestors` returns an internal Node type rather than
11
+ * the exported ESTree union; recover the union once here so rule code can
12
+ * narrow on `type` discriminants without per-site casts.
13
+ *
14
+ * @param {SourceCode} sourceCode - The rule's source-code accessor.
15
+ * @param {ESTree.Node} node - The node whose ancestor chain is requested.
16
+ * @returns {ReadonlyArray<ESTree.Node>} Nearest-first ancestor chain.
17
+ */
18
+ export declare function ancestorsOf(sourceCode: SourceCode, node: ESTree.Node): ReadonlyArray<ESTree.Node>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Ancestor chain accessor returning oxlint's native order: outermost-first
3
+ * (Program at index 0, immediate parent last). Reverse it to walk outward
4
+ * from a node.
5
+ *
6
+ * Oxlint types `getAncestors` as returning an opaque span-only `Node`, not
7
+ * the exported ESTree union; recover that union once here.
8
+ *
9
+ * Oxlint's `sourceCode.getAncestors` returns an internal Node type rather than
10
+ * the exported ESTree union; recover the union once here so rule code can
11
+ * narrow on `type` discriminants without per-site casts.
12
+ *
13
+ * @param {SourceCode} sourceCode - The rule's source-code accessor.
14
+ * @param {ESTree.Node} node - The node whose ancestor chain is requested.
15
+ * @returns {ReadonlyArray<ESTree.Node>} Nearest-first ancestor chain.
16
+ */
17
+ export function ancestorsOf(sourceCode, node) {
18
+ return sourceCode.getAncestors(node);
19
+ }
@@ -0,0 +1,12 @@
1
+ import type { ESTree } from "@oxlint/plugins";
2
+ /**
3
+ * Child nodes of an ESTree node via reflection over its fields.
4
+ *
5
+ * SAFETY: node fields are owned by the AST grammar (see NodeFieldValue); the
6
+ * object/array discrimination here is the field-to-child boundary. Prefer
7
+ * declared visitors; use this only for custom descent orders.
8
+ *
9
+ * @param {ESTree.Node} node - The parent AST node.
10
+ * @returns {Array<ESTree.Node>} Direct child nodes, in field order.
11
+ */
12
+ export declare function childNodes(node: ESTree.Node): Array<ESTree.Node>;
@@ -0,0 +1,26 @@
1
+ import { isNode } from "./is-node.js";
2
+ import { readField } from "./structural.js";
3
+ /**
4
+ * Child nodes of an ESTree node via reflection over its fields.
5
+ *
6
+ * SAFETY: node fields are owned by the AST grammar (see NodeFieldValue); the
7
+ * object/array discrimination here is the field-to-child boundary. Prefer
8
+ * declared visitors; use this only for custom descent orders.
9
+ *
10
+ * @param {ESTree.Node} node - The parent AST node.
11
+ * @returns {Array<ESTree.Node>} Direct child nodes, in field order.
12
+ */
13
+ export function childNodes(node) {
14
+ const children = [];
15
+ for (const key of Object.keys(node)) {
16
+ if (key === "parent" || key === "loc" || key === "range")
17
+ continue;
18
+ const value = readField(node, key);
19
+ const candidates = Array.isArray(value) ? value : [value];
20
+ for (const candidate of candidates) {
21
+ if (isNode(candidate))
22
+ children.push(candidate);
23
+ }
24
+ }
25
+ return children;
26
+ }
@@ -0,0 +1,55 @@
1
+ import type { ESTree } from "@oxlint/plugins";
2
+ export type UnsafeDictionary = {
3
+ readonly kind: "unsafe-dictionary";
4
+ readonly unsafeValue: "any" | "empty-object" | "object" | "union" | "unknown";
5
+ };
6
+ export type WideningTargetKind = "anonymous object" | "generic container" | "object" | "open dictionary" | "unknown";
7
+ export type WideningTarget = {
8
+ readonly kind: WideningTargetKind;
9
+ };
10
+ export type TypeEnvironment = {
11
+ readonly aliases: ReadonlyMap<string, ESTree.TSTypeAliasDeclaration>;
12
+ readonly interfaces: ReadonlyMap<string, readonly ESTree.TSInterfaceDeclaration[]>;
13
+ readonly shadowedBuiltIns: ReadonlySet<string>;
14
+ };
15
+ /**
16
+ * Build the alias/interface maps for a program so type references can be
17
+ * resolved to their declarations during dictionary classification.
18
+ * @param {ESTree.Program} program - Root AST node of the file under lint.
19
+ * @returns {TypeEnvironment} Environment mapping declared names to their declaration nodes.
20
+ */
21
+ export declare function createTypeEnvironment(program: ESTree.Program): TypeEnvironment;
22
+ /**
23
+ * Classify a single type as an unsafe dictionary value, if it is one.
24
+ * @param {ESTree.TSType} valueType - Type annotation of the dictionary value slot.
25
+ * @param {TypeEnvironment} environment - Declared-alias environment from createTypeEnvironment.
26
+ * @returns {UnsafeDictionary | null} The unsafe kind ("any", "unknown", "object", "empty-object") or null.
27
+ */
28
+ export declare function classifyUnsafeDictionaryValue(valueType: ESTree.TSType, environment: TypeEnvironment): UnsafeDictionary | null;
29
+ /**
30
+ * Classify the value side of an index-signature or Record dictionary.
31
+ * @param {ESTree.TSType} type - The dictionary type node being inspected.
32
+ * @param {TypeEnvironment} environment - Declared-alias environment from createTypeEnvironment.
33
+ * @returns {UnsafeDictionary | null} Classification with kind and location, or null when safe.
34
+ */
35
+ export declare function classifyUnsafeDictionary(type: ESTree.TSType, environment: TypeEnvironment): UnsafeDictionary | null;
36
+ /**
37
+ * Describe what a widening assignment erases, for report messaging.
38
+ * @param {ESTree.TSType} type - The assigned (widened) type.
39
+ * @param {TypeEnvironment} environment - Declared-alias environment from createTypeEnvironment.
40
+ * @returns {WideningTarget | null} Human-readable target description, or null when not a widening.
41
+ */
42
+ export declare function classifyWideningTarget(type: ESTree.TSType, environment: TypeEnvironment): WideningTarget | null;
43
+ /**
44
+ * Whether an expression is an object literal carrying at least one property.
45
+ * @param {ESTree.Expression} expression - Candidate expression node.
46
+ * @returns {boolean} True only for ObjectExpression nodes with members.
47
+ */
48
+ export declare function isPopulatedObjectExpression(expression: ESTree.Expression): boolean;
49
+ /**
50
+ * Whether an expression carries first-hand type evidence (schema parse,
51
+ * literal, typed constructor) and therefore needs no further guarding.
52
+ * @param {ESTree.Expression} expression - Candidate expression node.
53
+ * @returns {boolean} True when the expression is self-evidencing.
54
+ */
55
+ export declare function isKnownEvidenceExpression(expression: ESTree.Expression): boolean;