@opensip-cli/checks-universal 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (620) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +31 -0
  4. package/dist/__tests__/all-checks-execute.test.d.ts +17 -0
  5. package/dist/__tests__/all-checks-execute.test.d.ts.map +1 -0
  6. package/dist/__tests__/all-checks-execute.test.js +452 -0
  7. package/dist/__tests__/all-checks-execute.test.js.map +1 -0
  8. package/dist/__tests__/behavior-fixtures-10.test.d.ts +8 -0
  9. package/dist/__tests__/behavior-fixtures-10.test.d.ts.map +1 -0
  10. package/dist/__tests__/behavior-fixtures-10.test.js +200 -0
  11. package/dist/__tests__/behavior-fixtures-10.test.js.map +1 -0
  12. package/dist/__tests__/behavior-fixtures-11.test.d.ts +8 -0
  13. package/dist/__tests__/behavior-fixtures-11.test.d.ts.map +1 -0
  14. package/dist/__tests__/behavior-fixtures-11.test.js +120 -0
  15. package/dist/__tests__/behavior-fixtures-11.test.js.map +1 -0
  16. package/dist/__tests__/behavior-fixtures-12.test.d.ts +8 -0
  17. package/dist/__tests__/behavior-fixtures-12.test.d.ts.map +1 -0
  18. package/dist/__tests__/behavior-fixtures-12.test.js +157 -0
  19. package/dist/__tests__/behavior-fixtures-12.test.js.map +1 -0
  20. package/dist/__tests__/behavior-fixtures-2.test.d.ts +8 -0
  21. package/dist/__tests__/behavior-fixtures-2.test.d.ts.map +1 -0
  22. package/dist/__tests__/behavior-fixtures-2.test.js +785 -0
  23. package/dist/__tests__/behavior-fixtures-2.test.js.map +1 -0
  24. package/dist/__tests__/behavior-fixtures-3.test.d.ts +6 -0
  25. package/dist/__tests__/behavior-fixtures-3.test.d.ts.map +1 -0
  26. package/dist/__tests__/behavior-fixtures-3.test.js +663 -0
  27. package/dist/__tests__/behavior-fixtures-3.test.js.map +1 -0
  28. package/dist/__tests__/behavior-fixtures-4.test.d.ts +5 -0
  29. package/dist/__tests__/behavior-fixtures-4.test.d.ts.map +1 -0
  30. package/dist/__tests__/behavior-fixtures-4.test.js +612 -0
  31. package/dist/__tests__/behavior-fixtures-4.test.js.map +1 -0
  32. package/dist/__tests__/behavior-fixtures-5.test.d.ts +5 -0
  33. package/dist/__tests__/behavior-fixtures-5.test.d.ts.map +1 -0
  34. package/dist/__tests__/behavior-fixtures-5.test.js +469 -0
  35. package/dist/__tests__/behavior-fixtures-5.test.js.map +1 -0
  36. package/dist/__tests__/behavior-fixtures-6.test.d.ts +8 -0
  37. package/dist/__tests__/behavior-fixtures-6.test.d.ts.map +1 -0
  38. package/dist/__tests__/behavior-fixtures-6.test.js +591 -0
  39. package/dist/__tests__/behavior-fixtures-6.test.js.map +1 -0
  40. package/dist/__tests__/behavior-fixtures-7.test.d.ts +5 -0
  41. package/dist/__tests__/behavior-fixtures-7.test.d.ts.map +1 -0
  42. package/dist/__tests__/behavior-fixtures-7.test.js +662 -0
  43. package/dist/__tests__/behavior-fixtures-7.test.js.map +1 -0
  44. package/dist/__tests__/behavior-fixtures-8.test.d.ts +11 -0
  45. package/dist/__tests__/behavior-fixtures-8.test.d.ts.map +1 -0
  46. package/dist/__tests__/behavior-fixtures-8.test.js +634 -0
  47. package/dist/__tests__/behavior-fixtures-8.test.js.map +1 -0
  48. package/dist/__tests__/behavior-fixtures-9.test.d.ts +11 -0
  49. package/dist/__tests__/behavior-fixtures-9.test.d.ts.map +1 -0
  50. package/dist/__tests__/behavior-fixtures-9.test.js +271 -0
  51. package/dist/__tests__/behavior-fixtures-9.test.js.map +1 -0
  52. package/dist/__tests__/behavior-fixtures.test.d.ts +14 -0
  53. package/dist/__tests__/behavior-fixtures.test.d.ts.map +1 -0
  54. package/dist/__tests__/behavior-fixtures.test.js +1423 -0
  55. package/dist/__tests__/behavior-fixtures.test.js.map +1 -0
  56. package/dist/__tests__/checks.test.d.ts +2 -0
  57. package/dist/__tests__/checks.test.d.ts.map +1 -0
  58. package/dist/__tests__/checks.test.js +61 -0
  59. package/dist/__tests__/checks.test.js.map +1 -0
  60. package/dist/__tests__/env-var-validation.test.d.ts +14 -0
  61. package/dist/__tests__/env-var-validation.test.d.ts.map +1 -0
  62. package/dist/__tests__/env-var-validation.test.js +53 -0
  63. package/dist/__tests__/env-var-validation.test.js.map +1 -0
  64. package/dist/__tests__/file-length-limit.test.d.ts +2 -0
  65. package/dist/__tests__/file-length-limit.test.d.ts.map +1 -0
  66. package/dist/__tests__/file-length-limit.test.js +29 -0
  67. package/dist/__tests__/file-length-limit.test.js.map +1 -0
  68. package/dist/__tests__/fixture-coverage.allowlist.d.ts +18 -0
  69. package/dist/__tests__/fixture-coverage.allowlist.d.ts.map +1 -0
  70. package/dist/__tests__/fixture-coverage.allowlist.js +35 -0
  71. package/dist/__tests__/fixture-coverage.allowlist.js.map +1 -0
  72. package/dist/__tests__/fixture-coverage.test.d.ts +13 -0
  73. package/dist/__tests__/fixture-coverage.test.d.ts.map +1 -0
  74. package/dist/__tests__/fixture-coverage.test.js +57 -0
  75. package/dist/__tests__/fixture-coverage.test.js.map +1 -0
  76. package/dist/__tests__/iic.test.d.ts +15 -0
  77. package/dist/__tests__/iic.test.d.ts.map +1 -0
  78. package/dist/__tests__/iic.test.js +316 -0
  79. package/dist/__tests__/iic.test.js.map +1 -0
  80. package/dist/__tests__/no-skipped-tests.test.d.ts +14 -0
  81. package/dist/__tests__/no-skipped-tests.test.d.ts.map +1 -0
  82. package/dist/__tests__/no-skipped-tests.test.js +144 -0
  83. package/dist/__tests__/no-skipped-tests.test.js.map +1 -0
  84. package/dist/__tests__/no-todo-comments.test.d.ts +2 -0
  85. package/dist/__tests__/no-todo-comments.test.d.ts.map +1 -0
  86. package/dist/__tests__/no-todo-comments.test.js +31 -0
  87. package/dist/__tests__/no-todo-comments.test.js.map +1 -0
  88. package/dist/__tests__/no-unimplemented-markers.test.d.ts +2 -0
  89. package/dist/__tests__/no-unimplemented-markers.test.d.ts.map +1 -0
  90. package/dist/__tests__/no-unimplemented-markers.test.js +140 -0
  91. package/dist/__tests__/no-unimplemented-markers.test.js.map +1 -0
  92. package/dist/__tests__/public-api-jsdoc-scope.test.d.ts +10 -0
  93. package/dist/__tests__/public-api-jsdoc-scope.test.d.ts.map +1 -0
  94. package/dist/__tests__/public-api-jsdoc-scope.test.js +176 -0
  95. package/dist/__tests__/public-api-jsdoc-scope.test.js.map +1 -0
  96. package/dist/__tests__/resilience-fp.test.d.ts +14 -0
  97. package/dist/__tests__/resilience-fp.test.d.ts.map +1 -0
  98. package/dist/__tests__/resilience-fp.test.js +110 -0
  99. package/dist/__tests__/resilience-fp.test.js.map +1 -0
  100. package/dist/checks/architecture/__tests__/no-kebab-option-indexing.test.d.ts +2 -0
  101. package/dist/checks/architecture/__tests__/no-kebab-option-indexing.test.d.ts.map +1 -0
  102. package/dist/checks/architecture/__tests__/no-kebab-option-indexing.test.js +32 -0
  103. package/dist/checks/architecture/__tests__/no-kebab-option-indexing.test.js.map +1 -0
  104. package/dist/checks/architecture/__tests__/tool-has-manifest.test.d.ts +2 -0
  105. package/dist/checks/architecture/__tests__/tool-has-manifest.test.d.ts.map +1 -0
  106. package/dist/checks/architecture/__tests__/tool-has-manifest.test.js +152 -0
  107. package/dist/checks/architecture/__tests__/tool-has-manifest.test.js.map +1 -0
  108. package/dist/checks/architecture/__tests__/vitest-config-required-with-tests.test.d.ts +2 -0
  109. package/dist/checks/architecture/__tests__/vitest-config-required-with-tests.test.d.ts.map +1 -0
  110. package/dist/checks/architecture/__tests__/vitest-config-required-with-tests.test.js +129 -0
  111. package/dist/checks/architecture/__tests__/vitest-config-required-with-tests.test.js.map +1 -0
  112. package/dist/checks/architecture/_yaml-doc-bindings.d.ts +23 -0
  113. package/dist/checks/architecture/_yaml-doc-bindings.d.ts.map +1 -0
  114. package/dist/checks/architecture/_yaml-doc-bindings.js +29 -0
  115. package/dist/checks/architecture/_yaml-doc-bindings.js.map +1 -0
  116. package/dist/checks/architecture/dependencies/index.d.ts +2 -0
  117. package/dist/checks/architecture/dependencies/index.d.ts.map +1 -0
  118. package/dist/checks/architecture/dependencies/index.js +2 -0
  119. package/dist/checks/architecture/dependencies/index.js.map +1 -0
  120. package/dist/checks/architecture/dependencies/no-duplicate-packages.d.ts +11 -0
  121. package/dist/checks/architecture/dependencies/no-duplicate-packages.d.ts.map +1 -0
  122. package/dist/checks/architecture/dependencies/no-duplicate-packages.js +171 -0
  123. package/dist/checks/architecture/dependencies/no-duplicate-packages.js.map +1 -0
  124. package/dist/checks/architecture/docker-best-practices.d.ts +23 -0
  125. package/dist/checks/architecture/docker-best-practices.d.ts.map +1 -0
  126. package/dist/checks/architecture/docker-best-practices.js +427 -0
  127. package/dist/checks/architecture/docker-best-practices.js.map +1 -0
  128. package/dist/checks/architecture/docker-ignore-validation.d.ts +18 -0
  129. package/dist/checks/architecture/docker-ignore-validation.d.ts.map +1 -0
  130. package/dist/checks/architecture/docker-ignore-validation.js +117 -0
  131. package/dist/checks/architecture/docker-ignore-validation.js.map +1 -0
  132. package/dist/checks/architecture/docker-version-sync.d.ts +16 -0
  133. package/dist/checks/architecture/docker-version-sync.d.ts.map +1 -0
  134. package/dist/checks/architecture/docker-version-sync.js +193 -0
  135. package/dist/checks/architecture/docker-version-sync.js.map +1 -0
  136. package/dist/checks/architecture/env-var-validation.d.ts +14 -0
  137. package/dist/checks/architecture/env-var-validation.d.ts.map +1 -0
  138. package/dist/checks/architecture/env-var-validation.js +289 -0
  139. package/dist/checks/architecture/env-var-validation.js.map +1 -0
  140. package/dist/checks/architecture/heavy-import-detection.d.ts +11 -0
  141. package/dist/checks/architecture/heavy-import-detection.d.ts.map +1 -0
  142. package/dist/checks/architecture/heavy-import-detection.js +91 -0
  143. package/dist/checks/architecture/heavy-import-detection.js.map +1 -0
  144. package/dist/checks/architecture/index.d.ts +16 -0
  145. package/dist/checks/architecture/index.d.ts.map +1 -0
  146. package/dist/checks/architecture/index.js +16 -0
  147. package/dist/checks/architecture/index.js.map +1 -0
  148. package/dist/checks/architecture/modules/empty-package-detection.d.ts +11 -0
  149. package/dist/checks/architecture/modules/empty-package-detection.d.ts.map +1 -0
  150. package/dist/checks/architecture/modules/empty-package-detection.js +277 -0
  151. package/dist/checks/architecture/modules/empty-package-detection.js.map +1 -0
  152. package/dist/checks/architecture/modules/index.d.ts +3 -0
  153. package/dist/checks/architecture/modules/index.d.ts.map +1 -0
  154. package/dist/checks/architecture/modules/index.js +3 -0
  155. package/dist/checks/architecture/modules/index.js.map +1 -0
  156. package/dist/checks/architecture/modules/interface-implementation-consistency.d.ts +12 -0
  157. package/dist/checks/architecture/modules/interface-implementation-consistency.d.ts.map +1 -0
  158. package/dist/checks/architecture/modules/interface-implementation-consistency.js +555 -0
  159. package/dist/checks/architecture/modules/interface-implementation-consistency.js.map +1 -0
  160. package/dist/checks/architecture/no-custom-event-emitter.d.ts +11 -0
  161. package/dist/checks/architecture/no-custom-event-emitter.d.ts.map +1 -0
  162. package/dist/checks/architecture/no-custom-event-emitter.js +123 -0
  163. package/dist/checks/architecture/no-custom-event-emitter.js.map +1 -0
  164. package/dist/checks/architecture/no-kebab-option-indexing.d.ts +33 -0
  165. package/dist/checks/architecture/no-kebab-option-indexing.d.ts.map +1 -0
  166. package/dist/checks/architecture/no-kebab-option-indexing.js +81 -0
  167. package/dist/checks/architecture/no-kebab-option-indexing.js.map +1 -0
  168. package/dist/checks/architecture/node-version-consistency.d.ts +22 -0
  169. package/dist/checks/architecture/node-version-consistency.d.ts.map +1 -0
  170. package/dist/checks/architecture/node-version-consistency.js +225 -0
  171. package/dist/checks/architecture/node-version-consistency.js.map +1 -0
  172. package/dist/checks/architecture/project-readme-existence.d.ts +13 -0
  173. package/dist/checks/architecture/project-readme-existence.d.ts.map +1 -0
  174. package/dist/checks/architecture/project-readme-existence.js +55 -0
  175. package/dist/checks/architecture/project-readme-existence.js.map +1 -0
  176. package/dist/checks/architecture/stale-build-artifacts.d.ts +10 -0
  177. package/dist/checks/architecture/stale-build-artifacts.d.ts.map +1 -0
  178. package/dist/checks/architecture/stale-build-artifacts.js +55 -0
  179. package/dist/checks/architecture/stale-build-artifacts.js.map +1 -0
  180. package/dist/checks/architecture/tool-has-manifest.d.ts +27 -0
  181. package/dist/checks/architecture/tool-has-manifest.d.ts.map +1 -0
  182. package/dist/checks/architecture/tool-has-manifest.js +135 -0
  183. package/dist/checks/architecture/tool-has-manifest.js.map +1 -0
  184. package/dist/checks/architecture/vitest-config-extends-base.d.ts +15 -0
  185. package/dist/checks/architecture/vitest-config-extends-base.d.ts.map +1 -0
  186. package/dist/checks/architecture/vitest-config-extends-base.js +104 -0
  187. package/dist/checks/architecture/vitest-config-extends-base.js.map +1 -0
  188. package/dist/checks/architecture/vitest-config-required-with-tests.d.ts +49 -0
  189. package/dist/checks/architecture/vitest-config-required-with-tests.d.ts.map +1 -0
  190. package/dist/checks/architecture/vitest-config-required-with-tests.js +199 -0
  191. package/dist/checks/architecture/vitest-config-required-with-tests.js.map +1 -0
  192. package/dist/checks/documentation/_directives/eslint.d.ts +9 -0
  193. package/dist/checks/documentation/_directives/eslint.d.ts.map +1 -0
  194. package/dist/checks/documentation/_directives/eslint.js +168 -0
  195. package/dist/checks/documentation/_directives/eslint.js.map +1 -0
  196. package/dist/checks/documentation/_directives/fitness.d.ts +9 -0
  197. package/dist/checks/documentation/_directives/fitness.d.ts.map +1 -0
  198. package/dist/checks/documentation/_directives/fitness.js +64 -0
  199. package/dist/checks/documentation/_directives/fitness.js.map +1 -0
  200. package/dist/checks/documentation/_directives/graph.d.ts +10 -0
  201. package/dist/checks/documentation/_directives/graph.d.ts.map +1 -0
  202. package/dist/checks/documentation/_directives/graph.js +65 -0
  203. package/dist/checks/documentation/_directives/graph.js.map +1 -0
  204. package/dist/checks/documentation/_directives/graph.test.d.ts +2 -0
  205. package/dist/checks/documentation/_directives/graph.test.d.ts.map +1 -0
  206. package/dist/checks/documentation/_directives/graph.test.js +54 -0
  207. package/dist/checks/documentation/_directives/graph.test.js.map +1 -0
  208. package/dist/checks/documentation/_directives/semgrep.d.ts +8 -0
  209. package/dist/checks/documentation/_directives/semgrep.d.ts.map +1 -0
  210. package/dist/checks/documentation/_directives/semgrep.js +72 -0
  211. package/dist/checks/documentation/_directives/semgrep.js.map +1 -0
  212. package/dist/checks/documentation/_directives/types.d.ts +21 -0
  213. package/dist/checks/documentation/_directives/types.d.ts.map +1 -0
  214. package/dist/checks/documentation/_directives/types.js +9 -0
  215. package/dist/checks/documentation/_directives/types.js.map +1 -0
  216. package/dist/checks/documentation/_directives/typescript.d.ts +10 -0
  217. package/dist/checks/documentation/_directives/typescript.d.ts.map +1 -0
  218. package/dist/checks/documentation/_directives/typescript.js +54 -0
  219. package/dist/checks/documentation/_directives/typescript.js.map +1 -0
  220. package/dist/checks/documentation/_public-api-graph.d.ts +30 -0
  221. package/dist/checks/documentation/_public-api-graph.d.ts.map +1 -0
  222. package/dist/checks/documentation/_public-api-graph.js +304 -0
  223. package/dist/checks/documentation/_public-api-graph.js.map +1 -0
  224. package/dist/checks/documentation/directive-audit.d.ts +26 -0
  225. package/dist/checks/documentation/directive-audit.d.ts.map +1 -0
  226. package/dist/checks/documentation/directive-audit.js +144 -0
  227. package/dist/checks/documentation/directive-audit.js.map +1 -0
  228. package/dist/checks/documentation/index.d.ts +3 -0
  229. package/dist/checks/documentation/index.d.ts.map +1 -0
  230. package/dist/checks/documentation/index.js +3 -0
  231. package/dist/checks/documentation/index.js.map +1 -0
  232. package/dist/checks/documentation/public-api-jsdoc.d.ts +10 -0
  233. package/dist/checks/documentation/public-api-jsdoc.d.ts.map +1 -0
  234. package/dist/checks/documentation/public-api-jsdoc.js +131 -0
  235. package/dist/checks/documentation/public-api-jsdoc.js.map +1 -0
  236. package/dist/checks/file-length-limit.d.ts +16 -0
  237. package/dist/checks/file-length-limit.d.ts.map +1 -0
  238. package/dist/checks/file-length-limit.js +47 -0
  239. package/dist/checks/file-length-limit.js.map +1 -0
  240. package/dist/checks/index.d.ts +16 -0
  241. package/dist/checks/index.d.ts.map +1 -0
  242. package/dist/checks/index.js +16 -0
  243. package/dist/checks/index.js.map +1 -0
  244. package/dist/checks/no-todo-comments.d.ts +18 -0
  245. package/dist/checks/no-todo-comments.d.ts.map +1 -0
  246. package/dist/checks/no-todo-comments.js +79 -0
  247. package/dist/checks/no-todo-comments.js.map +1 -0
  248. package/dist/checks/no-unimplemented-markers.d.ts +24 -0
  249. package/dist/checks/no-unimplemented-markers.d.ts.map +1 -0
  250. package/dist/checks/no-unimplemented-markers.js +198 -0
  251. package/dist/checks/no-unimplemented-markers.js.map +1 -0
  252. package/dist/checks/quality/api/graphql-offset-pagination.d.ts +9 -0
  253. package/dist/checks/quality/api/graphql-offset-pagination.d.ts.map +1 -0
  254. package/dist/checks/quality/api/graphql-offset-pagination.js +63 -0
  255. package/dist/checks/quality/api/graphql-offset-pagination.js.map +1 -0
  256. package/dist/checks/quality/api/index.d.ts +3 -0
  257. package/dist/checks/quality/api/index.d.ts.map +1 -0
  258. package/dist/checks/quality/api/index.js +3 -0
  259. package/dist/checks/quality/api/index.js.map +1 -0
  260. package/dist/checks/quality/api/zod-openapi-sync.d.ts +13 -0
  261. package/dist/checks/quality/api/zod-openapi-sync.d.ts.map +1 -0
  262. package/dist/checks/quality/api/zod-openapi-sync.js +88 -0
  263. package/dist/checks/quality/api/zod-openapi-sync.js.map +1 -0
  264. package/dist/checks/quality/code-structure/dead-code.d.ts +12 -0
  265. package/dist/checks/quality/code-structure/dead-code.d.ts.map +1 -0
  266. package/dist/checks/quality/code-structure/dead-code.js +238 -0
  267. package/dist/checks/quality/code-structure/dead-code.js.map +1 -0
  268. package/dist/checks/quality/code-structure/index.d.ts +5 -0
  269. package/dist/checks/quality/code-structure/index.d.ts.map +1 -0
  270. package/dist/checks/quality/code-structure/index.js +5 -0
  271. package/dist/checks/quality/code-structure/index.js.map +1 -0
  272. package/dist/checks/quality/code-structure/no-ai-attribution.d.ts +25 -0
  273. package/dist/checks/quality/code-structure/no-ai-attribution.d.ts.map +1 -0
  274. package/dist/checks/quality/code-structure/no-ai-attribution.js +76 -0
  275. package/dist/checks/quality/code-structure/no-ai-attribution.js.map +1 -0
  276. package/dist/checks/quality/code-structure/no-console-log.d.ts +17 -0
  277. package/dist/checks/quality/code-structure/no-console-log.d.ts.map +1 -0
  278. package/dist/checks/quality/code-structure/no-console-log.js +106 -0
  279. package/dist/checks/quality/code-structure/no-console-log.js.map +1 -0
  280. package/dist/checks/quality/code-structure/no-process-artifacts.d.ts +25 -0
  281. package/dist/checks/quality/code-structure/no-process-artifacts.d.ts.map +1 -0
  282. package/dist/checks/quality/code-structure/no-process-artifacts.js +104 -0
  283. package/dist/checks/quality/code-structure/no-process-artifacts.js.map +1 -0
  284. package/dist/checks/quality/dependency-version-consistency.d.ts +20 -0
  285. package/dist/checks/quality/dependency-version-consistency.d.ts.map +1 -0
  286. package/dist/checks/quality/dependency-version-consistency.js +266 -0
  287. package/dist/checks/quality/dependency-version-consistency.js.map +1 -0
  288. package/dist/checks/quality/fitness-ignore-hygiene.d.ts +10 -0
  289. package/dist/checks/quality/fitness-ignore-hygiene.d.ts.map +1 -0
  290. package/dist/checks/quality/fitness-ignore-hygiene.js +93 -0
  291. package/dist/checks/quality/fitness-ignore-hygiene.js.map +1 -0
  292. package/dist/checks/quality/frontend/expo-vector-icons.d.ts +13 -0
  293. package/dist/checks/quality/frontend/expo-vector-icons.d.ts.map +1 -0
  294. package/dist/checks/quality/frontend/expo-vector-icons.js +80 -0
  295. package/dist/checks/quality/frontend/expo-vector-icons.js.map +1 -0
  296. package/dist/checks/quality/frontend/image-optimization.d.ts +13 -0
  297. package/dist/checks/quality/frontend/image-optimization.d.ts.map +1 -0
  298. package/dist/checks/quality/frontend/image-optimization.js +166 -0
  299. package/dist/checks/quality/frontend/image-optimization.js.map +1 -0
  300. package/dist/checks/quality/frontend/index.d.ts +4 -0
  301. package/dist/checks/quality/frontend/index.d.ts.map +1 -0
  302. package/dist/checks/quality/frontend/index.js +4 -0
  303. package/dist/checks/quality/frontend/index.js.map +1 -0
  304. package/dist/checks/quality/frontend/navigation-typing.d.ts +12 -0
  305. package/dist/checks/quality/frontend/navigation-typing.d.ts.map +1 -0
  306. package/dist/checks/quality/frontend/navigation-typing.js +77 -0
  307. package/dist/checks/quality/frontend/navigation-typing.js.map +1 -0
  308. package/dist/checks/quality/graph-ignore-hygiene.d.ts +10 -0
  309. package/dist/checks/quality/graph-ignore-hygiene.d.ts.map +1 -0
  310. package/dist/checks/quality/graph-ignore-hygiene.js +95 -0
  311. package/dist/checks/quality/graph-ignore-hygiene.js.map +1 -0
  312. package/dist/checks/quality/graph-ignore-hygiene.test.d.ts +14 -0
  313. package/dist/checks/quality/graph-ignore-hygiene.test.d.ts.map +1 -0
  314. package/dist/checks/quality/graph-ignore-hygiene.test.js +58 -0
  315. package/dist/checks/quality/graph-ignore-hygiene.test.js.map +1 -0
  316. package/dist/checks/quality/index.d.ts +16 -0
  317. package/dist/checks/quality/index.d.ts.map +1 -0
  318. package/dist/checks/quality/index.js +16 -0
  319. package/dist/checks/quality/index.js.map +1 -0
  320. package/dist/checks/quality/linting/eslint-justifications.d.ts +12 -0
  321. package/dist/checks/quality/linting/eslint-justifications.d.ts.map +1 -0
  322. package/dist/checks/quality/linting/eslint-justifications.js +328 -0
  323. package/dist/checks/quality/linting/eslint-justifications.js.map +1 -0
  324. package/dist/checks/quality/linting/index.d.ts +4 -0
  325. package/dist/checks/quality/linting/index.d.ts.map +1 -0
  326. package/dist/checks/quality/linting/index.js +4 -0
  327. package/dist/checks/quality/linting/index.js.map +1 -0
  328. package/dist/checks/quality/linting/semgrep-justifications.d.ts +16 -0
  329. package/dist/checks/quality/linting/semgrep-justifications.d.ts.map +1 -0
  330. package/dist/checks/quality/linting/semgrep-justifications.js +229 -0
  331. package/dist/checks/quality/linting/semgrep-justifications.js.map +1 -0
  332. package/dist/checks/quality/linting/typescript-directive-hygiene.d.ts +12 -0
  333. package/dist/checks/quality/linting/typescript-directive-hygiene.d.ts.map +1 -0
  334. package/dist/checks/quality/linting/typescript-directive-hygiene.js +142 -0
  335. package/dist/checks/quality/linting/typescript-directive-hygiene.js.map +1 -0
  336. package/dist/checks/quality/no-compatibility-layer-names.d.ts +13 -0
  337. package/dist/checks/quality/no-compatibility-layer-names.d.ts.map +1 -0
  338. package/dist/checks/quality/no-compatibility-layer-names.js +100 -0
  339. package/dist/checks/quality/no-compatibility-layer-names.js.map +1 -0
  340. package/dist/checks/quality/no-deprecated-tags.d.ts +11 -0
  341. package/dist/checks/quality/no-deprecated-tags.d.ts.map +1 -0
  342. package/dist/checks/quality/no-deprecated-tags.js +76 -0
  343. package/dist/checks/quality/no-deprecated-tags.js.map +1 -0
  344. package/dist/checks/quality/no-markdown-references.d.ts +16 -0
  345. package/dist/checks/quality/no-markdown-references.d.ts.map +1 -0
  346. package/dist/checks/quality/no-markdown-references.js +145 -0
  347. package/dist/checks/quality/no-markdown-references.js.map +1 -0
  348. package/dist/checks/quality/no-raw-regex-on-code.d.ts +9 -0
  349. package/dist/checks/quality/no-raw-regex-on-code.d.ts.map +1 -0
  350. package/dist/checks/quality/no-raw-regex-on-code.js +61 -0
  351. package/dist/checks/quality/no-raw-regex-on-code.js.map +1 -0
  352. package/dist/checks/quality/no-temporary-workarounds.d.ts +11 -0
  353. package/dist/checks/quality/no-temporary-workarounds.d.ts.map +1 -0
  354. package/dist/checks/quality/no-temporary-workarounds.js +69 -0
  355. package/dist/checks/quality/no-temporary-workarounds.js.map +1 -0
  356. package/dist/checks/quality/no-window-alert.d.ts +19 -0
  357. package/dist/checks/quality/no-window-alert.d.ts.map +1 -0
  358. package/dist/checks/quality/no-window-alert.js +74 -0
  359. package/dist/checks/quality/no-window-alert.js.map +1 -0
  360. package/dist/checks/quality/observability/index.d.ts +2 -0
  361. package/dist/checks/quality/observability/index.d.ts.map +1 -0
  362. package/dist/checks/quality/observability/index.js +2 -0
  363. package/dist/checks/quality/observability/index.js.map +1 -0
  364. package/dist/checks/quality/observability/pino-serializer-coverage.d.ts +15 -0
  365. package/dist/checks/quality/observability/pino-serializer-coverage.d.ts.map +1 -0
  366. package/dist/checks/quality/observability/pino-serializer-coverage.js +209 -0
  367. package/dist/checks/quality/observability/pino-serializer-coverage.js.map +1 -0
  368. package/dist/checks/quality/patterns/async-state-pattern.d.ts +14 -0
  369. package/dist/checks/quality/patterns/async-state-pattern.d.ts.map +1 -0
  370. package/dist/checks/quality/patterns/async-state-pattern.js +80 -0
  371. package/dist/checks/quality/patterns/async-state-pattern.js.map +1 -0
  372. package/dist/checks/quality/patterns/index.d.ts +4 -0
  373. package/dist/checks/quality/patterns/index.d.ts.map +1 -0
  374. package/dist/checks/quality/patterns/index.js +4 -0
  375. package/dist/checks/quality/patterns/index.js.map +1 -0
  376. package/dist/checks/quality/patterns/no-non-null-assertions.d.ts +10 -0
  377. package/dist/checks/quality/patterns/no-non-null-assertions.d.ts.map +1 -0
  378. package/dist/checks/quality/patterns/no-non-null-assertions.js +97 -0
  379. package/dist/checks/quality/patterns/no-non-null-assertions.js.map +1 -0
  380. package/dist/checks/quality/patterns/performance-anti-patterns.d.ts +16 -0
  381. package/dist/checks/quality/patterns/performance-anti-patterns.d.ts.map +1 -0
  382. package/dist/checks/quality/patterns/performance-anti-patterns.js +239 -0
  383. package/dist/checks/quality/patterns/performance-anti-patterns.js.map +1 -0
  384. package/dist/checks/resilience/_helpers/config-validation.d.ts +27 -0
  385. package/dist/checks/resilience/_helpers/config-validation.d.ts.map +1 -0
  386. package/dist/checks/resilience/_helpers/config-validation.js +61 -0
  387. package/dist/checks/resilience/_helpers/config-validation.js.map +1 -0
  388. package/dist/checks/resilience/batch-operations.d.ts +22 -0
  389. package/dist/checks/resilience/batch-operations.d.ts.map +1 -0
  390. package/dist/checks/resilience/batch-operations.js +422 -0
  391. package/dist/checks/resilience/batch-operations.js.map +1 -0
  392. package/dist/checks/resilience/cache-ttl-validation.d.ts +13 -0
  393. package/dist/checks/resilience/cache-ttl-validation.d.ts.map +1 -0
  394. package/dist/checks/resilience/cache-ttl-validation.js +222 -0
  395. package/dist/checks/resilience/cache-ttl-validation.js.map +1 -0
  396. package/dist/checks/resilience/catch-clause-safety.d.ts +12 -0
  397. package/dist/checks/resilience/catch-clause-safety.d.ts.map +1 -0
  398. package/dist/checks/resilience/catch-clause-safety.js +110 -0
  399. package/dist/checks/resilience/catch-clause-safety.js.map +1 -0
  400. package/dist/checks/resilience/dangerous-config-defaults.d.ts +11 -0
  401. package/dist/checks/resilience/dangerous-config-defaults.d.ts.map +1 -0
  402. package/dist/checks/resilience/dangerous-config-defaults.js +304 -0
  403. package/dist/checks/resilience/dangerous-config-defaults.js.map +1 -0
  404. package/dist/checks/resilience/error-code-registration.d.ts +11 -0
  405. package/dist/checks/resilience/error-code-registration.d.ts.map +1 -0
  406. package/dist/checks/resilience/error-code-registration.js +88 -0
  407. package/dist/checks/resilience/error-code-registration.js.map +1 -0
  408. package/dist/checks/resilience/event-patterns.d.ts +21 -0
  409. package/dist/checks/resilience/event-patterns.d.ts.map +1 -0
  410. package/dist/checks/resilience/event-patterns.js +232 -0
  411. package/dist/checks/resilience/event-patterns.js.map +1 -0
  412. package/dist/checks/resilience/exit-code-correctness.d.ts +12 -0
  413. package/dist/checks/resilience/exit-code-correctness.d.ts.map +1 -0
  414. package/dist/checks/resilience/exit-code-correctness.js +107 -0
  415. package/dist/checks/resilience/exit-code-correctness.js.map +1 -0
  416. package/dist/checks/resilience/index.d.ts +18 -0
  417. package/dist/checks/resilience/index.d.ts.map +1 -0
  418. package/dist/checks/resilience/index.js +18 -0
  419. package/dist/checks/resilience/index.js.map +1 -0
  420. package/dist/checks/resilience/no-hardcoded-timeouts.d.ts +10 -0
  421. package/dist/checks/resilience/no-hardcoded-timeouts.d.ts.map +1 -0
  422. package/dist/checks/resilience/no-hardcoded-timeouts.js +291 -0
  423. package/dist/checks/resilience/no-hardcoded-timeouts.js.map +1 -0
  424. package/dist/checks/resilience/no-process-exit-in-finally.d.ts +11 -0
  425. package/dist/checks/resilience/no-process-exit-in-finally.d.ts.map +1 -0
  426. package/dist/checks/resilience/no-process-exit-in-finally.js +89 -0
  427. package/dist/checks/resilience/no-process-exit-in-finally.js.map +1 -0
  428. package/dist/checks/resilience/readline-cleanup.d.ts +11 -0
  429. package/dist/checks/resilience/readline-cleanup.d.ts.map +1 -0
  430. package/dist/checks/resilience/readline-cleanup.js +107 -0
  431. package/dist/checks/resilience/readline-cleanup.js.map +1 -0
  432. package/dist/checks/resilience/recovery-patterns.d.ts +25 -0
  433. package/dist/checks/resilience/recovery-patterns.d.ts.map +1 -0
  434. package/dist/checks/resilience/recovery-patterns.js +273 -0
  435. package/dist/checks/resilience/recovery-patterns.js.map +1 -0
  436. package/dist/checks/resilience/reentrancy-guard.d.ts +12 -0
  437. package/dist/checks/resilience/reentrancy-guard.d.ts.map +1 -0
  438. package/dist/checks/resilience/reentrancy-guard.js +86 -0
  439. package/dist/checks/resilience/reentrancy-guard.js.map +1 -0
  440. package/dist/checks/resilience/retry-config-validation.d.ts +13 -0
  441. package/dist/checks/resilience/retry-config-validation.d.ts.map +1 -0
  442. package/dist/checks/resilience/retry-config-validation.js +159 -0
  443. package/dist/checks/resilience/retry-config-validation.js.map +1 -0
  444. package/dist/checks/resilience/sentry/_helpers/sentry.d.ts +25 -0
  445. package/dist/checks/resilience/sentry/_helpers/sentry.d.ts.map +1 -0
  446. package/dist/checks/resilience/sentry/_helpers/sentry.js +68 -0
  447. package/dist/checks/resilience/sentry/_helpers/sentry.js.map +1 -0
  448. package/dist/checks/resilience/sentry/index.d.ts +8 -0
  449. package/dist/checks/resilience/sentry/index.d.ts.map +1 -0
  450. package/dist/checks/resilience/sentry/index.js +8 -0
  451. package/dist/checks/resilience/sentry/index.js.map +1 -0
  452. package/dist/checks/resilience/sentry/sentry-dsn-configured.d.ts +12 -0
  453. package/dist/checks/resilience/sentry/sentry-dsn-configured.d.ts.map +1 -0
  454. package/dist/checks/resilience/sentry/sentry-dsn-configured.js +55 -0
  455. package/dist/checks/resilience/sentry/sentry-dsn-configured.js.map +1 -0
  456. package/dist/checks/resilience/sentry/sentry-environment-set.d.ts +12 -0
  457. package/dist/checks/resilience/sentry/sentry-environment-set.d.ts.map +1 -0
  458. package/dist/checks/resilience/sentry/sentry-environment-set.js +51 -0
  459. package/dist/checks/resilience/sentry/sentry-environment-set.js.map +1 -0
  460. package/dist/checks/resilience/sentry/sentry-error-boundary.d.ts +12 -0
  461. package/dist/checks/resilience/sentry/sentry-error-boundary.d.ts.map +1 -0
  462. package/dist/checks/resilience/sentry/sentry-error-boundary.js +75 -0
  463. package/dist/checks/resilience/sentry/sentry-error-boundary.js.map +1 -0
  464. package/dist/checks/resilience/sentry/sentry-pii-scrubbing.d.ts +13 -0
  465. package/dist/checks/resilience/sentry/sentry-pii-scrubbing.d.ts.map +1 -0
  466. package/dist/checks/resilience/sentry/sentry-pii-scrubbing.js +125 -0
  467. package/dist/checks/resilience/sentry/sentry-pii-scrubbing.js.map +1 -0
  468. package/dist/checks/resilience/sentry/sentry-release-set.d.ts +12 -0
  469. package/dist/checks/resilience/sentry/sentry-release-set.d.ts.map +1 -0
  470. package/dist/checks/resilience/sentry/sentry-release-set.js +51 -0
  471. package/dist/checks/resilience/sentry/sentry-release-set.js.map +1 -0
  472. package/dist/checks/resilience/sentry/sentry-sample-rate.d.ts +12 -0
  473. package/dist/checks/resilience/sentry/sentry-sample-rate.d.ts.map +1 -0
  474. package/dist/checks/resilience/sentry/sentry-sample-rate.js +78 -0
  475. package/dist/checks/resilience/sentry/sentry-sample-rate.js.map +1 -0
  476. package/dist/checks/resilience/sentry/sentry-source-maps.d.ts +12 -0
  477. package/dist/checks/resilience/sentry/sentry-source-maps.d.ts.map +1 -0
  478. package/dist/checks/resilience/sentry/sentry-source-maps.js +83 -0
  479. package/dist/checks/resilience/sentry/sentry-source-maps.js.map +1 -0
  480. package/dist/checks/resilience/service-patterns.d.ts +18 -0
  481. package/dist/checks/resilience/service-patterns.d.ts.map +1 -0
  482. package/dist/checks/resilience/service-patterns.js +230 -0
  483. package/dist/checks/resilience/service-patterns.js.map +1 -0
  484. package/dist/checks/resilience/timer-lifecycle.d.ts +10 -0
  485. package/dist/checks/resilience/timer-lifecycle.d.ts.map +1 -0
  486. package/dist/checks/resilience/timer-lifecycle.js +78 -0
  487. package/dist/checks/resilience/timer-lifecycle.js.map +1 -0
  488. package/dist/checks/resilience/transaction-patterns.d.ts +21 -0
  489. package/dist/checks/resilience/transaction-patterns.d.ts.map +1 -0
  490. package/dist/checks/resilience/transaction-patterns.js +258 -0
  491. package/dist/checks/resilience/transaction-patterns.js.map +1 -0
  492. package/dist/checks/security/__tests__/no-hardcoded-secrets.test.d.ts +9 -0
  493. package/dist/checks/security/__tests__/no-hardcoded-secrets.test.d.ts.map +1 -0
  494. package/dist/checks/security/__tests__/no-hardcoded-secrets.test.js +37 -0
  495. package/dist/checks/security/__tests__/no-hardcoded-secrets.test.js.map +1 -0
  496. package/dist/checks/security/__tests__/package-supply-chain-policy.test.d.ts +2 -0
  497. package/dist/checks/security/__tests__/package-supply-chain-policy.test.d.ts.map +1 -0
  498. package/dist/checks/security/__tests__/package-supply-chain-policy.test.js +128 -0
  499. package/dist/checks/security/__tests__/package-supply-chain-policy.test.js.map +1 -0
  500. package/dist/checks/security/api-key-rotation.d.ts +10 -0
  501. package/dist/checks/security/api-key-rotation.d.ts.map +1 -0
  502. package/dist/checks/security/api-key-rotation.js +186 -0
  503. package/dist/checks/security/api-key-rotation.js.map +1 -0
  504. package/dist/checks/security/auth-middleware-coverage.d.ts +11 -0
  505. package/dist/checks/security/auth-middleware-coverage.d.ts.map +1 -0
  506. package/dist/checks/security/auth-middleware-coverage.js +210 -0
  507. package/dist/checks/security/auth-middleware-coverage.js.map +1 -0
  508. package/dist/checks/security/auth-route-guard.d.ts +12 -0
  509. package/dist/checks/security/auth-route-guard.d.ts.map +1 -0
  510. package/dist/checks/security/auth-route-guard.js +70 -0
  511. package/dist/checks/security/auth-route-guard.js.map +1 -0
  512. package/dist/checks/security/cors-configuration.d.ts +11 -0
  513. package/dist/checks/security/cors-configuration.d.ts.map +1 -0
  514. package/dist/checks/security/cors-configuration.js +126 -0
  515. package/dist/checks/security/cors-configuration.js.map +1 -0
  516. package/dist/checks/security/csp-headers.d.ts +11 -0
  517. package/dist/checks/security/csp-headers.d.ts.map +1 -0
  518. package/dist/checks/security/csp-headers.js +192 -0
  519. package/dist/checks/security/csp-headers.js.map +1 -0
  520. package/dist/checks/security/dependency-vulnerability-audit.d.ts +15 -0
  521. package/dist/checks/security/dependency-vulnerability-audit.d.ts.map +1 -0
  522. package/dist/checks/security/dependency-vulnerability-audit.js +184 -0
  523. package/dist/checks/security/dependency-vulnerability-audit.js.map +1 -0
  524. package/dist/checks/security/env-secret-exposure.d.ts +11 -0
  525. package/dist/checks/security/env-secret-exposure.d.ts.map +1 -0
  526. package/dist/checks/security/env-secret-exposure.js +127 -0
  527. package/dist/checks/security/env-secret-exposure.js.map +1 -0
  528. package/dist/checks/security/hasura-production-config.d.ts +11 -0
  529. package/dist/checks/security/hasura-production-config.d.ts.map +1 -0
  530. package/dist/checks/security/hasura-production-config.js +122 -0
  531. package/dist/checks/security/hasura-production-config.js.map +1 -0
  532. package/dist/checks/security/index.d.ts +17 -0
  533. package/dist/checks/security/index.d.ts.map +1 -0
  534. package/dist/checks/security/index.js +17 -0
  535. package/dist/checks/security/index.js.map +1 -0
  536. package/dist/checks/security/jwt-validation.d.ts +11 -0
  537. package/dist/checks/security/jwt-validation.d.ts.map +1 -0
  538. package/dist/checks/security/jwt-validation.js +294 -0
  539. package/dist/checks/security/jwt-validation.js.map +1 -0
  540. package/dist/checks/security/no-eval.d.ts +16 -0
  541. package/dist/checks/security/no-eval.d.ts.map +1 -0
  542. package/dist/checks/security/no-eval.js +83 -0
  543. package/dist/checks/security/no-eval.js.map +1 -0
  544. package/dist/checks/security/no-hardcoded-secrets.d.ts +28 -0
  545. package/dist/checks/security/no-hardcoded-secrets.d.ts.map +1 -0
  546. package/dist/checks/security/no-hardcoded-secrets.js +209 -0
  547. package/dist/checks/security/no-hardcoded-secrets.js.map +1 -0
  548. package/dist/checks/security/package-supply-chain-policy.d.ts +12 -0
  549. package/dist/checks/security/package-supply-chain-policy.d.ts.map +1 -0
  550. package/dist/checks/security/package-supply-chain-policy.js +534 -0
  551. package/dist/checks/security/package-supply-chain-policy.js.map +1 -0
  552. package/dist/checks/security/rate-limit-coverage.d.ts +10 -0
  553. package/dist/checks/security/rate-limit-coverage.d.ts.map +1 -0
  554. package/dist/checks/security/rate-limit-coverage.js +143 -0
  555. package/dist/checks/security/rate-limit-coverage.js.map +1 -0
  556. package/dist/checks/security/semgrep-scan.d.ts +13 -0
  557. package/dist/checks/security/semgrep-scan.d.ts.map +1 -0
  558. package/dist/checks/security/semgrep-scan.js +86 -0
  559. package/dist/checks/security/semgrep-scan.js.map +1 -0
  560. package/dist/checks/security/use-centralized-crypto.d.ts +11 -0
  561. package/dist/checks/security/use-centralized-crypto.d.ts.map +1 -0
  562. package/dist/checks/security/use-centralized-crypto.js +129 -0
  563. package/dist/checks/security/use-centralized-crypto.js.map +1 -0
  564. package/dist/checks/security/webhook-signature-verification.d.ts +10 -0
  565. package/dist/checks/security/webhook-signature-verification.d.ts.map +1 -0
  566. package/dist/checks/security/webhook-signature-verification.js +183 -0
  567. package/dist/checks/security/webhook-signature-verification.js.map +1 -0
  568. package/dist/checks/testing/index.d.ts +6 -0
  569. package/dist/checks/testing/index.d.ts.map +1 -0
  570. package/dist/checks/testing/index.js +6 -0
  571. package/dist/checks/testing/index.js.map +1 -0
  572. package/dist/checks/testing/no-skipped-tests.d.ts +40 -0
  573. package/dist/checks/testing/no-skipped-tests.d.ts.map +1 -0
  574. package/dist/checks/testing/no-skipped-tests.js +174 -0
  575. package/dist/checks/testing/no-skipped-tests.js.map +1 -0
  576. package/dist/checks/testing/no-stub-tests.d.ts +11 -0
  577. package/dist/checks/testing/no-stub-tests.d.ts.map +1 -0
  578. package/dist/checks/testing/no-stub-tests.js +103 -0
  579. package/dist/checks/testing/no-stub-tests.js.map +1 -0
  580. package/dist/checks/testing/test-convention-consistency.d.ts +14 -0
  581. package/dist/checks/testing/test-convention-consistency.d.ts.map +1 -0
  582. package/dist/checks/testing/test-convention-consistency.js +93 -0
  583. package/dist/checks/testing/test-convention-consistency.js.map +1 -0
  584. package/dist/checks/testing/test-file-naming.d.ts +13 -0
  585. package/dist/checks/testing/test-file-naming.d.ts.map +1 -0
  586. package/dist/checks/testing/test-file-naming.js +218 -0
  587. package/dist/checks/testing/test-file-naming.js.map +1 -0
  588. package/dist/checks/testing/test-file-pairing.d.ts +13 -0
  589. package/dist/checks/testing/test-file-pairing.d.ts.map +1 -0
  590. package/dist/checks/testing/test-file-pairing.js +274 -0
  591. package/dist/checks/testing/test-file-pairing.js.map +1 -0
  592. package/dist/display/architecture.d.ts +9 -0
  593. package/dist/display/architecture.d.ts.map +1 -0
  594. package/dist/display/architecture.js +29 -0
  595. package/dist/display/architecture.js.map +1 -0
  596. package/dist/display/index.d.ts +20 -0
  597. package/dist/display/index.d.ts.map +1 -0
  598. package/dist/display/index.js +30 -0
  599. package/dist/display/index.js.map +1 -0
  600. package/dist/display/quality.d.ts +7 -0
  601. package/dist/display/quality.d.ts.map +1 -0
  602. package/dist/display/quality.js +34 -0
  603. package/dist/display/quality.js.map +1 -0
  604. package/dist/display/resilience.d.ts +7 -0
  605. package/dist/display/resilience.d.ts.map +1 -0
  606. package/dist/display/resilience.js +36 -0
  607. package/dist/display/resilience.js.map +1 -0
  608. package/dist/display/security-testing.d.ts +9 -0
  609. package/dist/display/security-testing.d.ts.map +1 -0
  610. package/dist/display/security-testing.js +31 -0
  611. package/dist/display/security-testing.js.map +1 -0
  612. package/dist/display/types.d.ts +6 -0
  613. package/dist/display/types.d.ts.map +1 -0
  614. package/dist/display/types.js +6 -0
  615. package/dist/display/types.js.map +1 -0
  616. package/dist/index.d.ts +19 -0
  617. package/dist/index.d.ts.map +1 -0
  618. package/dist/index.js +21 -0
  619. package/dist/index.js.map +1 -0
  620. package/package.json +52 -0
@@ -0,0 +1,663 @@
1
+ // @fitness-ignore-file file-length-limit -- behavior fixture suite; related scenarios stay together while checks are split into focused tests.
2
+ /**
3
+ * @fileoverview Third batch of fixture-based tests targeting the
4
+ * remaining check analyzers.
5
+ */
6
+ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
7
+ import { tmpdir } from 'node:os';
8
+ import { dirname, join } from 'node:path';
9
+ import { fileCache } from '@opensip-cli/fitness';
10
+ import { afterAll, afterEach, beforeAll, describe, expect, it } from 'vitest';
11
+ import { checks } from '../index.js';
12
+ function findCheck(slug) {
13
+ const check = checks.find((c) => c.config.slug === slug);
14
+ if (!check)
15
+ throw new Error(`check not found: ${slug}`);
16
+ return check;
17
+ }
18
+ function makeFixtureDir(prefix) {
19
+ return mkdtempSync(join(tmpdir(), `cu-cov3-${prefix}-`));
20
+ }
21
+ function writeFixture(cwd, rel, content) {
22
+ const abs = join(cwd, rel);
23
+ mkdirSync(dirname(abs), { recursive: true });
24
+ writeFileSync(abs, content);
25
+ return abs;
26
+ }
27
+ afterEach(() => fileCache.clear());
28
+ // =============================================================================
29
+ // node-version-consistency
30
+ // =============================================================================
31
+ describe('node-version-consistency', () => {
32
+ let cwd;
33
+ beforeAll(() => {
34
+ cwd = makeFixtureDir('node-ver');
35
+ writeFixture(cwd, 'package.json', JSON.stringify({
36
+ name: 'root',
37
+ engines: { node: '>=24.0.0' },
38
+ devDependencies: { '@types/node': '^24.0.0' },
39
+ }, null, 2));
40
+ writeFixture(cwd, '.nvmrc', '20.11.1\n');
41
+ writeFixture(cwd, 'packages/a/package.json', JSON.stringify({
42
+ name: 'a',
43
+ engines: { node: '>=18.0.0' },
44
+ devDependencies: { '@types/node': '^18.0.0' },
45
+ }, null, 2));
46
+ writeFixture(cwd, '.github/workflows/ci.yml', [
47
+ 'name: CI',
48
+ 'jobs:',
49
+ ' build:',
50
+ ' runs-on: ubuntu-latest',
51
+ ' steps:',
52
+ ' - uses: actions/setup-node@v4',
53
+ ' with:',
54
+ " node-version: '18'",
55
+ ].join('\n'));
56
+ });
57
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
58
+ it('flags .nvmrc / workspace engines / @types/node / CI version mismatches', async () => {
59
+ const result = await findCheck('node-version-consistency').run(cwd, {
60
+ targetFiles: [
61
+ join(cwd, 'package.json'),
62
+ join(cwd, '.nvmrc'),
63
+ join(cwd, 'packages/a/package.json'),
64
+ join(cwd, '.github/workflows/ci.yml'),
65
+ ],
66
+ });
67
+ const types = result.signals.map((s) => s.metadata.type);
68
+ expect(types).toContain('nvmrc-version-mismatch');
69
+ expect(types).toContain('workspace-engines-mismatch');
70
+ expect(types).toContain('types-node-mismatch');
71
+ expect(types).toContain('ci-node-version-mismatch');
72
+ });
73
+ });
74
+ // =============================================================================
75
+ // sentry-source-maps
76
+ // =============================================================================
77
+ describe('sentry-source-maps', () => {
78
+ let cwd;
79
+ beforeAll(() => {
80
+ cwd = makeFixtureDir('sentry-srcmaps');
81
+ writeFixture(cwd, 'webpack.config.ts', [
82
+ 'import * as Sentry from "@sentry/node";',
83
+ 'export default {',
84
+ ' // No source map plugin configured',
85
+ ' plugins: [],',
86
+ '};',
87
+ ].join('\n'));
88
+ writeFixture(cwd, 'vite.config.ts', [
89
+ 'import { sentryVitePlugin } from "@sentry/vite-plugin";',
90
+ 'export default {',
91
+ ' plugins: [sentryVitePlugin({})],',
92
+ '};',
93
+ ].join('\n'));
94
+ writeFixture(cwd, 'rollup.config.ts', ['export default { plugins: [] };'].join('\n'));
95
+ });
96
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
97
+ it('flags bundler config that references Sentry without a source map plugin', async () => {
98
+ const result = await findCheck('sentry-source-maps').run(cwd, {
99
+ targetFiles: [join(cwd, 'webpack.config.ts')],
100
+ });
101
+ const types = result.signals.map((s) => s.metadata.type);
102
+ expect(types).toContain('sentry-missing-source-maps');
103
+ });
104
+ it('does not fire when a Sentry source map plugin is configured', async () => {
105
+ const result = await findCheck('sentry-source-maps').run(cwd, {
106
+ targetFiles: [join(cwd, 'vite.config.ts')],
107
+ });
108
+ expect(result.signals.length).toBe(0);
109
+ });
110
+ it('skips non-Sentry bundler configs', async () => {
111
+ const result = await findCheck('sentry-source-maps').run(cwd, {
112
+ targetFiles: [join(cwd, 'rollup.config.ts')],
113
+ });
114
+ expect(result.signals.length).toBe(0);
115
+ });
116
+ });
117
+ // =============================================================================
118
+ // sentry-pii-scrubbing
119
+ // =============================================================================
120
+ describe('sentry-pii-scrubbing', () => {
121
+ let cwd;
122
+ beforeAll(() => {
123
+ cwd = makeFixtureDir('sentry-pii');
124
+ writeFixture(cwd, 'src/init-no-callbacks.ts', [
125
+ 'import * as Sentry from "@sentry/node";',
126
+ 'Sentry.init({',
127
+ ' dsn: "https://example",',
128
+ '});',
129
+ ].join('\n'));
130
+ writeFixture(cwd, 'src/init-with-callback.ts', [
131
+ 'import * as Sentry from "@sentry/node";',
132
+ 'Sentry.init({',
133
+ ' dsn: "https://example",',
134
+ ' beforeSend(event) { return event; },',
135
+ '});',
136
+ ].join('\n'));
137
+ writeFixture(cwd, 'src/pii-context.ts', [
138
+ 'import * as Sentry from "@sentry/node";',
139
+ 'export function tag(user: { email: string }) {',
140
+ ' Sentry.setUser({ email: user.email, id: "u1" });',
141
+ '}',
142
+ ].join('\n'));
143
+ });
144
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
145
+ it('flags Sentry.init() without beforeSend / beforeBreadcrumb', async () => {
146
+ const result = await findCheck('sentry-pii-scrubbing').run(cwd, {
147
+ targetFiles: [join(cwd, 'src/init-no-callbacks.ts')],
148
+ });
149
+ const types = result.signals.map((s) => s.metadata.type);
150
+ expect(types).toContain('sentry-no-pii-filter');
151
+ });
152
+ it('does not fire when beforeSend is wired up', async () => {
153
+ const result = await findCheck('sentry-pii-scrubbing').run(cwd, {
154
+ targetFiles: [join(cwd, 'src/init-with-callback.ts')],
155
+ });
156
+ expect(result.signals.length).toBe(0);
157
+ });
158
+ it('flags PII field names in setUser/setExtra/setContext calls', async () => {
159
+ const result = await findCheck('sentry-pii-scrubbing').run(cwd, {
160
+ targetFiles: [join(cwd, 'src/pii-context.ts')],
161
+ });
162
+ const types = result.signals.map((s) => s.metadata.type);
163
+ expect(types).toContain('sentry-pii-in-context');
164
+ });
165
+ });
166
+ // =============================================================================
167
+ // env-secret-exposure
168
+ // =============================================================================
169
+ describe('env-secret-exposure', () => {
170
+ let cwd;
171
+ beforeAll(() => {
172
+ cwd = makeFixtureDir('env-secret');
173
+ writeFixture(cwd, 'src/log-env.ts', ['export function diag() {', ' console.log(process.env);', '}'].join('\n'));
174
+ writeFixture(cwd, 'src/throw-secret.ts', [
175
+ 'export function check() {',
176
+ ' throw new Error("invalid secret " + process.env.API_SECRET);',
177
+ '}',
178
+ ].join('\n'));
179
+ writeFixture(cwd, 'src/json-env.ts', ['export function dump() {', ' return JSON.stringify(process.env);', '}'].join('\n'));
180
+ writeFixture(cwd, 'src/spread-env.ts', ['export const settings = { ...process.env, custom: 1 };'].join('\n'));
181
+ writeFixture(cwd, 'src/clean.ts', ['export const port = process.env.PORT ?? "3000";'].join('\n'));
182
+ });
183
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
184
+ it('flags logging the entire process.env object', async () => {
185
+ const result = await findCheck('env-secret-exposure').run(cwd, {
186
+ targetFiles: [join(cwd, 'src/log-env.ts')],
187
+ });
188
+ const messages = result.signals.map((s) => s.message);
189
+ expect(messages.some((m) => m.includes('Logging entire process.env'))).toBe(true);
190
+ });
191
+ it('flags JSON.stringify(process.env)', async () => {
192
+ const result = await findCheck('env-secret-exposure').run(cwd, {
193
+ targetFiles: [join(cwd, 'src/json-env.ts')],
194
+ });
195
+ const messages = result.signals.map((s) => s.message);
196
+ expect(messages.some((m) => m.includes('JSON.stringify'))).toBe(true);
197
+ });
198
+ it('flags spread of process.env', async () => {
199
+ const result = await findCheck('env-secret-exposure').run(cwd, {
200
+ targetFiles: [join(cwd, 'src/spread-env.ts')],
201
+ });
202
+ const messages = result.signals.map((s) => s.message);
203
+ expect(messages.some((m) => m.includes('Spreading process.env'))).toBe(true);
204
+ });
205
+ it('does not fire on safe scoped access', async () => {
206
+ const result = await findCheck('env-secret-exposure').run(cwd, {
207
+ targetFiles: [join(cwd, 'src/clean.ts')],
208
+ });
209
+ expect(result.signals.length).toBe(0);
210
+ });
211
+ });
212
+ // =============================================================================
213
+ // catch-clause-safety (drive more branches)
214
+ // =============================================================================
215
+ describe('catch-clause-safety branches', () => {
216
+ let cwd;
217
+ beforeAll(() => {
218
+ cwd = makeFixtureDir('catch-branches');
219
+ writeFixture(cwd, 'src/explicit-any.ts', [
220
+ 'export async function run() {',
221
+ ' try { await op(); }',
222
+ ' catch (err: any) {',
223
+ ' err.printStackTrace?.();',
224
+ ' }',
225
+ '}',
226
+ 'function op() {}',
227
+ ].join('\n'));
228
+ writeFixture(cwd, 'src/unsafe-cast.ts', [
229
+ 'export async function run() {',
230
+ ' try { await op(); }',
231
+ ' catch (err) {',
232
+ ' const e = err as Error;',
233
+ ' console.error(e.message);',
234
+ ' }',
235
+ '}',
236
+ 'function op() {}',
237
+ ].join('\n'));
238
+ writeFixture(cwd, 'src/safe-cast.ts', [
239
+ 'export async function run() {',
240
+ ' try { await op(); }',
241
+ ' catch (err) {',
242
+ ' if (err instanceof Error) {',
243
+ ' const e = err as Error;',
244
+ ' console.error(e.message);',
245
+ ' }',
246
+ ' }',
247
+ '}',
248
+ 'function op() {}',
249
+ ].join('\n'));
250
+ writeFixture(cwd, 'src/empty-catch.ts', [
251
+ 'export async function run() {',
252
+ ' try { await op(); }',
253
+ ' catch {}',
254
+ '}',
255
+ 'function op() {}',
256
+ ].join('\n'));
257
+ });
258
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
259
+ it('flags catch (e: any) explicit annotation', async () => {
260
+ const result = await findCheck('catch-clause-safety').run(cwd, {
261
+ targetFiles: [join(cwd, 'src/explicit-any.ts')],
262
+ });
263
+ const types = result.signals.map((s) => s.metadata.type);
264
+ expect(types).toContain('catch-any-annotation');
265
+ });
266
+ it('flags `as Error` cast without instanceof guard', async () => {
267
+ const result = await findCheck('catch-clause-safety').run(cwd, {
268
+ targetFiles: [join(cwd, 'src/unsafe-cast.ts')],
269
+ });
270
+ const types = result.signals.map((s) => s.metadata.type);
271
+ expect(types).toContain('unsafe-error-cast');
272
+ });
273
+ it('does not fire when instanceof Error guard is present', async () => {
274
+ const result = await findCheck('catch-clause-safety').run(cwd, {
275
+ targetFiles: [join(cwd, 'src/safe-cast.ts')],
276
+ });
277
+ expect(result.signals.length).toBe(0);
278
+ });
279
+ it('does not fire on empty catch blocks', async () => {
280
+ const result = await findCheck('catch-clause-safety').run(cwd, {
281
+ targetFiles: [join(cwd, 'src/empty-catch.ts')],
282
+ });
283
+ expect(result.signals.length).toBe(0);
284
+ });
285
+ });
286
+ // =============================================================================
287
+ // dangerous-config-defaults — coverage of TLS variant
288
+ // =============================================================================
289
+ describe('dangerous-config-defaults TLS variant', () => {
290
+ let cwd;
291
+ beforeAll(() => {
292
+ cwd = makeFixtureDir('dcd-tls');
293
+ writeFixture(cwd, 'src/tls.ts', ['process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";'].join('\n'));
294
+ writeFixture(cwd, 'src/quoted.ts', ['export const env = {', ' "NODE_TLS_REJECT_UNAUTHORIZED": "0",', '};'].join('\n'));
295
+ });
296
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
297
+ it('runs without throwing on TLS_REJECT_UNAUTHORIZED variants', async () => {
298
+ const result = await findCheck('dangerous-config-defaults').run(cwd, {
299
+ targetFiles: [join(cwd, 'src/tls.ts'), join(cwd, 'src/quoted.ts')],
300
+ });
301
+ expect(result).toBeDefined();
302
+ });
303
+ });
304
+ // =============================================================================
305
+ // no-duplicate-packages: keyword-based matching
306
+ // =============================================================================
307
+ describe('no-duplicate-packages keyword matches', () => {
308
+ let cwd;
309
+ beforeAll(() => {
310
+ cwd = makeFixtureDir('no-dup-kw');
311
+ // Two packages flagged as "contracts" by keyword
312
+ writeFixture(cwd, 'packages/a/package.json', JSON.stringify({
313
+ name: '@org/a',
314
+ keywords: ['types', 'shared'],
315
+ }, null, 2));
316
+ writeFixture(cwd, 'packages/b/package.json', JSON.stringify({
317
+ name: '@org/b',
318
+ keywords: ['types', 'public'],
319
+ }, null, 2));
320
+ });
321
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
322
+ it('detects duplicates via keywords field', async () => {
323
+ const result = await findCheck('no-duplicate-packages').run(cwd, {
324
+ targetFiles: [join(cwd, 'packages/a/package.json'), join(cwd, 'packages/b/package.json')],
325
+ });
326
+ // Both packages have `types` keyword → contracts/types category
327
+ const matches = result.signals.map((s) => s.metadata.match);
328
+ expect(matches).toContain('contracts/types');
329
+ });
330
+ });
331
+ // =============================================================================
332
+ // fitness-ignore-hygiene — exercise excessive directive accumulation
333
+ // =============================================================================
334
+ describe('fitness-ignore-hygiene cumulative count', () => {
335
+ let cwd;
336
+ beforeAll(() => {
337
+ cwd = makeFixtureDir('fih');
338
+ // 8+ directives with reasons → triggers excessive-ignores threshold
339
+ writeFixture(cwd, 'src/many.ts', [
340
+ ...Array.from({ length: 9 }, (_, i) => `// @fitness-ignore-file slug-${i} -- justified reason`),
341
+ 'export const x = 1;',
342
+ ].join('\n'));
343
+ });
344
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
345
+ it('flags files with excessive ignore directives', async () => {
346
+ const result = await findCheck('fitness-ignore-hygiene').run(cwd, {
347
+ targetFiles: [join(cwd, 'src/many.ts')],
348
+ });
349
+ const types = result.signals.map((s) => s.metadata.type);
350
+ expect(types).toContain('excessive-ignores');
351
+ });
352
+ });
353
+ // =============================================================================
354
+ // no-stub-tests — cover function() {} and trivial assertions
355
+ // =============================================================================
356
+ describe('no-stub-tests function form', () => {
357
+ let cwd;
358
+ beforeAll(() => {
359
+ cwd = makeFixtureDir('stub-fn');
360
+ writeFixture(cwd, 'src/__tests__/fn.test.ts', ['import { it } from "vitest";', 'it("plain function form", function() {});'].join('\n'));
361
+ });
362
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
363
+ it('flags function() {} empty bodies', async () => {
364
+ const result = await findCheck('no-stub-tests').run(cwd, {
365
+ targetFiles: [join(cwd, 'src/__tests__/fn.test.ts')],
366
+ });
367
+ const types = result.signals.map((s) => s.metadata.type);
368
+ expect(types).toContain('empty-test-body');
369
+ });
370
+ });
371
+ // =============================================================================
372
+ // timer-lifecycle — cover setInterval/setTimeout in tests
373
+ // =============================================================================
374
+ describe('timer-lifecycle additional', () => {
375
+ let cwd;
376
+ beforeAll(() => {
377
+ cwd = makeFixtureDir('timer-additional');
378
+ writeFixture(cwd, 'src/long-running.ts', [
379
+ 'export class Worker {',
380
+ ' start() {',
381
+ ' setInterval(() => this.tick(), 60000);',
382
+ ' setTimeout(() => this.boot(), 5000);',
383
+ ' }',
384
+ ' tick() {}',
385
+ ' boot() {}',
386
+ '}',
387
+ ].join('\n'));
388
+ });
389
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
390
+ it('runs without throwing on long-running timer fixture', async () => {
391
+ const result = await findCheck('timer-lifecycle').run(cwd, {
392
+ targetFiles: [join(cwd, 'src/long-running.ts')],
393
+ });
394
+ expect(result).toBeDefined();
395
+ });
396
+ });
397
+ // =============================================================================
398
+ // rate-limit-coverage edge: file that contains framework but no actual routes
399
+ // =============================================================================
400
+ describe('rate-limit-coverage skip paths', () => {
401
+ let cwd;
402
+ beforeAll(() => {
403
+ cwd = makeFixtureDir('rl-skip');
404
+ writeFixture(cwd, 'src/no-routes.ts', [
405
+ 'export function build(fastify: any) {',
406
+ ' // no routes here',
407
+ ' return fastify;',
408
+ '}',
409
+ ].join('\n'));
410
+ });
411
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
412
+ it('skips files that do not call route framework methods', async () => {
413
+ const result = await findCheck('rate-limit-coverage').run(cwd, {
414
+ targetFiles: [join(cwd, 'src/no-routes.ts')],
415
+ });
416
+ expect(result.signals.length).toBe(0);
417
+ });
418
+ });
419
+ // =============================================================================
420
+ // public-api-jsdoc
421
+ // =============================================================================
422
+ describe('public-api-jsdoc', () => {
423
+ let cwd;
424
+ beforeAll(() => {
425
+ cwd = makeFixtureDir('pubapi-jsdoc');
426
+ writeFixture(cwd, 'src/no-doc.ts', ['export function thing() { return 1; }', 'export class Box { open() {} }'].join('\n'));
427
+ writeFixture(cwd, 'src/with-doc.ts', ['/**', ' * Returns one.', ' */', 'export function thing() { return 1; }'].join('\n'));
428
+ });
429
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
430
+ it('runs without throwing on public-api fixtures', async () => {
431
+ const result = await findCheck('public-api-jsdoc').run(cwd, {
432
+ targetFiles: [join(cwd, 'src/no-doc.ts'), join(cwd, 'src/with-doc.ts')],
433
+ });
434
+ expect(result).toBeDefined();
435
+ });
436
+ });
437
+ // =============================================================================
438
+ // dockerfile checks — additional fixtures
439
+ // =============================================================================
440
+ describe('docker-best-practices additional', () => {
441
+ let cwd;
442
+ beforeAll(() => {
443
+ cwd = makeFixtureDir('docker-bp-additional');
444
+ writeFixture(cwd, 'Dockerfile.latest', [
445
+ 'FROM node:latest', // floating tag
446
+ 'COPY . .',
447
+ 'CMD ["node", "src/app.js"]',
448
+ ].join('\n'));
449
+ writeFixture(cwd, 'Dockerfile.no-healthcheck', ['FROM node:20', 'COPY . .', 'CMD ["node", "src/app.js"]'].join('\n'));
450
+ });
451
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
452
+ it('runs without throwing on docker fixtures', async () => {
453
+ const result = await findCheck('docker-best-practices').run(cwd, {
454
+ targetFiles: [join(cwd, 'Dockerfile.latest'), join(cwd, 'Dockerfile.no-healthcheck')],
455
+ });
456
+ expect(result).toBeDefined();
457
+ });
458
+ });
459
+ // =============================================================================
460
+ // docker-ignore-validation
461
+ // =============================================================================
462
+ describe('docker-ignore-validation', () => {
463
+ let cwd;
464
+ beforeAll(() => {
465
+ cwd = makeFixtureDir('docker-ignore');
466
+ writeFixture(cwd, 'Dockerfile', ['FROM node:20', 'COPY . .', 'CMD ["node", "src/app.js"]'].join('\n'));
467
+ writeFixture(cwd, '.dockerignore', ['node_modules', '.git'].join('\n'));
468
+ });
469
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
470
+ it('runs without throwing', async () => {
471
+ const result = await findCheck('docker-ignore-validation').run(cwd, {
472
+ targetFiles: [join(cwd, 'Dockerfile'), join(cwd, '.dockerignore')],
473
+ });
474
+ expect(result).toBeDefined();
475
+ });
476
+ });
477
+ // =============================================================================
478
+ // heavy-import-detection
479
+ // =============================================================================
480
+ describe('heavy-import-detection', () => {
481
+ let cwd;
482
+ beforeAll(() => {
483
+ cwd = makeFixtureDir('heavy-imp');
484
+ writeFixture(cwd, 'src/lodash-namespace.ts', ['import * as _ from "lodash";', 'export const x = _.pick({ a: 1 }, ["a"]);'].join('\n'));
485
+ writeFixture(cwd, 'src/moment.ts', ['import moment from "moment";', 'export const x = moment(new Date()).format();'].join('\n'));
486
+ writeFixture(cwd, 'src/aws-sdk.ts', ['import AWS from "aws-sdk";', 'export const s3 = new AWS.S3();'].join('\n'));
487
+ writeFixture(cwd, 'src/excessive-named.ts', [
488
+ 'import { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q } from "huge-lib";',
489
+ 'export const x = { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q };',
490
+ ].join('\n'));
491
+ writeFixture(cwd, 'src/scoped.ts', [
492
+ 'import { format } from "date-fns";',
493
+ 'export const x = format(new Date(), "yyyy-MM-dd");',
494
+ ].join('\n'));
495
+ });
496
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
497
+ it('flags namespace import of lodash', async () => {
498
+ const result = await findCheck('heavy-import-detection').run(cwd, {
499
+ targetFiles: [join(cwd, 'src/lodash-namespace.ts')],
500
+ });
501
+ const types = result.signals.map((s) => s.metadata.type);
502
+ expect(types).toContain('HEAVY_IMPORT');
503
+ });
504
+ it('flags moment as deprecated', async () => {
505
+ const result = await findCheck('heavy-import-detection').run(cwd, {
506
+ targetFiles: [join(cwd, 'src/moment.ts')],
507
+ });
508
+ const types = result.signals.map((s) => s.metadata.type);
509
+ expect(types).toContain('DEPRECATED_LIBRARY');
510
+ });
511
+ it('flags aws-sdk v2 as deprecated', async () => {
512
+ const result = await findCheck('heavy-import-detection').run(cwd, {
513
+ targetFiles: [join(cwd, 'src/aws-sdk.ts')],
514
+ });
515
+ const types = result.signals.map((s) => s.metadata.type);
516
+ expect(types).toContain('DEPRECATED_LIBRARY');
517
+ });
518
+ it('flags excessive named imports', async () => {
519
+ const result = await findCheck('heavy-import-detection').run(cwd, {
520
+ targetFiles: [join(cwd, 'src/excessive-named.ts')],
521
+ });
522
+ const types = result.signals.map((s) => s.metadata.type);
523
+ expect(types).toContain('EXCESSIVE_NAMED_IMPORTS');
524
+ });
525
+ it('does not fire on lightweight scoped imports', async () => {
526
+ const result = await findCheck('heavy-import-detection').run(cwd, {
527
+ targetFiles: [join(cwd, 'src/scoped.ts')],
528
+ });
529
+ expect(result.signals.length).toBe(0);
530
+ });
531
+ });
532
+ // =============================================================================
533
+ // project-readme-existence
534
+ // =============================================================================
535
+ describe('project-readme-existence', () => {
536
+ let cwd;
537
+ beforeAll(() => {
538
+ cwd = makeFixtureDir('readme');
539
+ writeFixture(cwd, 'package.json', JSON.stringify({ name: 'no-readme' }, null, 2));
540
+ });
541
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
542
+ it('runs without throwing on a fixture with no README', async () => {
543
+ const result = await findCheck('project-readme-existence').run(cwd, {
544
+ targetFiles: [join(cwd, 'package.json')],
545
+ });
546
+ expect(result).toBeDefined();
547
+ });
548
+ });
549
+ // =============================================================================
550
+ // stale-build-artifacts variants
551
+ // =============================================================================
552
+ describe('stale-build-artifacts variants', () => {
553
+ let cwd;
554
+ beforeAll(() => {
555
+ cwd = makeFixtureDir('stale-variants');
556
+ writeFixture(cwd, 'packages/a/dist/index.js', '// stale');
557
+ writeFixture(cwd, 'packages/a/package.json', JSON.stringify({
558
+ name: 'a',
559
+ main: 'dist/index.js',
560
+ }, null, 2));
561
+ });
562
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
563
+ it('runs without throwing', async () => {
564
+ const result = await findCheck('stale-build-artifacts').run(cwd, {
565
+ targetFiles: [join(cwd, 'packages/a/dist/index.js'), join(cwd, 'packages/a/package.json')],
566
+ });
567
+ expect(result).toBeDefined();
568
+ });
569
+ });
570
+ // =============================================================================
571
+ // eslint-justifications
572
+ // =============================================================================
573
+ describe('eslint-justifications', () => {
574
+ let cwd;
575
+ beforeAll(() => {
576
+ cwd = makeFixtureDir('eslint-just');
577
+ writeFixture(cwd, 'src/no-reason.ts', ['// eslint-disable-next-line no-console', 'console.log("hi");'].join('\n'));
578
+ writeFixture(cwd, 'src/generic-reason.ts', ['// eslint-disable-next-line no-console -- todo', 'console.log("hi");'].join('\n'));
579
+ writeFixture(cwd, 'src/proper.ts', [
580
+ '// eslint-disable-next-line no-console -- intentional CLI logger output',
581
+ 'console.log("hi");',
582
+ ].join('\n'));
583
+ });
584
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
585
+ it('runs without throwing on disable-without-reason fixtures', async () => {
586
+ const result = await findCheck('eslint-justifications').run(cwd, {
587
+ targetFiles: [
588
+ join(cwd, 'src/no-reason.ts'),
589
+ join(cwd, 'src/generic-reason.ts'),
590
+ join(cwd, 'src/proper.ts'),
591
+ ],
592
+ });
593
+ expect(result).toBeDefined();
594
+ });
595
+ });
596
+ // =============================================================================
597
+ // semgrep-justifications
598
+ // =============================================================================
599
+ describe('semgrep-justifications', () => {
600
+ let cwd;
601
+ beforeAll(() => {
602
+ cwd = makeFixtureDir('semgrep-just');
603
+ writeFixture(cwd, 'src/no-reason.ts', ['// nosemgrep: javascript.lang.security', 'eval("1 + 1");'].join('\n'));
604
+ writeFixture(cwd, 'src/proper.ts', [
605
+ '// nosemgrep: javascript.lang.security -- expression evaluation in trusted plugin sandbox',
606
+ 'eval("1 + 1");',
607
+ ].join('\n'));
608
+ });
609
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
610
+ it('runs without throwing on nosemgrep fixtures', async () => {
611
+ const result = await findCheck('semgrep-justifications').run(cwd, {
612
+ targetFiles: [join(cwd, 'src/no-reason.ts'), join(cwd, 'src/proper.ts')],
613
+ });
614
+ expect(result).toBeDefined();
615
+ });
616
+ });
617
+ // =============================================================================
618
+ // directive-audit additional fixtures (drive more counters)
619
+ // =============================================================================
620
+ describe('directive-audit additional', () => {
621
+ let cwd;
622
+ beforeAll(() => {
623
+ cwd = makeFixtureDir('directive-add');
624
+ writeFixture(cwd, 'src/each-kind.ts', [
625
+ '/* eslint-disable no-console */',
626
+ 'console.log("disabled");',
627
+ '/* eslint-enable */',
628
+ '// @ts-expect-error reason — third-party type incorrect',
629
+ 'const x: number = "no" as any;',
630
+ '// @ts-ignore — old shim',
631
+ 'const y: string = 1 as any;',
632
+ '// @fitness-ignore-file no-todo-comments -- intentional',
633
+ '// @fitness-ignore-next-line no-console-log -- intentional',
634
+ '// nosemgrep: jsx.security.tag',
635
+ ].join('\n'));
636
+ });
637
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
638
+ it('runs all directive parsers without throwing', async () => {
639
+ const result = await findCheck('directive-audit').run(cwd, {
640
+ targetFiles: [join(cwd, 'src/each-kind.ts')],
641
+ });
642
+ expect(result).toBeDefined();
643
+ });
644
+ });
645
+ // =============================================================================
646
+ // test-convention-consistency: mixed naming forms
647
+ // =============================================================================
648
+ describe('test-convention-consistency', () => {
649
+ let cwd;
650
+ beforeAll(() => {
651
+ cwd = makeFixtureDir('tcc');
652
+ writeFixture(cwd, 'src/__tests__/foo-spec.ts', ['import { it } from "vitest";', 'it("works", () => undefined);'].join('\n'));
653
+ writeFixture(cwd, 'src/__tests__/bar.test.ts', ['import { it } from "vitest";', 'it("works", () => undefined);'].join('\n'));
654
+ });
655
+ afterAll(() => rmSync(cwd, { recursive: true, force: true }));
656
+ it('runs without throwing on mixed naming forms', async () => {
657
+ const result = await findCheck('test-convention-consistency').run(cwd, {
658
+ targetFiles: [join(cwd, 'src/__tests__/foo-spec.ts'), join(cwd, 'src/__tests__/bar.test.ts')],
659
+ });
660
+ expect(result).toBeDefined();
661
+ });
662
+ });
663
+ //# sourceMappingURL=behavior-fixtures-3.test.js.map