driftdetect-detectors 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 (509) hide show
  1. package/dist/accessibility/alt-text.d.ts +63 -0
  2. package/dist/accessibility/alt-text.d.ts.map +1 -0
  3. package/dist/accessibility/alt-text.js +100 -0
  4. package/dist/accessibility/alt-text.js.map +1 -0
  5. package/dist/accessibility/aria-roles.d.ts +65 -0
  6. package/dist/accessibility/aria-roles.d.ts.map +1 -0
  7. package/dist/accessibility/aria-roles.js +87 -0
  8. package/dist/accessibility/aria-roles.js.map +1 -0
  9. package/dist/accessibility/focus-management.d.ts +62 -0
  10. package/dist/accessibility/focus-management.d.ts.map +1 -0
  11. package/dist/accessibility/focus-management.js +88 -0
  12. package/dist/accessibility/focus-management.js.map +1 -0
  13. package/dist/accessibility/heading-hierarchy.d.ts +66 -0
  14. package/dist/accessibility/heading-hierarchy.d.ts.map +1 -0
  15. package/dist/accessibility/heading-hierarchy.js +94 -0
  16. package/dist/accessibility/heading-hierarchy.js.map +1 -0
  17. package/dist/accessibility/index.d.ts +25 -0
  18. package/dist/accessibility/index.d.ts.map +1 -0
  19. package/dist/accessibility/index.js +21 -0
  20. package/dist/accessibility/index.js.map +1 -0
  21. package/dist/accessibility/keyboard-nav.d.ts +63 -0
  22. package/dist/accessibility/keyboard-nav.d.ts.map +1 -0
  23. package/dist/accessibility/keyboard-nav.js +86 -0
  24. package/dist/accessibility/keyboard-nav.js.map +1 -0
  25. package/dist/accessibility/semantic-html.d.ts +76 -0
  26. package/dist/accessibility/semantic-html.d.ts.map +1 -0
  27. package/dist/accessibility/semantic-html.js +204 -0
  28. package/dist/accessibility/semantic-html.js.map +1 -0
  29. package/dist/api/client-patterns.d.ts +121 -0
  30. package/dist/api/client-patterns.d.ts.map +1 -0
  31. package/dist/api/client-patterns.js +478 -0
  32. package/dist/api/client-patterns.js.map +1 -0
  33. package/dist/api/error-format.d.ts +140 -0
  34. package/dist/api/error-format.d.ts.map +1 -0
  35. package/dist/api/error-format.js +614 -0
  36. package/dist/api/error-format.js.map +1 -0
  37. package/dist/api/http-methods.d.ts +255 -0
  38. package/dist/api/http-methods.d.ts.map +1 -0
  39. package/dist/api/http-methods.js +890 -0
  40. package/dist/api/http-methods.js.map +1 -0
  41. package/dist/api/index.d.ts +16 -0
  42. package/dist/api/index.d.ts.map +1 -0
  43. package/dist/api/index.js +37 -0
  44. package/dist/api/index.js.map +1 -0
  45. package/dist/api/pagination.d.ts +133 -0
  46. package/dist/api/pagination.d.ts.map +1 -0
  47. package/dist/api/pagination.js +521 -0
  48. package/dist/api/pagination.js.map +1 -0
  49. package/dist/api/response-envelope.d.ts +261 -0
  50. package/dist/api/response-envelope.d.ts.map +1 -0
  51. package/dist/api/response-envelope.js +1050 -0
  52. package/dist/api/response-envelope.js.map +1 -0
  53. package/dist/api/retry-patterns.d.ts +117 -0
  54. package/dist/api/retry-patterns.d.ts.map +1 -0
  55. package/dist/api/retry-patterns.js +480 -0
  56. package/dist/api/retry-patterns.js.map +1 -0
  57. package/dist/api/route-structure.d.ts +128 -0
  58. package/dist/api/route-structure.d.ts.map +1 -0
  59. package/dist/api/route-structure.js +738 -0
  60. package/dist/api/route-structure.js.map +1 -0
  61. package/dist/auth/audit-logging.d.ts +80 -0
  62. package/dist/auth/audit-logging.d.ts.map +1 -0
  63. package/dist/auth/audit-logging.js +370 -0
  64. package/dist/auth/audit-logging.js.map +1 -0
  65. package/dist/auth/index.d.ts +33 -0
  66. package/dist/auth/index.d.ts.map +1 -0
  67. package/dist/auth/index.js +49 -0
  68. package/dist/auth/index.js.map +1 -0
  69. package/dist/auth/middleware-usage.d.ts +65 -0
  70. package/dist/auth/middleware-usage.d.ts.map +1 -0
  71. package/dist/auth/middleware-usage.js +192 -0
  72. package/dist/auth/middleware-usage.js.map +1 -0
  73. package/dist/auth/permission-checks.d.ts +60 -0
  74. package/dist/auth/permission-checks.d.ts.map +1 -0
  75. package/dist/auth/permission-checks.js +159 -0
  76. package/dist/auth/permission-checks.js.map +1 -0
  77. package/dist/auth/rbac-patterns.d.ts +68 -0
  78. package/dist/auth/rbac-patterns.d.ts.map +1 -0
  79. package/dist/auth/rbac-patterns.js +143 -0
  80. package/dist/auth/rbac-patterns.js.map +1 -0
  81. package/dist/auth/resource-ownership.d.ts +77 -0
  82. package/dist/auth/resource-ownership.d.ts.map +1 -0
  83. package/dist/auth/resource-ownership.js +324 -0
  84. package/dist/auth/resource-ownership.js.map +1 -0
  85. package/dist/auth/token-handling.d.ts +64 -0
  86. package/dist/auth/token-handling.d.ts.map +1 -0
  87. package/dist/auth/token-handling.js +151 -0
  88. package/dist/auth/token-handling.js.map +1 -0
  89. package/dist/base/ast-detector.d.ts +421 -0
  90. package/dist/base/ast-detector.d.ts.map +1 -0
  91. package/dist/base/ast-detector.js +699 -0
  92. package/dist/base/ast-detector.js.map +1 -0
  93. package/dist/base/base-detector.d.ts +366 -0
  94. package/dist/base/base-detector.d.ts.map +1 -0
  95. package/dist/base/base-detector.js +170 -0
  96. package/dist/base/base-detector.js.map +1 -0
  97. package/dist/base/index.d.ts +12 -0
  98. package/dist/base/index.d.ts.map +1 -0
  99. package/dist/base/index.js +17 -0
  100. package/dist/base/index.js.map +1 -0
  101. package/dist/base/regex-detector.d.ts +421 -0
  102. package/dist/base/regex-detector.d.ts.map +1 -0
  103. package/dist/base/regex-detector.js +537 -0
  104. package/dist/base/regex-detector.js.map +1 -0
  105. package/dist/base/structural-detector.d.ts +424 -0
  106. package/dist/base/structural-detector.d.ts.map +1 -0
  107. package/dist/base/structural-detector.js +731 -0
  108. package/dist/base/structural-detector.js.map +1 -0
  109. package/dist/base/types.d.ts +53 -0
  110. package/dist/base/types.d.ts.map +1 -0
  111. package/dist/base/types.js +5 -0
  112. package/dist/base/types.js.map +1 -0
  113. package/dist/components/component-structure.d.ts +163 -0
  114. package/dist/components/component-structure.d.ts.map +1 -0
  115. package/dist/components/component-structure.js +500 -0
  116. package/dist/components/component-structure.js.map +1 -0
  117. package/dist/components/composition.d.ts +287 -0
  118. package/dist/components/composition.d.ts.map +1 -0
  119. package/dist/components/composition.js +1123 -0
  120. package/dist/components/composition.js.map +1 -0
  121. package/dist/components/duplicate-detection.d.ts +251 -0
  122. package/dist/components/duplicate-detection.d.ts.map +1 -0
  123. package/dist/components/duplicate-detection.js +804 -0
  124. package/dist/components/duplicate-detection.js.map +1 -0
  125. package/dist/components/index.d.ts +16 -0
  126. package/dist/components/index.d.ts.map +1 -0
  127. package/dist/components/index.js +51 -0
  128. package/dist/components/index.js.map +1 -0
  129. package/dist/components/near-duplicate.d.ts +402 -0
  130. package/dist/components/near-duplicate.d.ts.map +1 -0
  131. package/dist/components/near-duplicate.js +1090 -0
  132. package/dist/components/near-duplicate.js.map +1 -0
  133. package/dist/components/props-patterns.d.ts +194 -0
  134. package/dist/components/props-patterns.d.ts.map +1 -0
  135. package/dist/components/props-patterns.js +795 -0
  136. package/dist/components/props-patterns.js.map +1 -0
  137. package/dist/components/ref-forwarding.d.ts +250 -0
  138. package/dist/components/ref-forwarding.d.ts.map +1 -0
  139. package/dist/components/ref-forwarding.js +832 -0
  140. package/dist/components/ref-forwarding.js.map +1 -0
  141. package/dist/components/state-patterns.d.ts +291 -0
  142. package/dist/components/state-patterns.d.ts.map +1 -0
  143. package/dist/components/state-patterns.js +970 -0
  144. package/dist/components/state-patterns.js.map +1 -0
  145. package/dist/config/config-validation.d.ts +74 -0
  146. package/dist/config/config-validation.d.ts.map +1 -0
  147. package/dist/config/config-validation.js +446 -0
  148. package/dist/config/config-validation.js.map +1 -0
  149. package/dist/config/default-values.d.ts +72 -0
  150. package/dist/config/default-values.d.ts.map +1 -0
  151. package/dist/config/default-values.js +386 -0
  152. package/dist/config/default-values.js.map +1 -0
  153. package/dist/config/env-naming.d.ts +73 -0
  154. package/dist/config/env-naming.d.ts.map +1 -0
  155. package/dist/config/env-naming.js +429 -0
  156. package/dist/config/env-naming.js.map +1 -0
  157. package/dist/config/environment-detection.d.ts +72 -0
  158. package/dist/config/environment-detection.d.ts.map +1 -0
  159. package/dist/config/environment-detection.js +400 -0
  160. package/dist/config/environment-detection.js.map +1 -0
  161. package/dist/config/feature-flags.d.ts +72 -0
  162. package/dist/config/feature-flags.d.ts.map +1 -0
  163. package/dist/config/feature-flags.js +384 -0
  164. package/dist/config/feature-flags.js.map +1 -0
  165. package/dist/config/index.d.ts +27 -0
  166. package/dist/config/index.d.ts.map +1 -0
  167. package/dist/config/index.js +43 -0
  168. package/dist/config/index.js.map +1 -0
  169. package/dist/config/required-optional.d.ts +71 -0
  170. package/dist/config/required-optional.d.ts.map +1 -0
  171. package/dist/config/required-optional.js +344 -0
  172. package/dist/config/required-optional.js.map +1 -0
  173. package/dist/data-access/connection-pooling.d.ts +63 -0
  174. package/dist/data-access/connection-pooling.d.ts.map +1 -0
  175. package/dist/data-access/connection-pooling.js +297 -0
  176. package/dist/data-access/connection-pooling.js.map +1 -0
  177. package/dist/data-access/dto-patterns.d.ts +64 -0
  178. package/dist/data-access/dto-patterns.d.ts.map +1 -0
  179. package/dist/data-access/dto-patterns.js +291 -0
  180. package/dist/data-access/dto-patterns.js.map +1 -0
  181. package/dist/data-access/index.d.ts +31 -0
  182. package/dist/data-access/index.d.ts.map +1 -0
  183. package/dist/data-access/index.js +49 -0
  184. package/dist/data-access/index.js.map +1 -0
  185. package/dist/data-access/n-plus-one.d.ts +60 -0
  186. package/dist/data-access/n-plus-one.d.ts.map +1 -0
  187. package/dist/data-access/n-plus-one.js +264 -0
  188. package/dist/data-access/n-plus-one.js.map +1 -0
  189. package/dist/data-access/query-patterns.d.ts +64 -0
  190. package/dist/data-access/query-patterns.d.ts.map +1 -0
  191. package/dist/data-access/query-patterns.js +314 -0
  192. package/dist/data-access/query-patterns.js.map +1 -0
  193. package/dist/data-access/repository-pattern.d.ts +62 -0
  194. package/dist/data-access/repository-pattern.d.ts.map +1 -0
  195. package/dist/data-access/repository-pattern.js +257 -0
  196. package/dist/data-access/repository-pattern.js.map +1 -0
  197. package/dist/data-access/transaction-patterns.d.ts +61 -0
  198. package/dist/data-access/transaction-patterns.d.ts.map +1 -0
  199. package/dist/data-access/transaction-patterns.js +277 -0
  200. package/dist/data-access/transaction-patterns.js.map +1 -0
  201. package/dist/data-access/validation-patterns.d.ts +62 -0
  202. package/dist/data-access/validation-patterns.d.ts.map +1 -0
  203. package/dist/data-access/validation-patterns.js +301 -0
  204. package/dist/data-access/validation-patterns.js.map +1 -0
  205. package/dist/documentation/deprecation.d.ts +62 -0
  206. package/dist/documentation/deprecation.d.ts.map +1 -0
  207. package/dist/documentation/deprecation.js +83 -0
  208. package/dist/documentation/deprecation.js.map +1 -0
  209. package/dist/documentation/example-code.d.ts +64 -0
  210. package/dist/documentation/example-code.d.ts.map +1 -0
  211. package/dist/documentation/example-code.js +79 -0
  212. package/dist/documentation/example-code.js.map +1 -0
  213. package/dist/documentation/index.d.ts +22 -0
  214. package/dist/documentation/index.d.ts.map +1 -0
  215. package/dist/documentation/index.js +19 -0
  216. package/dist/documentation/index.js.map +1 -0
  217. package/dist/documentation/jsdoc-patterns.d.ts +72 -0
  218. package/dist/documentation/jsdoc-patterns.d.ts.map +1 -0
  219. package/dist/documentation/jsdoc-patterns.js +92 -0
  220. package/dist/documentation/jsdoc-patterns.js.map +1 -0
  221. package/dist/documentation/readme-structure.d.ts +67 -0
  222. package/dist/documentation/readme-structure.d.ts.map +1 -0
  223. package/dist/documentation/readme-structure.js +76 -0
  224. package/dist/documentation/readme-structure.js.map +1 -0
  225. package/dist/documentation/todo-patterns.d.ts +67 -0
  226. package/dist/documentation/todo-patterns.d.ts.map +1 -0
  227. package/dist/documentation/todo-patterns.js +73 -0
  228. package/dist/documentation/todo-patterns.js.map +1 -0
  229. package/dist/errors/async-errors.d.ts +72 -0
  230. package/dist/errors/async-errors.d.ts.map +1 -0
  231. package/dist/errors/async-errors.js +214 -0
  232. package/dist/errors/async-errors.js.map +1 -0
  233. package/dist/errors/circuit-breaker.d.ts +53 -0
  234. package/dist/errors/circuit-breaker.d.ts.map +1 -0
  235. package/dist/errors/circuit-breaker.js +241 -0
  236. package/dist/errors/circuit-breaker.js.map +1 -0
  237. package/dist/errors/error-codes.d.ts +73 -0
  238. package/dist/errors/error-codes.d.ts.map +1 -0
  239. package/dist/errors/error-codes.js +211 -0
  240. package/dist/errors/error-codes.js.map +1 -0
  241. package/dist/errors/error-logging.d.ts +73 -0
  242. package/dist/errors/error-logging.d.ts.map +1 -0
  243. package/dist/errors/error-logging.js +256 -0
  244. package/dist/errors/error-logging.js.map +1 -0
  245. package/dist/errors/error-propagation.d.ts +73 -0
  246. package/dist/errors/error-propagation.d.ts.map +1 -0
  247. package/dist/errors/error-propagation.js +244 -0
  248. package/dist/errors/error-propagation.js.map +1 -0
  249. package/dist/errors/exception-hierarchy.d.ts +75 -0
  250. package/dist/errors/exception-hierarchy.d.ts.map +1 -0
  251. package/dist/errors/exception-hierarchy.js +259 -0
  252. package/dist/errors/exception-hierarchy.js.map +1 -0
  253. package/dist/errors/index.d.ts +31 -0
  254. package/dist/errors/index.d.ts.map +1 -0
  255. package/dist/errors/index.js +49 -0
  256. package/dist/errors/index.js.map +1 -0
  257. package/dist/errors/try-catch-placement.d.ts +73 -0
  258. package/dist/errors/try-catch-placement.d.ts.map +1 -0
  259. package/dist/errors/try-catch-placement.js +214 -0
  260. package/dist/errors/try-catch-placement.js.map +1 -0
  261. package/dist/index.d.ts +221 -0
  262. package/dist/index.d.ts.map +1 -0
  263. package/dist/index.js +245 -0
  264. package/dist/index.js.map +1 -0
  265. package/dist/logging/context-fields.d.ts +48 -0
  266. package/dist/logging/context-fields.d.ts.map +1 -0
  267. package/dist/logging/context-fields.js +160 -0
  268. package/dist/logging/context-fields.js.map +1 -0
  269. package/dist/logging/correlation-ids.d.ts +44 -0
  270. package/dist/logging/correlation-ids.d.ts.map +1 -0
  271. package/dist/logging/correlation-ids.js +144 -0
  272. package/dist/logging/correlation-ids.js.map +1 -0
  273. package/dist/logging/health-checks.d.ts +45 -0
  274. package/dist/logging/health-checks.d.ts.map +1 -0
  275. package/dist/logging/health-checks.js +165 -0
  276. package/dist/logging/health-checks.js.map +1 -0
  277. package/dist/logging/index.d.ts +31 -0
  278. package/dist/logging/index.d.ts.map +1 -0
  279. package/dist/logging/index.js +49 -0
  280. package/dist/logging/index.js.map +1 -0
  281. package/dist/logging/log-levels.d.ts +46 -0
  282. package/dist/logging/log-levels.d.ts.map +1 -0
  283. package/dist/logging/log-levels.js +178 -0
  284. package/dist/logging/log-levels.js.map +1 -0
  285. package/dist/logging/metric-naming.d.ts +46 -0
  286. package/dist/logging/metric-naming.d.ts.map +1 -0
  287. package/dist/logging/metric-naming.js +157 -0
  288. package/dist/logging/metric-naming.js.map +1 -0
  289. package/dist/logging/pii-redaction.d.ts +44 -0
  290. package/dist/logging/pii-redaction.d.ts.map +1 -0
  291. package/dist/logging/pii-redaction.js +166 -0
  292. package/dist/logging/pii-redaction.js.map +1 -0
  293. package/dist/logging/structured-format.d.ts +53 -0
  294. package/dist/logging/structured-format.d.ts.map +1 -0
  295. package/dist/logging/structured-format.js +235 -0
  296. package/dist/logging/structured-format.js.map +1 -0
  297. package/dist/performance/bundle-size.d.ts +79 -0
  298. package/dist/performance/bundle-size.d.ts.map +1 -0
  299. package/dist/performance/bundle-size.js +276 -0
  300. package/dist/performance/bundle-size.js.map +1 -0
  301. package/dist/performance/caching-patterns.d.ts +78 -0
  302. package/dist/performance/caching-patterns.d.ts.map +1 -0
  303. package/dist/performance/caching-patterns.js +257 -0
  304. package/dist/performance/caching-patterns.js.map +1 -0
  305. package/dist/performance/code-splitting.d.ts +86 -0
  306. package/dist/performance/code-splitting.d.ts.map +1 -0
  307. package/dist/performance/code-splitting.js +447 -0
  308. package/dist/performance/code-splitting.js.map +1 -0
  309. package/dist/performance/debounce-throttle.d.ts +75 -0
  310. package/dist/performance/debounce-throttle.d.ts.map +1 -0
  311. package/dist/performance/debounce-throttle.js +232 -0
  312. package/dist/performance/debounce-throttle.js.map +1 -0
  313. package/dist/performance/index.d.ts +28 -0
  314. package/dist/performance/index.d.ts.map +1 -0
  315. package/dist/performance/index.js +39 -0
  316. package/dist/performance/index.js.map +1 -0
  317. package/dist/performance/lazy-loading.d.ts +75 -0
  318. package/dist/performance/lazy-loading.d.ts.map +1 -0
  319. package/dist/performance/lazy-loading.js +233 -0
  320. package/dist/performance/lazy-loading.js.map +1 -0
  321. package/dist/performance/memoization.d.ts +75 -0
  322. package/dist/performance/memoization.d.ts.map +1 -0
  323. package/dist/performance/memoization.js +251 -0
  324. package/dist/performance/memoization.js.map +1 -0
  325. package/dist/registry/detector-registry.d.ts +266 -0
  326. package/dist/registry/detector-registry.d.ts.map +1 -0
  327. package/dist/registry/detector-registry.js +526 -0
  328. package/dist/registry/detector-registry.js.map +1 -0
  329. package/dist/registry/index.d.ts +10 -0
  330. package/dist/registry/index.d.ts.map +1 -0
  331. package/dist/registry/index.js +10 -0
  332. package/dist/registry/index.js.map +1 -0
  333. package/dist/registry/loader.d.ts +232 -0
  334. package/dist/registry/loader.d.ts.map +1 -0
  335. package/dist/registry/loader.js +419 -0
  336. package/dist/registry/loader.js.map +1 -0
  337. package/dist/registry/types.d.ts +111 -0
  338. package/dist/registry/types.d.ts.map +1 -0
  339. package/dist/registry/types.js +19 -0
  340. package/dist/registry/types.js.map +1 -0
  341. package/dist/security/csp-headers.d.ts +78 -0
  342. package/dist/security/csp-headers.d.ts.map +1 -0
  343. package/dist/security/csp-headers.js +401 -0
  344. package/dist/security/csp-headers.js.map +1 -0
  345. package/dist/security/csrf-protection.d.ts +72 -0
  346. package/dist/security/csrf-protection.d.ts.map +1 -0
  347. package/dist/security/csrf-protection.js +344 -0
  348. package/dist/security/csrf-protection.js.map +1 -0
  349. package/dist/security/index.d.ts +30 -0
  350. package/dist/security/index.d.ts.map +1 -0
  351. package/dist/security/index.js +48 -0
  352. package/dist/security/index.js.map +1 -0
  353. package/dist/security/input-sanitization.d.ts +74 -0
  354. package/dist/security/input-sanitization.d.ts.map +1 -0
  355. package/dist/security/input-sanitization.js +373 -0
  356. package/dist/security/input-sanitization.js.map +1 -0
  357. package/dist/security/rate-limiting.d.ts +81 -0
  358. package/dist/security/rate-limiting.d.ts.map +1 -0
  359. package/dist/security/rate-limiting.js +535 -0
  360. package/dist/security/rate-limiting.js.map +1 -0
  361. package/dist/security/secret-management.d.ts +83 -0
  362. package/dist/security/secret-management.d.ts.map +1 -0
  363. package/dist/security/secret-management.js +547 -0
  364. package/dist/security/secret-management.js.map +1 -0
  365. package/dist/security/sql-injection.d.ts +76 -0
  366. package/dist/security/sql-injection.d.ts.map +1 -0
  367. package/dist/security/sql-injection.js +383 -0
  368. package/dist/security/sql-injection.js.map +1 -0
  369. package/dist/security/xss-prevention.d.ts +80 -0
  370. package/dist/security/xss-prevention.d.ts.map +1 -0
  371. package/dist/security/xss-prevention.js +416 -0
  372. package/dist/security/xss-prevention.js.map +1 -0
  373. package/dist/structural/barrel-exports.d.ts +178 -0
  374. package/dist/structural/barrel-exports.d.ts.map +1 -0
  375. package/dist/structural/barrel-exports.js +553 -0
  376. package/dist/structural/barrel-exports.js.map +1 -0
  377. package/dist/structural/circular-deps.d.ts +140 -0
  378. package/dist/structural/circular-deps.d.ts.map +1 -0
  379. package/dist/structural/circular-deps.js +422 -0
  380. package/dist/structural/circular-deps.js.map +1 -0
  381. package/dist/structural/co-location.d.ts +202 -0
  382. package/dist/structural/co-location.d.ts.map +1 -0
  383. package/dist/structural/co-location.js +640 -0
  384. package/dist/structural/co-location.js.map +1 -0
  385. package/dist/structural/directory-structure.d.ts +151 -0
  386. package/dist/structural/directory-structure.d.ts.map +1 -0
  387. package/dist/structural/directory-structure.js +457 -0
  388. package/dist/structural/directory-structure.js.map +1 -0
  389. package/dist/structural/file-naming.d.ts +61 -0
  390. package/dist/structural/file-naming.d.ts.map +1 -0
  391. package/dist/structural/file-naming.js +231 -0
  392. package/dist/structural/file-naming.js.map +1 -0
  393. package/dist/structural/import-ordering.d.ts +212 -0
  394. package/dist/structural/import-ordering.d.ts.map +1 -0
  395. package/dist/structural/import-ordering.js +821 -0
  396. package/dist/structural/import-ordering.js.map +1 -0
  397. package/dist/structural/index.d.ts +23 -0
  398. package/dist/structural/index.d.ts.map +1 -0
  399. package/dist/structural/index.js +26 -0
  400. package/dist/structural/index.js.map +1 -0
  401. package/dist/structural/module-boundaries.d.ts +164 -0
  402. package/dist/structural/module-boundaries.d.ts.map +1 -0
  403. package/dist/structural/module-boundaries.js +616 -0
  404. package/dist/structural/module-boundaries.js.map +1 -0
  405. package/dist/structural/package-boundaries.d.ts +182 -0
  406. package/dist/structural/package-boundaries.d.ts.map +1 -0
  407. package/dist/structural/package-boundaries.js +602 -0
  408. package/dist/structural/package-boundaries.js.map +1 -0
  409. package/dist/styling/class-naming.d.ts +263 -0
  410. package/dist/styling/class-naming.d.ts.map +1 -0
  411. package/dist/styling/class-naming.js +892 -0
  412. package/dist/styling/class-naming.js.map +1 -0
  413. package/dist/styling/color-usage.d.ts +213 -0
  414. package/dist/styling/color-usage.d.ts.map +1 -0
  415. package/dist/styling/color-usage.js +732 -0
  416. package/dist/styling/color-usage.js.map +1 -0
  417. package/dist/styling/design-tokens.d.ts +212 -0
  418. package/dist/styling/design-tokens.d.ts.map +1 -0
  419. package/dist/styling/design-tokens.js +748 -0
  420. package/dist/styling/design-tokens.js.map +1 -0
  421. package/dist/styling/index.d.ts +16 -0
  422. package/dist/styling/index.d.ts.map +1 -0
  423. package/dist/styling/index.js +56 -0
  424. package/dist/styling/index.js.map +1 -0
  425. package/dist/styling/responsive.d.ts +304 -0
  426. package/dist/styling/responsive.d.ts.map +1 -0
  427. package/dist/styling/responsive.js +888 -0
  428. package/dist/styling/responsive.js.map +1 -0
  429. package/dist/styling/spacing-scale.d.ts +248 -0
  430. package/dist/styling/spacing-scale.d.ts.map +1 -0
  431. package/dist/styling/spacing-scale.js +865 -0
  432. package/dist/styling/spacing-scale.js.map +1 -0
  433. package/dist/styling/tailwind-patterns.d.ts +305 -0
  434. package/dist/styling/tailwind-patterns.d.ts.map +1 -0
  435. package/dist/styling/tailwind-patterns.js +1181 -0
  436. package/dist/styling/tailwind-patterns.js.map +1 -0
  437. package/dist/styling/typography.d.ts +281 -0
  438. package/dist/styling/typography.d.ts.map +1 -0
  439. package/dist/styling/typography.js +1004 -0
  440. package/dist/styling/typography.js.map +1 -0
  441. package/dist/styling/z-index-scale.d.ts +270 -0
  442. package/dist/styling/z-index-scale.d.ts.map +1 -0
  443. package/dist/styling/z-index-scale.js +714 -0
  444. package/dist/styling/z-index-scale.js.map +1 -0
  445. package/dist/testing/co-location.d.ts +42 -0
  446. package/dist/testing/co-location.d.ts.map +1 -0
  447. package/dist/testing/co-location.js +134 -0
  448. package/dist/testing/co-location.js.map +1 -0
  449. package/dist/testing/describe-naming.d.ts +47 -0
  450. package/dist/testing/describe-naming.d.ts.map +1 -0
  451. package/dist/testing/describe-naming.js +150 -0
  452. package/dist/testing/describe-naming.js.map +1 -0
  453. package/dist/testing/file-naming.d.ts +44 -0
  454. package/dist/testing/file-naming.d.ts.map +1 -0
  455. package/dist/testing/file-naming.js +131 -0
  456. package/dist/testing/file-naming.js.map +1 -0
  457. package/dist/testing/fixture-patterns.d.ts +52 -0
  458. package/dist/testing/fixture-patterns.d.ts.map +1 -0
  459. package/dist/testing/fixture-patterns.js +228 -0
  460. package/dist/testing/fixture-patterns.js.map +1 -0
  461. package/dist/testing/index.d.ts +31 -0
  462. package/dist/testing/index.d.ts.map +1 -0
  463. package/dist/testing/index.js +49 -0
  464. package/dist/testing/index.js.map +1 -0
  465. package/dist/testing/mock-patterns.d.ts +53 -0
  466. package/dist/testing/mock-patterns.d.ts.map +1 -0
  467. package/dist/testing/mock-patterns.js +264 -0
  468. package/dist/testing/mock-patterns.js.map +1 -0
  469. package/dist/testing/setup-teardown.d.ts +55 -0
  470. package/dist/testing/setup-teardown.d.ts.map +1 -0
  471. package/dist/testing/setup-teardown.js +262 -0
  472. package/dist/testing/setup-teardown.js.map +1 -0
  473. package/dist/testing/test-structure.d.ts +51 -0
  474. package/dist/testing/test-structure.d.ts.map +1 -0
  475. package/dist/testing/test-structure.js +225 -0
  476. package/dist/testing/test-structure.js.map +1 -0
  477. package/dist/types/any-usage.d.ts +99 -0
  478. package/dist/types/any-usage.d.ts.map +1 -0
  479. package/dist/types/any-usage.js +641 -0
  480. package/dist/types/any-usage.js.map +1 -0
  481. package/dist/types/file-location.d.ts +76 -0
  482. package/dist/types/file-location.d.ts.map +1 -0
  483. package/dist/types/file-location.js +395 -0
  484. package/dist/types/file-location.js.map +1 -0
  485. package/dist/types/generic-patterns.d.ts +97 -0
  486. package/dist/types/generic-patterns.d.ts.map +1 -0
  487. package/dist/types/generic-patterns.js +615 -0
  488. package/dist/types/generic-patterns.js.map +1 -0
  489. package/dist/types/index.d.ts +31 -0
  490. package/dist/types/index.d.ts.map +1 -0
  491. package/dist/types/index.js +43 -0
  492. package/dist/types/index.js.map +1 -0
  493. package/dist/types/interface-vs-type.d.ts +81 -0
  494. package/dist/types/interface-vs-type.d.ts.map +1 -0
  495. package/dist/types/interface-vs-type.js +440 -0
  496. package/dist/types/interface-vs-type.js.map +1 -0
  497. package/dist/types/naming-conventions.d.ts +84 -0
  498. package/dist/types/naming-conventions.d.ts.map +1 -0
  499. package/dist/types/naming-conventions.js +455 -0
  500. package/dist/types/naming-conventions.js.map +1 -0
  501. package/dist/types/type-assertions.d.ts +98 -0
  502. package/dist/types/type-assertions.d.ts.map +1 -0
  503. package/dist/types/type-assertions.js +639 -0
  504. package/dist/types/type-assertions.js.map +1 -0
  505. package/dist/types/utility-types.d.ts +110 -0
  506. package/dist/types/utility-types.d.ts.map +1 -0
  507. package/dist/types/utility-types.js +547 -0
  508. package/dist/types/utility-types.js.map +1 -0
  509. package/package.json +44 -0
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Types Detectors - Type pattern detection
3
+ *
4
+ * Exports all type-related detectors for detecting TypeScript type patterns.
5
+ *
6
+ * @requirements 18.1-18.7 - Type pattern detection
7
+ */
8
+ export { FileLocationDetector, createFileLocationDetector, analyzeFileLocation, shouldExcludeFile as shouldExcludeFileLocation, isTypeFile, detectCentralizedTypes, detectCoLocatedTypes, detectBarrelExports, detectTypeOnlyModule, detectDeclarationFile, detectSharedTypes, detectDomainTypes, detectScatteredTypesViolations, detectInconsistentLocationViolations, CENTRALIZED_TYPES_PATTERNS, CO_LOCATED_TYPES_PATTERNS, BARREL_EXPORT_PATTERNS, TYPE_ONLY_MODULE_PATTERNS, DECLARATION_FILE_PATTERNS, SHARED_TYPES_PATTERNS, DOMAIN_TYPES_PATTERNS, } from './file-location.js';
9
+ export type { FileLocationPatternType, FileLocationViolationType, FileLocationPatternInfo, FileLocationViolationInfo, FileLocationAnalysis, } from './file-location.js';
10
+ export { NamingConventionsDetector, createNamingConventionsDetector, analyzeNamingConventions, shouldExcludeFile as shouldExcludeNamingConventions, detectPascalCaseTypes, detectPascalCaseInterfaces, detectIPrefixInterfaces, detectTPrefixTypes, detectPropsSuffix, detectStateSuffix, detectConfigSuffix, detectEnumPascalCase, detectGenericSingleLetter, detectNonPascalCaseViolations, detectHungarianNotationViolations, detectUnclearGenericViolations, PASCAL_CASE_TYPE_PATTERNS, PASCAL_CASE_INTERFACE_PATTERNS, I_PREFIX_INTERFACE_PATTERNS, T_PREFIX_TYPE_PATTERNS, } from './naming-conventions.js';
11
+ export type { NamingConventionPatternType, NamingConventionViolationType, NamingConventionPatternInfo, NamingConventionViolationInfo, NamingConventionAnalysis, } from './naming-conventions.js';
12
+ export { InterfaceVsTypeDetector, createInterfaceVsTypeDetector, analyzeInterfaceVsType, shouldExcludeFile as shouldExcludeInterfaceVsType, detectInterfaceObject, detectInterfaceExtends, detectInterfaceImplements, detectTypeUnion, detectTypeIntersection, detectTypeMapped, detectTypeConditional, detectTypeUtility, detectDeclarationMerging, detectTypeForObjectViolations, detectUnnecessaryTypeAliasViolations, INTERFACE_OBJECT_PATTERNS, INTERFACE_EXTENDS_PATTERNS, TYPE_UNION_PATTERNS, TYPE_INTERSECTION_PATTERNS, TYPE_MAPPED_PATTERNS, TYPE_CONDITIONAL_PATTERNS, TYPE_UTILITY_PATTERNS, } from './interface-vs-type.js';
13
+ export type { InterfaceVsTypePatternType, InterfaceVsTypeViolationType, InterfaceVsTypePatternInfo, InterfaceVsTypeViolationInfo, InterfaceVsTypeAnalysis, } from './interface-vs-type.js';
14
+ export { GenericPatternsDetector, createGenericPatternsDetector, analyzeGenericPatterns, shouldExcludeFile as shouldExcludeGenericPatterns, detectGenericFunctions, detectGenericArrowFunctions, detectGenericClasses, detectGenericInterfaces, detectGenericTypeAliases, detectConstrainedGenerics, detectDefaultGenerics, detectMultipleTypeParams, detectGenericMethods, detectInferKeyword, detectKeyofConstraint, detectMappedGenerics, detectConditionalGenerics, detectOverlyComplexGenerics, detectUnclearGenericNames, detectTooManyTypeParams, GENERIC_FUNCTION_PATTERNS, GENERIC_ARROW_FUNCTION_PATTERNS, GENERIC_CLASS_PATTERNS, GENERIC_INTERFACE_PATTERNS, GENERIC_TYPE_ALIAS_PATTERNS, CONSTRAINED_GENERIC_PATTERNS, DEFAULT_GENERIC_PATTERNS, MULTIPLE_TYPE_PARAMS_PATTERNS, } from './generic-patterns.js';
15
+ export type { GenericPatternType, GenericViolationType, GenericPatternInfo, GenericViolationInfo, GenericPatternsAnalysis, } from './generic-patterns.js';
16
+ export { UtilityTypesDetector, createUtilityTypesDetector, analyzeUtilityTypes, shouldExcludeFile as shouldExcludeUtilityTypes, detectPartial, detectRequired, detectReadonly, detectPick, detectOmit, detectRecord, detectExclude, detectExtract, detectNonNullable, detectReturnType, detectParameters, detectInstanceType, detectAwaited, detectThisType, detectCustomMapped, detectCustomConditional, detectTemplateLiteral, detectRecursiveType, detectBrandedType, detectDeepPartial, detectDeepReadonly, detectRedundantUtilityViolations, detectNestedUtilityViolations, detectComplexUtilityChainViolations, PARTIAL_PATTERNS, REQUIRED_PATTERNS, READONLY_PATTERNS, PICK_PATTERNS, OMIT_PATTERNS, RECORD_PATTERNS, } from './utility-types.js';
17
+ export type { UtilityTypePatternType, UtilityTypeViolationType, UtilityTypePatternInfo, UtilityTypeViolationInfo, UtilityTypesAnalysis, } from './utility-types.js';
18
+ export { TypeAssertionsDetector, createTypeAssertionsDetector, analyzeTypeAssertions, shouldExcludeFile as shouldExcludeTypeAssertions, detectAsAssertions, detectAsConst, detectAsUnknown, detectAsAny, detectAngleBracket, detectNonNullAssertion, detectDefiniteAssignment, detectSatisfies, detectTypeGuardTypeof, detectTypeGuardInstanceof, detectTypeGuardIn, detectTypePredicate, detectAssertionFunction, detectDoubleAssertion, detectUnsafeAsAnyViolations, detectExcessiveNonNullViolations, detectDoubleAssertionViolations, detectUnnecessaryAssertionViolations, AS_ASSERTION_PATTERNS, AS_CONST_PATTERNS, AS_UNKNOWN_PATTERNS, AS_ANY_PATTERNS, NON_NULL_ASSERTION_PATTERNS, SATISFIES_PATTERNS, TYPE_GUARD_TYPEOF_PATTERNS, TYPE_GUARD_INSTANCEOF_PATTERNS, TYPE_PREDICATE_PATTERNS, } from './type-assertions.js';
19
+ export type { TypeAssertionPatternType, TypeAssertionViolationType, TypeAssertionPatternInfo, TypeAssertionViolationInfo, TypeAssertionsAnalysis, } from './type-assertions.js';
20
+ export { AnyUsageDetector, createAnyUsageDetector, analyzeAnyUsage, shouldExcludeFile as shouldExcludeAnyUsage, detectExplicitAnyAnnotation, detectAnyParameter, detectAnyReturnType, detectAnyGeneric, detectAnyArray, detectAnyRecord, detectAnyObject, detectAnyFunction, detectAnyPromise, detectAnyCast, detectUnknownUsage, detectNeverUsage, detectObjectType, detectFunctionType, detectExplicitAnyViolations, detectAnyInPublicApiViolations, detectAnySpreadViolations, detectAnyIndexSignatureViolations, EXPLICIT_ANY_ANNOTATION_PATTERNS, ANY_PARAMETER_PATTERNS, ANY_RETURN_TYPE_PATTERNS, ANY_GENERIC_PATTERNS, ANY_ARRAY_PATTERNS, ANY_RECORD_PATTERNS, UNKNOWN_USAGE_PATTERNS, NEVER_USAGE_PATTERNS, } from './any-usage.js';
21
+ export type { AnyUsagePatternType, AnyUsageViolationType, AnyUsagePatternInfo, AnyUsageViolationInfo, AnyUsageAnalysis, } from './any-usage.js';
22
+ import { FileLocationDetector } from './file-location.js';
23
+ import { NamingConventionsDetector } from './naming-conventions.js';
24
+ import { InterfaceVsTypeDetector } from './interface-vs-type.js';
25
+ import { GenericPatternsDetector } from './generic-patterns.js';
26
+ import { UtilityTypesDetector } from './utility-types.js';
27
+ import { TypeAssertionsDetector } from './type-assertions.js';
28
+ import { AnyUsageDetector } from './any-usage.js';
29
+ export type TypesDetector = FileLocationDetector | NamingConventionsDetector | InterfaceVsTypeDetector | GenericPatternsDetector | UtilityTypesDetector | TypeAssertionsDetector | AnyUsageDetector;
30
+ export declare function createTypesDetectors(): TypesDetector[];
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,iBAAiB,IAAI,yBAAyB,EAC9C,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,8BAA8B,EAC9B,oCAAoC,EACpC,0BAA0B,EAC1B,yBAAyB,EACzB,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,wBAAwB,EACxB,iBAAiB,IAAI,8BAA8B,EACnD,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAu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gB,CAAC;AAErB,wBAAgB,oBAAoB,IAAI,aAAa,EAAE,CAUtD"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Types Detectors - Type pattern detection
3
+ *
4
+ * Exports all type-related detectors for detecting TypeScript type patterns.
5
+ *
6
+ * @requirements 18.1-18.7 - Type pattern detection
7
+ */
8
+ // File Location Detector
9
+ export { FileLocationDetector, createFileLocationDetector, analyzeFileLocation, shouldExcludeFile as shouldExcludeFileLocation, isTypeFile, detectCentralizedTypes, detectCoLocatedTypes, detectBarrelExports, detectTypeOnlyModule, detectDeclarationFile, detectSharedTypes, detectDomainTypes, detectScatteredTypesViolations, detectInconsistentLocationViolations, CENTRALIZED_TYPES_PATTERNS, CO_LOCATED_TYPES_PATTERNS, BARREL_EXPORT_PATTERNS, TYPE_ONLY_MODULE_PATTERNS, DECLARATION_FILE_PATTERNS, SHARED_TYPES_PATTERNS, DOMAIN_TYPES_PATTERNS, } from './file-location.js';
10
+ // Naming Conventions Detector
11
+ export { NamingConventionsDetector, createNamingConventionsDetector, analyzeNamingConventions, shouldExcludeFile as shouldExcludeNamingConventions, detectPascalCaseTypes, detectPascalCaseInterfaces, detectIPrefixInterfaces, detectTPrefixTypes, detectPropsSuffix, detectStateSuffix, detectConfigSuffix, detectEnumPascalCase, detectGenericSingleLetter, detectNonPascalCaseViolations, detectHungarianNotationViolations, detectUnclearGenericViolations, PASCAL_CASE_TYPE_PATTERNS, PASCAL_CASE_INTERFACE_PATTERNS, I_PREFIX_INTERFACE_PATTERNS, T_PREFIX_TYPE_PATTERNS, } from './naming-conventions.js';
12
+ // Interface vs Type Detector
13
+ export { InterfaceVsTypeDetector, createInterfaceVsTypeDetector, analyzeInterfaceVsType, shouldExcludeFile as shouldExcludeInterfaceVsType, detectInterfaceObject, detectInterfaceExtends, detectInterfaceImplements, detectTypeUnion, detectTypeIntersection, detectTypeMapped, detectTypeConditional, detectTypeUtility, detectDeclarationMerging, detectTypeForObjectViolations, detectUnnecessaryTypeAliasViolations, INTERFACE_OBJECT_PATTERNS, INTERFACE_EXTENDS_PATTERNS, TYPE_UNION_PATTERNS, TYPE_INTERSECTION_PATTERNS, TYPE_MAPPED_PATTERNS, TYPE_CONDITIONAL_PATTERNS, TYPE_UTILITY_PATTERNS, } from './interface-vs-type.js';
14
+ // Generic Patterns Detector
15
+ export { GenericPatternsDetector, createGenericPatternsDetector, analyzeGenericPatterns, shouldExcludeFile as shouldExcludeGenericPatterns, detectGenericFunctions, detectGenericArrowFunctions, detectGenericClasses, detectGenericInterfaces, detectGenericTypeAliases, detectConstrainedGenerics, detectDefaultGenerics, detectMultipleTypeParams, detectGenericMethods, detectInferKeyword, detectKeyofConstraint, detectMappedGenerics, detectConditionalGenerics, detectOverlyComplexGenerics, detectUnclearGenericNames, detectTooManyTypeParams, GENERIC_FUNCTION_PATTERNS, GENERIC_ARROW_FUNCTION_PATTERNS, GENERIC_CLASS_PATTERNS, GENERIC_INTERFACE_PATTERNS, GENERIC_TYPE_ALIAS_PATTERNS, CONSTRAINED_GENERIC_PATTERNS, DEFAULT_GENERIC_PATTERNS, MULTIPLE_TYPE_PARAMS_PATTERNS, } from './generic-patterns.js';
16
+ // Utility Types Detector
17
+ export { UtilityTypesDetector, createUtilityTypesDetector, analyzeUtilityTypes, shouldExcludeFile as shouldExcludeUtilityTypes, detectPartial, detectRequired, detectReadonly, detectPick, detectOmit, detectRecord, detectExclude, detectExtract, detectNonNullable, detectReturnType, detectParameters, detectInstanceType, detectAwaited, detectThisType, detectCustomMapped, detectCustomConditional, detectTemplateLiteral, detectRecursiveType, detectBrandedType, detectDeepPartial, detectDeepReadonly, detectRedundantUtilityViolations, detectNestedUtilityViolations, detectComplexUtilityChainViolations, PARTIAL_PATTERNS, REQUIRED_PATTERNS, READONLY_PATTERNS, PICK_PATTERNS, OMIT_PATTERNS, RECORD_PATTERNS, } from './utility-types.js';
18
+ // Type Assertions Detector
19
+ export { TypeAssertionsDetector, createTypeAssertionsDetector, analyzeTypeAssertions, shouldExcludeFile as shouldExcludeTypeAssertions, detectAsAssertions, detectAsConst, detectAsUnknown, detectAsAny, detectAngleBracket, detectNonNullAssertion, detectDefiniteAssignment, detectSatisfies, detectTypeGuardTypeof, detectTypeGuardInstanceof, detectTypeGuardIn, detectTypePredicate, detectAssertionFunction, detectDoubleAssertion, detectUnsafeAsAnyViolations, detectExcessiveNonNullViolations, detectDoubleAssertionViolations, detectUnnecessaryAssertionViolations, AS_ASSERTION_PATTERNS, AS_CONST_PATTERNS, AS_UNKNOWN_PATTERNS, AS_ANY_PATTERNS, NON_NULL_ASSERTION_PATTERNS, SATISFIES_PATTERNS, TYPE_GUARD_TYPEOF_PATTERNS, TYPE_GUARD_INSTANCEOF_PATTERNS, TYPE_PREDICATE_PATTERNS, } from './type-assertions.js';
20
+ // Any Usage Detector
21
+ export { AnyUsageDetector, createAnyUsageDetector, analyzeAnyUsage, shouldExcludeFile as shouldExcludeAnyUsage, detectExplicitAnyAnnotation, detectAnyParameter, detectAnyReturnType, detectAnyGeneric, detectAnyArray, detectAnyRecord, detectAnyObject, detectAnyFunction, detectAnyPromise, detectAnyCast, detectUnknownUsage, detectNeverUsage, detectObjectType, detectFunctionType, detectExplicitAnyViolations, detectAnyInPublicApiViolations, detectAnySpreadViolations, detectAnyIndexSignatureViolations, EXPLICIT_ANY_ANNOTATION_PATTERNS, ANY_PARAMETER_PATTERNS, ANY_RETURN_TYPE_PATTERNS, ANY_GENERIC_PATTERNS, ANY_ARRAY_PATTERNS, ANY_RECORD_PATTERNS, UNKNOWN_USAGE_PATTERNS, NEVER_USAGE_PATTERNS, } from './any-usage.js';
22
+ // ============================================================================
23
+ // Factory Function
24
+ // ============================================================================
25
+ import { FileLocationDetector } from './file-location.js';
26
+ import { NamingConventionsDetector } from './naming-conventions.js';
27
+ import { InterfaceVsTypeDetector } from './interface-vs-type.js';
28
+ import { GenericPatternsDetector } from './generic-patterns.js';
29
+ import { UtilityTypesDetector } from './utility-types.js';
30
+ import { TypeAssertionsDetector } from './type-assertions.js';
31
+ import { AnyUsageDetector } from './any-usage.js';
32
+ export function createTypesDetectors() {
33
+ return [
34
+ new FileLocationDetector(),
35
+ new NamingConventionsDetector(),
36
+ new InterfaceVsTypeDetector(),
37
+ new GenericPatternsDetector(),
38
+ new UtilityTypesDetector(),
39
+ new TypeAssertionsDetector(),
40
+ new AnyUsageDetector(),
41
+ ];
42
+ }
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,yBAAyB;AACzB,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,iBAAiB,IAAI,yBAAyB,EAC9C,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,8BAA8B,EAC9B,oCAAoC,EACpC,0BAA0B,EAC1B,yBAAyB,EACzB,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAS5B,8BAA8B;AAC9B,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,wBAAwB,EACxB,iBAAiB,IAAI,8BAA8B,EACnD,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,6BAA6B,EAC7B,iCAAiC,EACjC,8BAA8B,EAC9B,yBAAyB,EACzB,8BAA8B,EAC9B,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAUjC,6BAA6B;AAC7B,OAAO,EACL,uBAAuB,EACvB,6BAA6B,EAC7B,sBAAsB,EACtB,iBAAiB,IAAI,4BAA4B,EACjD,qBAAqB,EACrB,sBAAsB,EACtB,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E,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAWlD,MAAM,UAAU,oBAAoB;IAClC,OAAO;QACL,IAAI,oBAAoB,EAAE;QAC1B,IAAI,yBAAyB,EAAE;QAC/B,IAAI,uBAAuB,EAAE;QAC7B,IAAI,uBAAuB,EAAE;QAC7B,IAAI,oBAAoB,EAAE;QAC1B,IAAI,sBAAsB,EAAE;QAC5B,IAAI,gBAAgB,EAAE;KACvB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Interface vs Type Detector - Interface vs type alias pattern detection
3
+ *
4
+ * Detects patterns for when to use interface vs type including:
5
+ * - Object shape definitions
6
+ * - Union and intersection types
7
+ * - Extending/implementing patterns
8
+ * - Declaration merging
9
+ * - Mapped types
10
+ *
11
+ * @requirements 18.3 - Interface vs type patterns
12
+ */
13
+ import type { Violation, QuickFix, PatternCategory, Language } from 'driftdetect-core';
14
+ import { RegexDetector } from '../base/regex-detector.js';
15
+ import type { DetectionContext, DetectionResult } from '../base/base-detector.js';
16
+ export type InterfaceVsTypePatternType = 'interface-object' | 'interface-extends' | 'interface-implements' | 'type-union' | 'type-intersection' | 'type-mapped' | 'type-conditional' | 'type-utility' | 'declaration-merging';
17
+ export type InterfaceVsTypeViolationType = 'type-for-object' | 'interface-for-union' | 'inconsistent-usage' | 'unnecessary-type-alias';
18
+ export interface InterfaceVsTypePatternInfo {
19
+ type: InterfaceVsTypePatternType;
20
+ file: string;
21
+ line: number;
22
+ column: number;
23
+ matchedText: string;
24
+ name?: string | undefined;
25
+ context?: string | undefined;
26
+ }
27
+ export interface InterfaceVsTypeViolationInfo {
28
+ type: InterfaceVsTypeViolationType;
29
+ file: string;
30
+ line: number;
31
+ column: number;
32
+ matchedText: string;
33
+ issue: string;
34
+ suggestedFix?: string | undefined;
35
+ severity: 'high' | 'medium' | 'low';
36
+ }
37
+ export interface InterfaceVsTypeAnalysis {
38
+ patterns: InterfaceVsTypePatternInfo[];
39
+ violations: InterfaceVsTypeViolationInfo[];
40
+ interfaceCount: number;
41
+ typeCount: number;
42
+ prefersInterfaces: boolean;
43
+ confidence: number;
44
+ }
45
+ export declare const INTERFACE_OBJECT_PATTERNS: readonly [RegExp, RegExp];
46
+ export declare const INTERFACE_EXTENDS_PATTERNS: readonly [RegExp, RegExp, RegExp];
47
+ export declare const INTERFACE_IMPLEMENTS_PATTERNS: readonly [RegExp, RegExp];
48
+ export declare const TYPE_UNION_PATTERNS: readonly [RegExp, RegExp];
49
+ export declare const TYPE_INTERSECTION_PATTERNS: readonly [RegExp, RegExp];
50
+ export declare const TYPE_MAPPED_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp];
51
+ export declare const TYPE_CONDITIONAL_PATTERNS: readonly [RegExp, RegExp, RegExp];
52
+ export declare const TYPE_UTILITY_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
53
+ export declare const DECLARATION_MERGING_PATTERNS: readonly [RegExp, RegExp];
54
+ export declare const TYPE_FOR_OBJECT_PATTERNS: readonly [RegExp];
55
+ export declare const INTERFACE_FOR_UNION_PATTERNS: readonly [];
56
+ export declare const UNNECESSARY_TYPE_ALIAS_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp];
57
+ export declare function shouldExcludeFile(filePath: string): boolean;
58
+ export declare function detectInterfaceObject(content: string, filePath: string): InterfaceVsTypePatternInfo[];
59
+ export declare function detectInterfaceExtends(content: string, filePath: string): InterfaceVsTypePatternInfo[];
60
+ export declare function detectInterfaceImplements(content: string, filePath: string): InterfaceVsTypePatternInfo[];
61
+ export declare function detectTypeUnion(content: string, filePath: string): InterfaceVsTypePatternInfo[];
62
+ export declare function detectTypeIntersection(content: string, filePath: string): InterfaceVsTypePatternInfo[];
63
+ export declare function detectTypeMapped(content: string, filePath: string): InterfaceVsTypePatternInfo[];
64
+ export declare function detectTypeConditional(content: string, filePath: string): InterfaceVsTypePatternInfo[];
65
+ export declare function detectTypeUtility(content: string, filePath: string): InterfaceVsTypePatternInfo[];
66
+ export declare function detectDeclarationMerging(content: string, filePath: string): InterfaceVsTypePatternInfo[];
67
+ export declare function detectTypeForObjectViolations(content: string, filePath: string): InterfaceVsTypeViolationInfo[];
68
+ export declare function detectUnnecessaryTypeAliasViolations(content: string, filePath: string): InterfaceVsTypeViolationInfo[];
69
+ export declare function analyzeInterfaceVsType(content: string, filePath: string): InterfaceVsTypeAnalysis;
70
+ export declare class InterfaceVsTypeDetector extends RegexDetector {
71
+ readonly id = "types/interface-vs-type";
72
+ readonly name = "Interface vs Type Detector";
73
+ readonly description = "Detects interface vs type alias usage patterns";
74
+ readonly category: PatternCategory;
75
+ readonly subcategory = "interface-vs-type";
76
+ readonly supportedLanguages: Language[];
77
+ detect(context: DetectionContext): Promise<DetectionResult>;
78
+ generateQuickFix(_violation: Violation): QuickFix | null;
79
+ }
80
+ export declare function createInterfaceVsTypeDetector(): InterfaceVsTypeDetector;
81
+ //# sourceMappingURL=interface-vs-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface-vs-type.d.ts","sourceRoot":"","sources":["../../src/types/interface-vs-type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAMlF,MAAM,MAAM,0BAA0B,GAClC,kBAAkB,GAClB,mBAAmB,GACnB,sBAAsB,GACtB,YAAY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,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,4BAA4B,EAAE,CA6BhC;AAED,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,4BAA4B,EAAE,CAyBhC;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,uBAAuB,CAgDzB;AAMD,qBAAa,uBAAwB,SAAQ,aAAa;IACxD,QAAQ,CAAC,EAAE,6BAA6B;IACxC,QAAQ,CAAC,IAAI,gCAAgC;IAC7C,QAAQ,CAAC,WAAW,oDAC+B;IACnD,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAW;IAC7C,QAAQ,CAAC,WAAW,uBAAuB;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,QAAQ,EAAE,CAAkB;IAEnD,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAsBjE,gBAAgB,CAAC,UAAU,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI;CAGzD;AAED,wBAAgB,6BAA6B,IAAI,uBAAuB,CAEvE"}
@@ -0,0 +1,440 @@
1
+ /**
2
+ * Interface vs Type Detector - Interface vs type alias pattern detection
3
+ *
4
+ * Detects patterns for when to use interface vs type including:
5
+ * - Object shape definitions
6
+ * - Union and intersection types
7
+ * - Extending/implementing patterns
8
+ * - Declaration merging
9
+ * - Mapped types
10
+ *
11
+ * @requirements 18.3 - Interface vs type patterns
12
+ */
13
+ import { RegexDetector } from '../base/regex-detector.js';
14
+ // ============================================================================
15
+ // Constants
16
+ // ============================================================================
17
+ export const INTERFACE_OBJECT_PATTERNS = [
18
+ /interface\s+(\w+)\s*\{/g,
19
+ /interface\s+(\w+)\s*<[^>]+>\s*\{/g,
20
+ ];
21
+ export const INTERFACE_EXTENDS_PATTERNS = [
22
+ /interface\s+(\w+)\s+extends\s+\w+/g,
23
+ /interface\s+(\w+)\s*<[^>]+>\s+extends\s+\w+/g,
24
+ /interface\s+(\w+)\s+extends\s+\w+(?:\s*,\s*\w+)+/g,
25
+ ];
26
+ export const INTERFACE_IMPLEMENTS_PATTERNS = [
27
+ /class\s+\w+\s+implements\s+(\w+)/g,
28
+ /class\s+\w+\s+extends\s+\w+\s+implements\s+(\w+)/g,
29
+ ];
30
+ export const TYPE_UNION_PATTERNS = [
31
+ /type\s+(\w+)\s*=\s*[^|]+\s*\|/g,
32
+ /type\s+(\w+)\s*=\s*\|/g,
33
+ ];
34
+ export const TYPE_INTERSECTION_PATTERNS = [
35
+ /type\s+(\w+)\s*=\s*[^&]+\s*&/g,
36
+ /type\s+(\w+)\s*=\s*\w+\s*&\s*\w+/g,
37
+ ];
38
+ export const TYPE_MAPPED_PATTERNS = [
39
+ /type\s+(\w+)\s*=\s*\{\s*\[/g,
40
+ /type\s+(\w+)\s*<[^>]+>\s*=\s*\{\s*\[/g,
41
+ /\[\s*\w+\s+in\s+keyof\s+\w+\s*\]/g,
42
+ /\[\s*\w+\s+in\s+\w+\s*\]/g,
43
+ ];
44
+ export const TYPE_CONDITIONAL_PATTERNS = [
45
+ /type\s+(\w+)\s*=\s*[^?]+\s+extends\s+[^?]+\s*\?/g,
46
+ /type\s+(\w+)\s*<[^>]+>\s*=\s*\w+\s+extends\s+\w+\s*\?/g,
47
+ /\w+\s+extends\s+\w+\s*\?\s*\w+\s*:\s*\w+/g,
48
+ ];
49
+ export const TYPE_UTILITY_PATTERNS = [
50
+ /type\s+(\w+)\s*=\s*Partial</g,
51
+ /type\s+(\w+)\s*=\s*Required</g,
52
+ /type\s+(\w+)\s*=\s*Readonly</g,
53
+ /type\s+(\w+)\s*=\s*Pick</g,
54
+ /type\s+(\w+)\s*=\s*Omit</g,
55
+ /type\s+(\w+)\s*=\s*Record</g,
56
+ /type\s+(\w+)\s*=\s*Exclude</g,
57
+ /type\s+(\w+)\s*=\s*Extract</g,
58
+ /type\s+(\w+)\s*=\s*NonNullable</g,
59
+ /type\s+(\w+)\s*=\s*ReturnType</g,
60
+ /type\s+(\w+)\s*=\s*Parameters</g,
61
+ /type\s+(\w+)\s*=\s*InstanceType</g,
62
+ /type\s+(\w+)\s*=\s*Awaited</g,
63
+ ];
64
+ export const DECLARATION_MERGING_PATTERNS = [
65
+ /interface\s+(\w+)\s*\{[\s\S]*?\}\s*interface\s+\1\s*\{/g,
66
+ /declare\s+module\s+['"`]\w+['"`]\s*\{[\s\S]*?interface\s+\w+/g,
67
+ ];
68
+ export const TYPE_FOR_OBJECT_PATTERNS = [
69
+ /type\s+(\w+)\s*=\s*\{\s*\w+\s*:/g, // Simple object type
70
+ ];
71
+ export const INTERFACE_FOR_UNION_PATTERNS = [
72
+ // This is actually not possible in TypeScript, but we detect attempts
73
+ ];
74
+ export const UNNECESSARY_TYPE_ALIAS_PATTERNS = [
75
+ /type\s+(\w+)\s*=\s*string\s*;/g,
76
+ /type\s+(\w+)\s*=\s*number\s*;/g,
77
+ /type\s+(\w+)\s*=\s*boolean\s*;/g,
78
+ /type\s+(\w+)\s*=\s*null\s*;/g,
79
+ /type\s+(\w+)\s*=\s*undefined\s*;/g,
80
+ ];
81
+ // ============================================================================
82
+ // Analysis Functions
83
+ // ============================================================================
84
+ export function shouldExcludeFile(filePath) {
85
+ const excludePatterns = [
86
+ /\.test\.[jt]sx?$/,
87
+ /\.spec\.[jt]sx?$/,
88
+ /__tests__\//,
89
+ /node_modules\//,
90
+ /\.min\.[jt]s$/,
91
+ ];
92
+ return excludePatterns.some((p) => p.test(filePath));
93
+ }
94
+ export function detectInterfaceObject(content, filePath) {
95
+ const results = [];
96
+ const lines = content.split('\n');
97
+ for (let i = 0; i < lines.length; i++) {
98
+ const line = lines[i];
99
+ for (const pattern of INTERFACE_OBJECT_PATTERNS) {
100
+ const regex = new RegExp(pattern.source, pattern.flags);
101
+ let match;
102
+ while ((match = regex.exec(line)) !== null) {
103
+ results.push({
104
+ type: 'interface-object',
105
+ file: filePath,
106
+ line: i + 1,
107
+ column: match.index + 1,
108
+ matchedText: match[0],
109
+ name: match[1],
110
+ context: line.trim(),
111
+ });
112
+ }
113
+ }
114
+ }
115
+ return results;
116
+ }
117
+ export function detectInterfaceExtends(content, filePath) {
118
+ const results = [];
119
+ const lines = content.split('\n');
120
+ for (let i = 0; i < lines.length; i++) {
121
+ const line = lines[i];
122
+ for (const pattern of INTERFACE_EXTENDS_PATTERNS) {
123
+ const regex = new RegExp(pattern.source, pattern.flags);
124
+ let match;
125
+ while ((match = regex.exec(line)) !== null) {
126
+ results.push({
127
+ type: 'interface-extends',
128
+ file: filePath,
129
+ line: i + 1,
130
+ column: match.index + 1,
131
+ matchedText: match[0],
132
+ name: match[1],
133
+ context: line.trim(),
134
+ });
135
+ }
136
+ }
137
+ }
138
+ return results;
139
+ }
140
+ export function detectInterfaceImplements(content, filePath) {
141
+ const results = [];
142
+ const lines = content.split('\n');
143
+ for (let i = 0; i < lines.length; i++) {
144
+ const line = lines[i];
145
+ for (const pattern of INTERFACE_IMPLEMENTS_PATTERNS) {
146
+ const regex = new RegExp(pattern.source, pattern.flags);
147
+ let match;
148
+ while ((match = regex.exec(line)) !== null) {
149
+ results.push({
150
+ type: 'interface-implements',
151
+ file: filePath,
152
+ line: i + 1,
153
+ column: match.index + 1,
154
+ matchedText: match[0],
155
+ name: match[1],
156
+ context: line.trim(),
157
+ });
158
+ }
159
+ }
160
+ }
161
+ return results;
162
+ }
163
+ export function detectTypeUnion(content, filePath) {
164
+ const results = [];
165
+ const lines = content.split('\n');
166
+ for (let i = 0; i < lines.length; i++) {
167
+ const line = lines[i];
168
+ for (const pattern of TYPE_UNION_PATTERNS) {
169
+ const regex = new RegExp(pattern.source, pattern.flags);
170
+ let match;
171
+ while ((match = regex.exec(line)) !== null) {
172
+ results.push({
173
+ type: 'type-union',
174
+ file: filePath,
175
+ line: i + 1,
176
+ column: match.index + 1,
177
+ matchedText: match[0],
178
+ name: match[1],
179
+ context: line.trim(),
180
+ });
181
+ }
182
+ }
183
+ }
184
+ return results;
185
+ }
186
+ export function detectTypeIntersection(content, filePath) {
187
+ const results = [];
188
+ const lines = content.split('\n');
189
+ for (let i = 0; i < lines.length; i++) {
190
+ const line = lines[i];
191
+ for (const pattern of TYPE_INTERSECTION_PATTERNS) {
192
+ const regex = new RegExp(pattern.source, pattern.flags);
193
+ let match;
194
+ while ((match = regex.exec(line)) !== null) {
195
+ results.push({
196
+ type: 'type-intersection',
197
+ file: filePath,
198
+ line: i + 1,
199
+ column: match.index + 1,
200
+ matchedText: match[0],
201
+ name: match[1],
202
+ context: line.trim(),
203
+ });
204
+ }
205
+ }
206
+ }
207
+ return results;
208
+ }
209
+ export function detectTypeMapped(content, filePath) {
210
+ const results = [];
211
+ const lines = content.split('\n');
212
+ for (let i = 0; i < lines.length; i++) {
213
+ const line = lines[i];
214
+ for (const pattern of TYPE_MAPPED_PATTERNS) {
215
+ const regex = new RegExp(pattern.source, pattern.flags);
216
+ let match;
217
+ while ((match = regex.exec(line)) !== null) {
218
+ results.push({
219
+ type: 'type-mapped',
220
+ file: filePath,
221
+ line: i + 1,
222
+ column: match.index + 1,
223
+ matchedText: match[0],
224
+ name: match[1],
225
+ context: line.trim(),
226
+ });
227
+ }
228
+ }
229
+ }
230
+ return results;
231
+ }
232
+ export function detectTypeConditional(content, filePath) {
233
+ const results = [];
234
+ const lines = content.split('\n');
235
+ for (let i = 0; i < lines.length; i++) {
236
+ const line = lines[i];
237
+ for (const pattern of TYPE_CONDITIONAL_PATTERNS) {
238
+ const regex = new RegExp(pattern.source, pattern.flags);
239
+ let match;
240
+ while ((match = regex.exec(line)) !== null) {
241
+ results.push({
242
+ type: 'type-conditional',
243
+ file: filePath,
244
+ line: i + 1,
245
+ column: match.index + 1,
246
+ matchedText: match[0],
247
+ name: match[1],
248
+ context: line.trim(),
249
+ });
250
+ }
251
+ }
252
+ }
253
+ return results;
254
+ }
255
+ export function detectTypeUtility(content, filePath) {
256
+ const results = [];
257
+ const lines = content.split('\n');
258
+ for (let i = 0; i < lines.length; i++) {
259
+ const line = lines[i];
260
+ for (const pattern of TYPE_UTILITY_PATTERNS) {
261
+ const regex = new RegExp(pattern.source, pattern.flags);
262
+ let match;
263
+ while ((match = regex.exec(line)) !== null) {
264
+ results.push({
265
+ type: 'type-utility',
266
+ file: filePath,
267
+ line: i + 1,
268
+ column: match.index + 1,
269
+ matchedText: match[0],
270
+ name: match[1],
271
+ context: line.trim(),
272
+ });
273
+ }
274
+ }
275
+ }
276
+ return results;
277
+ }
278
+ export function detectDeclarationMerging(content, filePath) {
279
+ const results = [];
280
+ // Check for multiple interfaces with same name
281
+ const interfaceNames = new Map();
282
+ const lines = content.split('\n');
283
+ for (let i = 0; i < lines.length; i++) {
284
+ const line = lines[i];
285
+ const match = line.match(/interface\s+(\w+)\s*(?:<[^>]+>)?\s*(?:extends|{)/);
286
+ if (match) {
287
+ const name = match[1];
288
+ if (!interfaceNames.has(name)) {
289
+ interfaceNames.set(name, []);
290
+ }
291
+ interfaceNames.get(name).push(i + 1);
292
+ }
293
+ }
294
+ for (const [name, lineNumbers] of interfaceNames) {
295
+ if (lineNumbers.length > 1) {
296
+ results.push({
297
+ type: 'declaration-merging',
298
+ file: filePath,
299
+ line: lineNumbers[0],
300
+ column: 1,
301
+ matchedText: `interface ${name}`,
302
+ name,
303
+ context: `Declared ${lineNumbers.length} times at lines: ${lineNumbers.join(', ')}`,
304
+ });
305
+ }
306
+ }
307
+ return results;
308
+ }
309
+ export function detectTypeForObjectViolations(content, filePath) {
310
+ const results = [];
311
+ const lines = content.split('\n');
312
+ for (let i = 0; i < lines.length; i++) {
313
+ const line = lines[i];
314
+ for (const pattern of TYPE_FOR_OBJECT_PATTERNS) {
315
+ const regex = new RegExp(pattern.source, pattern.flags);
316
+ let match;
317
+ while ((match = regex.exec(line)) !== null) {
318
+ // Check if it's a simple object (not union, intersection, mapped, etc.)
319
+ const fullLine = line + (lines[i + 1] || '');
320
+ if (!/[|&\[]/.test(fullLine.slice(match.index))) {
321
+ results.push({
322
+ type: 'type-for-object',
323
+ file: filePath,
324
+ line: i + 1,
325
+ column: match.index + 1,
326
+ matchedText: match[0],
327
+ issue: 'Consider using interface for object shapes',
328
+ suggestedFix: 'Use interface instead of type for better extensibility',
329
+ severity: 'low',
330
+ });
331
+ }
332
+ }
333
+ }
334
+ }
335
+ return results;
336
+ }
337
+ export function detectUnnecessaryTypeAliasViolations(content, filePath) {
338
+ const results = [];
339
+ const lines = content.split('\n');
340
+ for (let i = 0; i < lines.length; i++) {
341
+ const line = lines[i];
342
+ for (const pattern of UNNECESSARY_TYPE_ALIAS_PATTERNS) {
343
+ const regex = new RegExp(pattern.source, pattern.flags);
344
+ let match;
345
+ while ((match = regex.exec(line)) !== null) {
346
+ results.push({
347
+ type: 'unnecessary-type-alias',
348
+ file: filePath,
349
+ line: i + 1,
350
+ column: match.index + 1,
351
+ matchedText: match[0],
352
+ issue: 'Unnecessary type alias for primitive type',
353
+ suggestedFix: 'Use the primitive type directly or add semantic meaning',
354
+ severity: 'low',
355
+ });
356
+ }
357
+ }
358
+ }
359
+ return results;
360
+ }
361
+ export function analyzeInterfaceVsType(content, filePath) {
362
+ if (shouldExcludeFile(filePath)) {
363
+ return {
364
+ patterns: [],
365
+ violations: [],
366
+ interfaceCount: 0,
367
+ typeCount: 0,
368
+ prefersInterfaces: false,
369
+ confidence: 1.0,
370
+ };
371
+ }
372
+ const patterns = [
373
+ ...detectInterfaceObject(content, filePath),
374
+ ...detectInterfaceExtends(content, filePath),
375
+ ...detectInterfaceImplements(content, filePath),
376
+ ...detectTypeUnion(content, filePath),
377
+ ...detectTypeIntersection(content, filePath),
378
+ ...detectTypeMapped(content, filePath),
379
+ ...detectTypeConditional(content, filePath),
380
+ ...detectTypeUtility(content, filePath),
381
+ ...detectDeclarationMerging(content, filePath),
382
+ ];
383
+ const violations = [
384
+ ...detectTypeForObjectViolations(content, filePath),
385
+ ...detectUnnecessaryTypeAliasViolations(content, filePath),
386
+ ];
387
+ const interfaceCount = patterns.filter((p) => p.type.startsWith('interface-')).length;
388
+ const typeCount = patterns.filter((p) => p.type.startsWith('type-')).length;
389
+ const prefersInterfaces = interfaceCount > typeCount;
390
+ let confidence = 0.7;
391
+ if (patterns.length > 0)
392
+ confidence += 0.15;
393
+ if (violations.length === 0)
394
+ confidence += 0.1;
395
+ confidence = Math.min(confidence, 0.95);
396
+ return {
397
+ patterns,
398
+ violations,
399
+ interfaceCount,
400
+ typeCount,
401
+ prefersInterfaces,
402
+ confidence,
403
+ };
404
+ }
405
+ // ============================================================================
406
+ // Detector Class
407
+ // ============================================================================
408
+ export class InterfaceVsTypeDetector extends RegexDetector {
409
+ id = 'types/interface-vs-type';
410
+ name = 'Interface vs Type Detector';
411
+ description = 'Detects interface vs type alias usage patterns';
412
+ category = 'types';
413
+ subcategory = 'interface-vs-type';
414
+ supportedLanguages = ['typescript'];
415
+ async detect(context) {
416
+ if (!this.supportsLanguage(context.language)) {
417
+ return this.createEmptyResult();
418
+ }
419
+ const analysis = analyzeInterfaceVsType(context.content, context.file);
420
+ if (analysis.patterns.length === 0 && analysis.violations.length === 0) {
421
+ return this.createEmptyResult();
422
+ }
423
+ return this.createResult([], [], analysis.confidence, {
424
+ custom: {
425
+ patterns: analysis.patterns,
426
+ violations: analysis.violations,
427
+ interfaceCount: analysis.interfaceCount,
428
+ typeCount: analysis.typeCount,
429
+ prefersInterfaces: analysis.prefersInterfaces,
430
+ },
431
+ });
432
+ }
433
+ generateQuickFix(_violation) {
434
+ return null;
435
+ }
436
+ }
437
+ export function createInterfaceVsTypeDetector() {
438
+ return new InterfaceVsTypeDetector();
439
+ }
440
+ //# sourceMappingURL=interface-vs-type.js.map