@opensip-cli/checks-typescript 0.1.10 → 0.1.11

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 (244) hide show
  1. package/README.md +4 -2
  2. package/dist/__tests__/all-checks-execute.test.d.ts.map +1 -1
  3. package/dist/__tests__/all-checks-execute.test.js +0 -1
  4. package/dist/__tests__/all-checks-execute.test.js.map +1 -1
  5. package/dist/__tests__/behavior-fixtures-2.test.d.ts.map +1 -1
  6. package/dist/__tests__/behavior-fixtures-2.test.js +0 -1
  7. package/dist/__tests__/behavior-fixtures-2.test.js.map +1 -1
  8. package/dist/__tests__/behavior-fixtures-3.test.d.ts.map +1 -1
  9. package/dist/__tests__/behavior-fixtures-3.test.js +0 -1
  10. package/dist/__tests__/behavior-fixtures-3.test.js.map +1 -1
  11. package/dist/__tests__/behavior-fixtures-4.test.d.ts.map +1 -1
  12. package/dist/__tests__/behavior-fixtures-4.test.js +0 -1
  13. package/dist/__tests__/behavior-fixtures-4.test.js.map +1 -1
  14. package/dist/__tests__/behavior-fixtures-5.test.d.ts.map +1 -1
  15. package/dist/__tests__/behavior-fixtures-5.test.js +0 -1
  16. package/dist/__tests__/behavior-fixtures-5.test.js.map +1 -1
  17. package/dist/__tests__/behavior-fixtures-6.test.js +10 -0
  18. package/dist/__tests__/behavior-fixtures-6.test.js.map +1 -1
  19. package/dist/__tests__/behavior-fixtures.test.d.ts.map +1 -1
  20. package/dist/__tests__/behavior-fixtures.test.js +2 -4
  21. package/dist/__tests__/behavior-fixtures.test.js.map +1 -1
  22. package/dist/__tests__/branch-fixtures-2.test.d.ts.map +1 -1
  23. package/dist/__tests__/branch-fixtures-2.test.js +0 -1
  24. package/dist/__tests__/branch-fixtures-2.test.js.map +1 -1
  25. package/dist/__tests__/branch-fixtures-3.test.d.ts.map +1 -1
  26. package/dist/__tests__/branch-fixtures-3.test.js +0 -1
  27. package/dist/__tests__/branch-fixtures-3.test.js.map +1 -1
  28. package/dist/__tests__/branch-fixtures.test.d.ts.map +1 -1
  29. package/dist/__tests__/branch-fixtures.test.js +0 -1
  30. package/dist/__tests__/branch-fixtures.test.js.map +1 -1
  31. package/dist/checks/architecture/__tests__/live-view-through-cli-live.test.d.ts +2 -0
  32. package/dist/checks/architecture/__tests__/live-view-through-cli-live.test.d.ts.map +1 -0
  33. package/dist/checks/architecture/__tests__/live-view-through-cli-live.test.js +13 -0
  34. package/dist/checks/architecture/__tests__/live-view-through-cli-live.test.js.map +1 -0
  35. package/dist/checks/architecture/contracts-schema-consistency.d.ts.map +1 -1
  36. package/dist/checks/architecture/contracts-schema-consistency.js +0 -3
  37. package/dist/checks/architecture/contracts-schema-consistency.js.map +1 -1
  38. package/dist/checks/architecture/drizzle-orm-migration-guardrails.d.ts.map +1 -1
  39. package/dist/checks/architecture/drizzle-orm-migration-guardrails.js +1 -0
  40. package/dist/checks/architecture/drizzle-orm-migration-guardrails.js.map +1 -1
  41. package/dist/checks/architecture/index.d.ts +1 -0
  42. package/dist/checks/architecture/index.d.ts.map +1 -1
  43. package/dist/checks/architecture/index.js +1 -0
  44. package/dist/checks/architecture/index.js.map +1 -1
  45. package/dist/checks/architecture/live-view-through-cli-live.d.ts +8 -0
  46. package/dist/checks/architecture/live-view-through-cli-live.d.ts.map +1 -0
  47. package/dist/checks/architecture/live-view-through-cli-live.js +43 -0
  48. package/dist/checks/architecture/live-view-through-cli-live.js.map +1 -0
  49. package/dist/checks/architecture/missing-type-exports.d.ts.map +1 -1
  50. package/dist/checks/architecture/missing-type-exports.js +1 -1
  51. package/dist/checks/architecture/missing-type-exports.js.map +1 -1
  52. package/dist/checks/architecture/module-coupling-fan-out.d.ts.map +1 -1
  53. package/dist/checks/architecture/module-coupling-fan-out.js +6 -2
  54. package/dist/checks/architecture/module-coupling-fan-out.js.map +1 -1
  55. package/dist/checks/architecture/no-bootstrap-tool-import.d.ts.map +1 -1
  56. package/dist/checks/architecture/no-bootstrap-tool-import.js +1 -0
  57. package/dist/checks/architecture/no-bootstrap-tool-import.js.map +1 -1
  58. package/dist/checks/architecture/no-run-done-result.d.ts.map +1 -1
  59. package/dist/checks/architecture/no-run-done-result.js +1 -0
  60. package/dist/checks/architecture/no-run-done-result.js.map +1 -1
  61. package/dist/checks/architecture/package-json-exports-field.d.ts.map +1 -1
  62. package/dist/checks/architecture/package-json-exports-field.js +1 -1
  63. package/dist/checks/architecture/package-json-exports-field.js.map +1 -1
  64. package/dist/checks/architecture/phantom-dependency-detection.d.ts.map +1 -1
  65. package/dist/checks/architecture/phantom-dependency-detection.js +0 -3
  66. package/dist/checks/architecture/phantom-dependency-detection.js.map +1 -1
  67. package/dist/checks/architecture/tsconfig-extends-validation.d.ts.map +1 -1
  68. package/dist/checks/architecture/tsconfig-extends-validation.js +0 -2
  69. package/dist/checks/architecture/tsconfig-extends-validation.js.map +1 -1
  70. package/dist/checks/quality/code-structure/__tests__/duplicate-utility-lang-substrate.test.d.ts +5 -0
  71. package/dist/checks/quality/code-structure/__tests__/duplicate-utility-lang-substrate.test.d.ts.map +1 -0
  72. package/dist/checks/quality/code-structure/__tests__/duplicate-utility-lang-substrate.test.js +17 -0
  73. package/dist/checks/quality/code-structure/__tests__/duplicate-utility-lang-substrate.test.js.map +1 -0
  74. package/dist/checks/quality/code-structure/duplicate-utility-functions-config.d.ts +18 -0
  75. package/dist/checks/quality/code-structure/duplicate-utility-functions-config.d.ts.map +1 -0
  76. package/dist/checks/quality/code-structure/duplicate-utility-functions-config.js +36 -0
  77. package/dist/checks/quality/code-structure/duplicate-utility-functions-config.js.map +1 -0
  78. package/dist/checks/quality/code-structure/duplicate-utility-functions-helpers.d.ts +15 -0
  79. package/dist/checks/quality/code-structure/duplicate-utility-functions-helpers.d.ts.map +1 -0
  80. package/dist/checks/quality/code-structure/duplicate-utility-functions-helpers.js +288 -0
  81. package/dist/checks/quality/code-structure/duplicate-utility-functions-helpers.js.map +1 -0
  82. package/dist/checks/quality/code-structure/duplicate-utility-functions.d.ts +1 -26
  83. package/dist/checks/quality/code-structure/duplicate-utility-functions.d.ts.map +1 -1
  84. package/dist/checks/quality/code-structure/duplicate-utility-functions.js +3 -407
  85. package/dist/checks/quality/code-structure/duplicate-utility-functions.js.map +1 -1
  86. package/dist/checks/quality/data-integrity/__tests__/null-safety-fp.test.js +39 -2
  87. package/dist/checks/quality/data-integrity/__tests__/null-safety-fp.test.js.map +1 -1
  88. package/dist/checks/quality/data-integrity/array-validation-detectors.d.ts +17 -0
  89. package/dist/checks/quality/data-integrity/array-validation-detectors.d.ts.map +1 -0
  90. package/dist/checks/quality/data-integrity/array-validation-detectors.js +184 -0
  91. package/dist/checks/quality/data-integrity/array-validation-detectors.js.map +1 -0
  92. package/dist/checks/quality/data-integrity/array-validation.d.ts +0 -2
  93. package/dist/checks/quality/data-integrity/array-validation.d.ts.map +1 -1
  94. package/dist/checks/quality/data-integrity/array-validation.js +2 -360
  95. package/dist/checks/quality/data-integrity/array-validation.js.map +1 -1
  96. package/dist/checks/quality/data-integrity/database-schema-validation.d.ts.map +1 -1
  97. package/dist/checks/quality/data-integrity/database-schema-validation.js +0 -1
  98. package/dist/checks/quality/data-integrity/database-schema-validation.js.map +1 -1
  99. package/dist/checks/quality/data-integrity/null-safety-analyze.d.ts +33 -0
  100. package/dist/checks/quality/data-integrity/null-safety-analyze.d.ts.map +1 -0
  101. package/dist/checks/quality/data-integrity/null-safety-analyze.js +164 -0
  102. package/dist/checks/quality/data-integrity/null-safety-analyze.js.map +1 -0
  103. package/dist/checks/quality/data-integrity/null-safety-config.d.ts +50 -0
  104. package/dist/checks/quality/data-integrity/null-safety-config.d.ts.map +1 -0
  105. package/dist/checks/quality/data-integrity/null-safety-config.js +69 -0
  106. package/dist/checks/quality/data-integrity/null-safety-config.js.map +1 -0
  107. package/dist/checks/quality/data-integrity/null-safety-heuristics.d.ts +76 -0
  108. package/dist/checks/quality/data-integrity/null-safety-heuristics.d.ts.map +1 -0
  109. package/dist/checks/quality/data-integrity/null-safety-heuristics.js +276 -0
  110. package/dist/checks/quality/data-integrity/null-safety-heuristics.js.map +1 -0
  111. package/dist/checks/quality/data-integrity/null-safety-prefixes.d.ts +13 -0
  112. package/dist/checks/quality/data-integrity/null-safety-prefixes.d.ts.map +1 -0
  113. package/dist/checks/quality/data-integrity/null-safety-prefixes.js +333 -0
  114. package/dist/checks/quality/data-integrity/null-safety-prefixes.js.map +1 -0
  115. package/dist/checks/quality/data-integrity/null-safety.d.ts +2 -82
  116. package/dist/checks/quality/data-integrity/null-safety.d.ts.map +1 -1
  117. package/dist/checks/quality/data-integrity/null-safety.js +3 -796
  118. package/dist/checks/quality/data-integrity/null-safety.js.map +1 -1
  119. package/dist/checks/quality/frontend/test-only-frontend-modules.d.ts.map +1 -1
  120. package/dist/checks/quality/frontend/test-only-frontend-modules.js +0 -2
  121. package/dist/checks/quality/frontend/test-only-frontend-modules.js.map +1 -1
  122. package/dist/checks/quality/linting/typescript-frontend.d.ts.map +1 -1
  123. package/dist/checks/quality/linting/typescript-frontend.js +1 -0
  124. package/dist/checks/quality/linting/typescript-frontend.js.map +1 -1
  125. package/dist/checks/quality/observability/logger-event-name-format.d.ts.map +1 -1
  126. package/dist/checks/quality/observability/logger-event-name-format.js +0 -1
  127. package/dist/checks/quality/observability/logger-event-name-format.js.map +1 -1
  128. package/dist/checks/quality/observability/no-hardcoded-correlation-id.d.ts.map +1 -1
  129. package/dist/checks/quality/observability/no-hardcoded-correlation-id.js +2 -3
  130. package/dist/checks/quality/observability/no-hardcoded-correlation-id.js.map +1 -1
  131. package/dist/checks/quality/patterns/__tests__/async-waterfall-sequential.test.d.ts +8 -0
  132. package/dist/checks/quality/patterns/__tests__/async-waterfall-sequential.test.d.ts.map +1 -0
  133. package/dist/checks/quality/patterns/__tests__/async-waterfall-sequential.test.js +87 -0
  134. package/dist/checks/quality/patterns/__tests__/async-waterfall-sequential.test.js.map +1 -0
  135. package/dist/checks/quality/patterns/__tests__/error-handling-probes.test.d.ts +2 -0
  136. package/dist/checks/quality/patterns/__tests__/error-handling-probes.test.d.ts.map +1 -0
  137. package/dist/checks/quality/patterns/__tests__/error-handling-probes.test.js +51 -0
  138. package/dist/checks/quality/patterns/__tests__/error-handling-probes.test.js.map +1 -0
  139. package/dist/checks/quality/patterns/__tests__/result-pattern-registration-guards.test.d.ts +2 -0
  140. package/dist/checks/quality/patterns/__tests__/result-pattern-registration-guards.test.d.ts.map +1 -0
  141. package/dist/checks/quality/patterns/__tests__/result-pattern-registration-guards.test.js +89 -0
  142. package/dist/checks/quality/patterns/__tests__/result-pattern-registration-guards.test.js.map +1 -0
  143. package/dist/checks/quality/patterns/__tests__/throws-documentation-analyze.test.d.ts +5 -0
  144. package/dist/checks/quality/patterns/__tests__/throws-documentation-analyze.test.d.ts.map +1 -0
  145. package/dist/checks/quality/patterns/__tests__/throws-documentation-analyze.test.js +78 -0
  146. package/dist/checks/quality/patterns/__tests__/throws-documentation-analyze.test.js.map +1 -0
  147. package/dist/checks/quality/patterns/__tests__/toctou-fp.test.js +44 -0
  148. package/dist/checks/quality/patterns/__tests__/toctou-fp.test.js.map +1 -1
  149. package/dist/checks/quality/patterns/async-waterfall-analysis.d.ts +17 -0
  150. package/dist/checks/quality/patterns/async-waterfall-analysis.d.ts.map +1 -0
  151. package/dist/checks/quality/patterns/async-waterfall-analysis.js +215 -0
  152. package/dist/checks/quality/patterns/async-waterfall-analysis.js.map +1 -0
  153. package/dist/checks/quality/patterns/async-waterfall-branch-keys.d.ts +6 -0
  154. package/dist/checks/quality/patterns/async-waterfall-branch-keys.d.ts.map +1 -0
  155. package/dist/checks/quality/patterns/async-waterfall-branch-keys.js +54 -0
  156. package/dist/checks/quality/patterns/async-waterfall-branch-keys.js.map +1 -0
  157. package/dist/checks/quality/patterns/async-waterfall-detection.d.ts.map +1 -1
  158. package/dist/checks/quality/patterns/async-waterfall-detection.js +3 -352
  159. package/dist/checks/quality/patterns/async-waterfall-detection.js.map +1 -1
  160. package/dist/checks/quality/patterns/containing-function-name.d.ts +3 -0
  161. package/dist/checks/quality/patterns/containing-function-name.d.ts.map +1 -0
  162. package/dist/checks/quality/patterns/containing-function-name.js +21 -0
  163. package/dist/checks/quality/patterns/containing-function-name.js.map +1 -0
  164. package/dist/checks/quality/patterns/error-handling-quality.d.ts +3 -0
  165. package/dist/checks/quality/patterns/error-handling-quality.d.ts.map +1 -1
  166. package/dist/checks/quality/patterns/error-handling-quality.js +150 -30
  167. package/dist/checks/quality/patterns/error-handling-quality.js.map +1 -1
  168. package/dist/checks/quality/patterns/result-pattern-consistency.d.ts +3 -0
  169. package/dist/checks/quality/patterns/result-pattern-consistency.d.ts.map +1 -1
  170. package/dist/checks/quality/patterns/result-pattern-consistency.js +136 -69
  171. package/dist/checks/quality/patterns/result-pattern-consistency.js.map +1 -1
  172. package/dist/checks/quality/patterns/throws-documentation-analyze.d.ts +14 -0
  173. package/dist/checks/quality/patterns/throws-documentation-analyze.d.ts.map +1 -0
  174. package/dist/checks/quality/patterns/throws-documentation-analyze.js +352 -0
  175. package/dist/checks/quality/patterns/throws-documentation-analyze.js.map +1 -0
  176. package/dist/checks/quality/patterns/throws-documentation-constants.d.ts +15 -0
  177. package/dist/checks/quality/patterns/throws-documentation-constants.d.ts.map +1 -0
  178. package/dist/checks/quality/patterns/throws-documentation-constants.js +94 -0
  179. package/dist/checks/quality/patterns/throws-documentation-constants.js.map +1 -0
  180. package/dist/checks/quality/patterns/throws-documentation.d.ts +1 -11
  181. package/dist/checks/quality/patterns/throws-documentation.d.ts.map +1 -1
  182. package/dist/checks/quality/patterns/throws-documentation.js +4 -472
  183. package/dist/checks/quality/patterns/throws-documentation.js.map +1 -1
  184. package/dist/checks/quality/patterns/toctou-race-condition-classify.d.ts +23 -0
  185. package/dist/checks/quality/patterns/toctou-race-condition-classify.d.ts.map +1 -0
  186. package/dist/checks/quality/patterns/toctou-race-condition-classify.js +125 -0
  187. package/dist/checks/quality/patterns/toctou-race-condition-classify.js.map +1 -0
  188. package/dist/checks/quality/patterns/toctou-race-condition-collection.d.ts +24 -0
  189. package/dist/checks/quality/patterns/toctou-race-condition-collection.d.ts.map +1 -0
  190. package/dist/checks/quality/patterns/toctou-race-condition-collection.js +248 -0
  191. package/dist/checks/quality/patterns/toctou-race-condition-collection.js.map +1 -0
  192. package/dist/checks/quality/patterns/toctou-race-condition-constants.d.ts +32 -0
  193. package/dist/checks/quality/patterns/toctou-race-condition-constants.d.ts.map +1 -0
  194. package/dist/checks/quality/patterns/toctou-race-condition-constants.js +115 -0
  195. package/dist/checks/quality/patterns/toctou-race-condition-constants.js.map +1 -0
  196. package/dist/checks/quality/patterns/toctou-race-condition.d.ts +1 -29
  197. package/dist/checks/quality/patterns/toctou-race-condition.d.ts.map +1 -1
  198. package/dist/checks/quality/patterns/toctou-race-condition.js +11 -536
  199. package/dist/checks/quality/patterns/toctou-race-condition.js.map +1 -1
  200. package/dist/checks/quality/unused-config-options.d.ts.map +1 -1
  201. package/dist/checks/quality/unused-config-options.js +0 -4
  202. package/dist/checks/quality/unused-config-options.js.map +1 -1
  203. package/dist/checks/resilience/__tests__/detached-promises-sync-detection.test.d.ts +2 -0
  204. package/dist/checks/resilience/__tests__/detached-promises-sync-detection.test.d.ts.map +1 -0
  205. package/dist/checks/resilience/__tests__/detached-promises-sync-detection.test.js +98 -0
  206. package/dist/checks/resilience/__tests__/detached-promises-sync-detection.test.js.map +1 -0
  207. package/dist/checks/resilience/callback-invocation-safe.d.ts.map +1 -1
  208. package/dist/checks/resilience/callback-invocation-safe.js +0 -1
  209. package/dist/checks/resilience/callback-invocation-safe.js.map +1 -1
  210. package/dist/checks/resilience/context-leakage.d.ts.map +1 -1
  211. package/dist/checks/resilience/context-leakage.js +1 -0
  212. package/dist/checks/resilience/context-leakage.js.map +1 -1
  213. package/dist/checks/resilience/detached-promises-detection.d.ts +7 -0
  214. package/dist/checks/resilience/detached-promises-detection.d.ts.map +1 -0
  215. package/dist/checks/resilience/detached-promises-detection.js +228 -0
  216. package/dist/checks/resilience/detached-promises-detection.js.map +1 -0
  217. package/dist/checks/resilience/detached-promises-sync-constants.d.ts +36 -0
  218. package/dist/checks/resilience/detached-promises-sync-constants.d.ts.map +1 -0
  219. package/dist/checks/resilience/detached-promises-sync-constants.js +299 -0
  220. package/dist/checks/resilience/detached-promises-sync-constants.js.map +1 -0
  221. package/dist/checks/resilience/detached-promises-sync-detection.d.ts +14 -0
  222. package/dist/checks/resilience/detached-promises-sync-detection.d.ts.map +1 -0
  223. package/dist/checks/resilience/detached-promises-sync-detection.js +69 -0
  224. package/dist/checks/resilience/detached-promises-sync-detection.js.map +1 -0
  225. package/dist/checks/resilience/detached-promises.d.ts +1 -14
  226. package/dist/checks/resilience/detached-promises.d.ts.map +1 -1
  227. package/dist/checks/resilience/detached-promises.js +2 -598
  228. package/dist/checks/resilience/detached-promises.js.map +1 -1
  229. package/dist/checks/resilience/no-raw-fetch.d.ts.map +1 -1
  230. package/dist/checks/resilience/no-raw-fetch.js +1 -0
  231. package/dist/checks/resilience/no-raw-fetch.js.map +1 -1
  232. package/dist/checks/resilience/no-unbounded-concurrency.d.ts.map +1 -1
  233. package/dist/checks/resilience/no-unbounded-concurrency.js +1 -0
  234. package/dist/checks/resilience/no-unbounded-concurrency.js.map +1 -1
  235. package/dist/checks/security/sql-injection.d.ts.map +1 -1
  236. package/dist/checks/security/sql-injection.js +0 -1
  237. package/dist/checks/security/sql-injection.js.map +1 -1
  238. package/dist/display/architecture.d.ts.map +1 -1
  239. package/dist/display/architecture.js +1 -0
  240. package/dist/display/architecture.js.map +1 -1
  241. package/dist/display/types.d.ts.map +1 -1
  242. package/dist/display/types.js +0 -1
  243. package/dist/display/types.js.map +1 -1
  244. package/package.json +5 -5
@@ -3,88 +3,8 @@
3
3
  *
4
4
  * Detects unsafe property and method access without null checks.
5
5
  */
6
- import { type CheckViolation } from '@opensip-cli/fitness';
7
- import * as ts from 'typescript';
8
- /**
9
- * Recipe-config shape for null-safety. Project-specific safe-by-construction
10
- * paths and factory/builder symbols belong in a recipe's
11
- * `checks.config['null-safety']` block, not in the check's built-in defaults.
12
- */
13
- export interface NullSafetyConfig extends Record<string, unknown> {
14
- /**
15
- * Additional path patterns whose files are skipped entirely. Each entry
16
- * is compiled to a case-insensitive RegExp via `new RegExp(entry, 'i')`.
17
- */
18
- additionalSafeNullPaths?: readonly string[];
19
- /**
20
- * Additional call-text prefixes treated as non-null by construction (a
21
- * property access on a matching call result is not flagged). Use this for
22
- * PROJECT-SPECIFIC factory/builder functions whose non-null contract is
23
- * local to your codebase — do not hardcode them into the shipped check.
24
- * Matched via `String.prototype.startsWith` against the full call text.
25
- */
26
- additionalSafeBuilders?: readonly string[];
27
- /**
28
- * Use TYPE-AWARE analysis (a real `ts.Program` + `TypeChecker`): a property
29
- * access on a call/element-access result is flagged only when the receiver's
30
- * ACTUAL static type includes `null`/`undefined` (`any`/`unknown`/unresolved →
31
- * not flagged; the checker also handles control-flow narrowing, builder/Zod
32
- * return types, and chain depth, so the verb-prefix convention does not apply).
33
- * `additionalSafeBuilders` remains a manual escape hatch for symbols the checker
34
- * cannot resolve.
35
- *
36
- * **Default `true`** (D2). Set `false` to fall back to the legacy
37
- * name/convention heuristic (faster, no Program build, but higher
38
- * false-negative rate — it trusts any `get*`/`find*`/… call as non-null).
39
- */
40
- typeAware?: boolean;
41
- }
42
- /**
43
- * Call prefixes whose results are non-null by construction, so a property
44
- * access on them needs no guard. Scope is deliberately limited to facts that
45
- * hold for ANY codebase:
46
- *
47
- * 1. Language / runtime guarantees — `Object.*`, `Array.*`, `JSON.*`,
48
- * `new URL()`, Node `crypto`/`child_process`, `Intl`, the TS compiler API.
49
- * 2. Widely-used libraries whose builder/query APIs are documented non-null
50
- * — Zod, TypeORM, Drizzle, better-sqlite3, neverthrow `Result`, Express.
51
- * 3. Generic builder-pattern conventions — `builder.`, `*ResultBuilder.`.
52
- *
53
- * PROJECT-SPECIFIC safe symbols must NOT be hardcoded here: baking one
54
- * codebase's invariants into a generic check silently suppresses real null
55
- * bugs in every other codebase (e.g. an adopter whose own `getThing()` can
56
- * return null). Adopters extend this set with their own factories via the
57
- * `additionalSafeBuilders` recipe-config key — see `buildEffectiveSafeBuilders`.
58
- */
59
- export declare const SAFE_BUILDER_PREFIXES: string[];
60
- /**
61
- * Common method name prefixes that indicate safe (non-null) return values.
62
- * Methods starting with these prefixes are conventionally designed to always
63
- * return a value or throw, never return null/undefined.
64
- */
65
- export declare const SAFE_METHOD_PREFIXES: string[];
66
- /**
67
- * @param {*} content
68
- * @param {*} filePath
69
- * @returns {*}
70
- * Analyze a file for null safety issues. Exported for the FP-regression
71
- * suite (see `__tests__/null-safety-fp.test.ts`).
72
- */
73
- export declare function analyzeNullSafety(content: string, filePath: string): CheckViolation[];
74
- /**
75
- * Type-aware variant (D2): walk the Program's SourceFile and flag a property
76
- * access on a call/element-access result ONLY when the receiver's actual type
77
- * includes `null`/`undefined`. The TypeChecker subsumes every heuristic the
78
- * convention path uses — control-flow narrowing (guards), builder/Zod return
79
- * types, and chain depth all fall out of real types — so this detector is
80
- * deliberately minimal. Fail-open: `any`/`unknown`/unresolved types are not
81
- * nullable per `isTypeNullable`, so "the compiler doesn't know" never flags.
82
- *
83
- * Reads the same path skip + escape-hatch config as the convention path
84
- * (`additionalSafeNullPaths`, `additionalSafeBuilders`). Exported for the
85
- * type-aware test suite.
86
- */
87
- export declare function analyzeNullSafetyTyped(sourceFile: ts.SourceFile, checker: ts.TypeChecker, filePath: string): CheckViolation[];
6
+ export { analyzeNullSafety, analyzeNullSafetyTyped } from './null-safety-analyze.js';
7
+ export { SAFE_BUILDER_PREFIXES, SAFE_METHOD_PREFIXES } from './null-safety-config.js';
88
8
  /**
89
9
  * Check: quality/null-safety
90
10
  *
@@ -1 +1 @@
1
- {"version":3,"file":"null-safety.d.ts","sourceRoot":"","sources":["../../../../src/checks/quality/data-integrity/null-safety.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH,OAAO,EAIL,KAAK,cAAc,EAEpB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/D;;;OAGG;IACH,uBAAuB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAaD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,UA4DjC,CAAC;AAiTF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,UAwChC,CAAC;AAoOF;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,EAAE,CAmFrF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,EAAE,CAAC,UAAU,EACzB,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,QAAQ,EAAE,MAAM,GACf,cAAc,EAAE,CA4ClB;AAyBD;;;;GAIG;AACH,eAAO,MAAM,UAAU,sCA+CrB,CAAC"}
1
+ {"version":3,"file":"null-safety.d.ts","sourceRoot":"","sources":["../../../../src/checks/quality/data-integrity/null-safety.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEtF;;;;GAIG;AACH,eAAO,MAAM,UAAU,sCA+CrB,CAAC"}