@memberjunction/react-linter 0.0.1 → 5.38.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 (330) hide show
  1. package/dist/component-linter.d.ts +77 -0
  2. package/dist/component-linter.d.ts.map +1 -0
  3. package/dist/component-linter.js +1206 -0
  4. package/dist/component-linter.js.map +1 -0
  5. package/dist/control-flow-analyzer.d.ts +184 -0
  6. package/dist/control-flow-analyzer.d.ts.map +1 -0
  7. package/dist/control-flow-analyzer.js +798 -0
  8. package/dist/control-flow-analyzer.js.map +1 -0
  9. package/dist/index.d.ts +6 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +8 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/library-lint-cache.d.ts +50 -0
  14. package/dist/library-lint-cache.d.ts.map +1 -0
  15. package/dist/library-lint-cache.js +173 -0
  16. package/dist/library-lint-cache.js.map +1 -0
  17. package/dist/lint-rule.d.ts +70 -0
  18. package/dist/lint-rule.d.ts.map +1 -0
  19. package/dist/lint-rule.js +30 -0
  20. package/dist/lint-rule.js.map +1 -0
  21. package/dist/lint-utils.d.ts +131 -0
  22. package/dist/lint-utils.d.ts.map +1 -0
  23. package/dist/lint-utils.js +358 -0
  24. package/dist/lint-utils.js.map +1 -0
  25. package/dist/linter-options.d.ts +51 -0
  26. package/dist/linter-options.d.ts.map +1 -0
  27. package/dist/linter-options.js +2 -0
  28. package/dist/linter-options.js.map +1 -0
  29. package/dist/prop-value-extractor.d.ts +147 -0
  30. package/dist/prop-value-extractor.d.ts.map +1 -0
  31. package/dist/prop-value-extractor.js +472 -0
  32. package/dist/prop-value-extractor.js.map +1 -0
  33. package/dist/runtime-rules/ai-tools-availability-check.d.ts +9 -0
  34. package/dist/runtime-rules/ai-tools-availability-check.d.ts.map +1 -0
  35. package/dist/runtime-rules/ai-tools-availability-check.js +223 -0
  36. package/dist/runtime-rules/ai-tools-availability-check.js.map +1 -0
  37. package/dist/runtime-rules/callback-event-validation.d.ts +22 -0
  38. package/dist/runtime-rules/callback-event-validation.d.ts.map +1 -0
  39. package/dist/runtime-rules/callback-event-validation.js +561 -0
  40. package/dist/runtime-rules/callback-event-validation.js.map +1 -0
  41. package/dist/runtime-rules/chart-field-validation.d.ts +10 -0
  42. package/dist/runtime-rules/chart-field-validation.d.ts.map +1 -0
  43. package/dist/runtime-rules/chart-field-validation.js +270 -0
  44. package/dist/runtime-rules/chart-field-validation.js.map +1 -0
  45. package/dist/runtime-rules/child-component-prop-validation.d.ts +11 -0
  46. package/dist/runtime-rules/child-component-prop-validation.d.ts.map +1 -0
  47. package/dist/runtime-rules/child-component-prop-validation.js +443 -0
  48. package/dist/runtime-rules/child-component-prop-validation.js.map +1 -0
  49. package/dist/runtime-rules/component-name-mismatch.d.ts +19 -0
  50. package/dist/runtime-rules/component-name-mismatch.d.ts.map +1 -0
  51. package/dist/runtime-rules/component-name-mismatch.js +82 -0
  52. package/dist/runtime-rules/component-name-mismatch.js.map +1 -0
  53. package/dist/runtime-rules/component-not-in-dependencies.d.ts +20 -0
  54. package/dist/runtime-rules/component-not-in-dependencies.d.ts.map +1 -0
  55. package/dist/runtime-rules/component-not-in-dependencies.js +92 -0
  56. package/dist/runtime-rules/component-not-in-dependencies.js.map +1 -0
  57. package/dist/runtime-rules/component-props-validation.d.ts +25 -0
  58. package/dist/runtime-rules/component-props-validation.d.ts.map +1 -0
  59. package/dist/runtime-rules/component-props-validation.js +228 -0
  60. package/dist/runtime-rules/component-props-validation.js.map +1 -0
  61. package/dist/runtime-rules/component-usage-without-destructuring.d.ts +20 -0
  62. package/dist/runtime-rules/component-usage-without-destructuring.d.ts.map +1 -0
  63. package/dist/runtime-rules/component-usage-without-destructuring.js +124 -0
  64. package/dist/runtime-rules/component-usage-without-destructuring.js.map +1 -0
  65. package/dist/runtime-rules/data-result-validation.d.ts +9 -0
  66. package/dist/runtime-rules/data-result-validation.d.ts.map +1 -0
  67. package/dist/runtime-rules/data-result-validation.js +763 -0
  68. package/dist/runtime-rules/data-result-validation.js.map +1 -0
  69. package/dist/runtime-rules/datagrid-field-validation.d.ts +10 -0
  70. package/dist/runtime-rules/datagrid-field-validation.d.ts.map +1 -0
  71. package/dist/runtime-rules/datagrid-field-validation.js +249 -0
  72. package/dist/runtime-rules/datagrid-field-validation.js.map +1 -0
  73. package/dist/runtime-rules/dependency-shadowing.d.ts +20 -0
  74. package/dist/runtime-rules/dependency-shadowing.d.ts.map +1 -0
  75. package/dist/runtime-rules/dependency-shadowing.js +147 -0
  76. package/dist/runtime-rules/dependency-shadowing.js.map +1 -0
  77. package/dist/runtime-rules/entity-field-access-validation.d.ts +12 -0
  78. package/dist/runtime-rules/entity-field-access-validation.d.ts.map +1 -0
  79. package/dist/runtime-rules/entity-field-access-validation.js +304 -0
  80. package/dist/runtime-rules/entity-field-access-validation.js.map +1 -0
  81. package/dist/runtime-rules/event-parameter-validation.d.ts +22 -0
  82. package/dist/runtime-rules/event-parameter-validation.d.ts.map +1 -0
  83. package/dist/runtime-rules/event-parameter-validation.js +406 -0
  84. package/dist/runtime-rules/event-parameter-validation.js.map +1 -0
  85. package/dist/runtime-rules/index.d.ts +61 -0
  86. package/dist/runtime-rules/index.d.ts.map +1 -0
  87. package/dist/runtime-rules/index.js +62 -0
  88. package/dist/runtime-rules/index.js.map +1 -0
  89. package/dist/runtime-rules/library-variable-names.d.ts +24 -0
  90. package/dist/runtime-rules/library-variable-names.d.ts.map +1 -0
  91. package/dist/runtime-rules/library-variable-names.js +88 -0
  92. package/dist/runtime-rules/library-variable-names.js.map +1 -0
  93. package/dist/runtime-rules/no-child-implementation.d.ts +18 -0
  94. package/dist/runtime-rules/no-child-implementation.d.ts.map +1 -0
  95. package/dist/runtime-rules/no-child-implementation.js +57 -0
  96. package/dist/runtime-rules/no-child-implementation.js.map +1 -0
  97. package/dist/runtime-rules/no-data-prop.d.ts +22 -0
  98. package/dist/runtime-rules/no-data-prop.d.ts.map +1 -0
  99. package/dist/runtime-rules/no-data-prop.js +111 -0
  100. package/dist/runtime-rules/no-data-prop.js.map +1 -0
  101. package/dist/runtime-rules/no-export-statements.d.ts +18 -0
  102. package/dist/runtime-rules/no-export-statements.d.ts.map +1 -0
  103. package/dist/runtime-rules/no-export-statements.js +143 -0
  104. package/dist/runtime-rules/no-export-statements.js.map +1 -0
  105. package/dist/runtime-rules/no-iife-wrapper.d.ts +18 -0
  106. package/dist/runtime-rules/no-iife-wrapper.d.ts.map +1 -0
  107. package/dist/runtime-rules/no-iife-wrapper.js +217 -0
  108. package/dist/runtime-rules/no-iife-wrapper.js.map +1 -0
  109. package/dist/runtime-rules/no-import-statements.d.ts +18 -0
  110. package/dist/runtime-rules/no-import-statements.d.ts.map +1 -0
  111. package/dist/runtime-rules/no-import-statements.js +65 -0
  112. package/dist/runtime-rules/no-import-statements.js.map +1 -0
  113. package/dist/runtime-rules/no-react-destructuring.d.ts +18 -0
  114. package/dist/runtime-rules/no-react-destructuring.d.ts.map +1 -0
  115. package/dist/runtime-rules/no-react-destructuring.js +60 -0
  116. package/dist/runtime-rules/no-react-destructuring.js.map +1 -0
  117. package/dist/runtime-rules/no-require-statements.d.ts +18 -0
  118. package/dist/runtime-rules/no-require-statements.d.ts.map +1 -0
  119. package/dist/runtime-rules/no-require-statements.js +109 -0
  120. package/dist/runtime-rules/no-require-statements.js.map +1 -0
  121. package/dist/runtime-rules/no-return-component.d.ts +18 -0
  122. package/dist/runtime-rules/no-return-component.d.ts.map +1 -0
  123. package/dist/runtime-rules/no-return-component.js +106 -0
  124. package/dist/runtime-rules/no-return-component.js.map +1 -0
  125. package/dist/runtime-rules/no-unwrap-utility-libs.d.ts +20 -0
  126. package/dist/runtime-rules/no-unwrap-utility-libs.d.ts.map +1 -0
  127. package/dist/runtime-rules/no-unwrap-utility-libs.js +75 -0
  128. package/dist/runtime-rules/no-unwrap-utility-libs.js.map +1 -0
  129. package/dist/runtime-rules/no-use-reducer.d.ts +19 -0
  130. package/dist/runtime-rules/no-use-reducer.d.ts.map +1 -0
  131. package/dist/runtime-rules/no-use-reducer.js +78 -0
  132. package/dist/runtime-rules/no-use-reducer.js.map +1 -0
  133. package/dist/runtime-rules/no-window-access.d.ts +23 -0
  134. package/dist/runtime-rules/no-window-access.d.ts.map +1 -0
  135. package/dist/runtime-rules/no-window-access.js +136 -0
  136. package/dist/runtime-rules/no-window-access.js.map +1 -0
  137. package/dist/runtime-rules/noisy-settings-updates.d.ts +18 -0
  138. package/dist/runtime-rules/noisy-settings-updates.d.ts.map +1 -0
  139. package/dist/runtime-rules/noisy-settings-updates.js +110 -0
  140. package/dist/runtime-rules/noisy-settings-updates.js.map +1 -0
  141. package/dist/runtime-rules/overflow-hidden-on-layout-container.d.ts +30 -0
  142. package/dist/runtime-rules/overflow-hidden-on-layout-container.d.ts.map +1 -0
  143. package/dist/runtime-rules/overflow-hidden-on-layout-container.js +220 -0
  144. package/dist/runtime-rules/overflow-hidden-on-layout-container.js.map +1 -0
  145. package/dist/runtime-rules/pass-standard-props.d.ts +19 -0
  146. package/dist/runtime-rules/pass-standard-props.d.ts.map +1 -0
  147. package/dist/runtime-rules/pass-standard-props.js +82 -0
  148. package/dist/runtime-rules/pass-standard-props.js.map +1 -0
  149. package/dist/runtime-rules/prefer-async-await.d.ts +17 -0
  150. package/dist/runtime-rules/prefer-async-await.d.ts.map +1 -0
  151. package/dist/runtime-rules/prefer-async-await.js +52 -0
  152. package/dist/runtime-rules/prefer-async-await.js.map +1 -0
  153. package/dist/runtime-rules/prefer-jsx-syntax.d.ts +17 -0
  154. package/dist/runtime-rules/prefer-jsx-syntax.d.ts.map +1 -0
  155. package/dist/runtime-rules/prefer-jsx-syntax.js +51 -0
  156. package/dist/runtime-rules/prefer-jsx-syntax.js.map +1 -0
  157. package/dist/runtime-rules/prop-state-sync.d.ts +19 -0
  158. package/dist/runtime-rules/prop-state-sync.d.ts.map +1 -0
  159. package/dist/runtime-rules/prop-state-sync.js +76 -0
  160. package/dist/runtime-rules/prop-state-sync.js.map +1 -0
  161. package/dist/runtime-rules/property-name-consistency.d.ts +20 -0
  162. package/dist/runtime-rules/property-name-consistency.d.ts.map +1 -0
  163. package/dist/runtime-rules/property-name-consistency.js +172 -0
  164. package/dist/runtime-rules/property-name-consistency.js.map +1 -0
  165. package/dist/runtime-rules/query-result-field-access-validation.d.ts +10 -0
  166. package/dist/runtime-rules/query-result-field-access-validation.d.ts.map +1 -0
  167. package/dist/runtime-rules/query-result-field-access-validation.js +304 -0
  168. package/dist/runtime-rules/query-result-field-access-validation.js.map +1 -0
  169. package/dist/runtime-rules/react-component-naming.d.ts +19 -0
  170. package/dist/runtime-rules/react-component-naming.d.ts.map +1 -0
  171. package/dist/runtime-rules/react-component-naming.js +72 -0
  172. package/dist/runtime-rules/react-component-naming.js.map +1 -0
  173. package/dist/runtime-rules/react-hooks-rules.d.ts +27 -0
  174. package/dist/runtime-rules/react-hooks-rules.d.ts.map +1 -0
  175. package/dist/runtime-rules/react-hooks-rules.js +223 -0
  176. package/dist/runtime-rules/react-hooks-rules.js.map +1 -0
  177. package/dist/runtime-rules/required-queries-not-called.d.ts +19 -0
  178. package/dist/runtime-rules/required-queries-not-called.d.ts.map +1 -0
  179. package/dist/runtime-rules/required-queries-not-called.js +146 -0
  180. package/dist/runtime-rules/required-queries-not-called.js.map +1 -0
  181. package/dist/runtime-rules/runquery-call-validation.d.ts +11 -0
  182. package/dist/runtime-rules/runquery-call-validation.d.ts.map +1 -0
  183. package/dist/runtime-rules/runquery-call-validation.js +886 -0
  184. package/dist/runtime-rules/runquery-call-validation.js.map +1 -0
  185. package/dist/runtime-rules/runview-call-validation.d.ts +10 -0
  186. package/dist/runtime-rules/runview-call-validation.d.ts.map +1 -0
  187. package/dist/runtime-rules/runview-call-validation.js +336 -0
  188. package/dist/runtime-rules/runview-call-validation.js.map +1 -0
  189. package/dist/runtime-rules/saved-user-settings-pattern.d.ts +19 -0
  190. package/dist/runtime-rules/saved-user-settings-pattern.d.ts.map +1 -0
  191. package/dist/runtime-rules/saved-user-settings-pattern.js +90 -0
  192. package/dist/runtime-rules/saved-user-settings-pattern.js.map +1 -0
  193. package/dist/runtime-rules/search-availability-check.d.ts +9 -0
  194. package/dist/runtime-rules/search-availability-check.d.ts.map +1 -0
  195. package/dist/runtime-rules/search-availability-check.js +220 -0
  196. package/dist/runtime-rules/search-availability-check.js.map +1 -0
  197. package/dist/runtime-rules/search-call-validation.d.ts +9 -0
  198. package/dist/runtime-rules/search-call-validation.d.ts.map +1 -0
  199. package/dist/runtime-rules/search-call-validation.js +336 -0
  200. package/dist/runtime-rules/search-call-validation.js.map +1 -0
  201. package/dist/runtime-rules/server-reload-on-client-operation.d.ts +18 -0
  202. package/dist/runtime-rules/server-reload-on-client-operation.d.ts.map +1 -0
  203. package/dist/runtime-rules/server-reload-on-client-operation.js +107 -0
  204. package/dist/runtime-rules/server-reload-on-client-operation.js.map +1 -0
  205. package/dist/runtime-rules/single-function-only.d.ts +18 -0
  206. package/dist/runtime-rules/single-function-only.d.ts.map +1 -0
  207. package/dist/runtime-rules/single-function-only.js +103 -0
  208. package/dist/runtime-rules/single-function-only.js.map +1 -0
  209. package/dist/runtime-rules/string-replace-all-occurrences.d.ts +19 -0
  210. package/dist/runtime-rules/string-replace-all-occurrences.d.ts.map +1 -0
  211. package/dist/runtime-rules/string-replace-all-occurrences.js +109 -0
  212. package/dist/runtime-rules/string-replace-all-occurrences.js.map +1 -0
  213. package/dist/runtime-rules/string-template-validation.d.ts +22 -0
  214. package/dist/runtime-rules/string-template-validation.d.ts.map +1 -0
  215. package/dist/runtime-rules/string-template-validation.js +163 -0
  216. package/dist/runtime-rules/string-template-validation.js.map +1 -0
  217. package/dist/runtime-rules/styles-validation.d.ts +10 -0
  218. package/dist/runtime-rules/styles-validation.d.ts.map +1 -0
  219. package/dist/runtime-rules/styles-validation.js +153 -0
  220. package/dist/runtime-rules/styles-validation.js.map +1 -0
  221. package/dist/runtime-rules/type-inference-errors.d.ts +23 -0
  222. package/dist/runtime-rules/type-inference-errors.d.ts.map +1 -0
  223. package/dist/runtime-rules/type-inference-errors.js +53 -0
  224. package/dist/runtime-rules/type-inference-errors.js.map +1 -0
  225. package/dist/runtime-rules/type-mismatch-operation.d.ts +23 -0
  226. package/dist/runtime-rules/type-mismatch-operation.d.ts.map +1 -0
  227. package/dist/runtime-rules/type-mismatch-operation.js +145 -0
  228. package/dist/runtime-rules/type-mismatch-operation.js.map +1 -0
  229. package/dist/runtime-rules/undefined-component-usage.d.ts +20 -0
  230. package/dist/runtime-rules/undefined-component-usage.d.ts.map +1 -0
  231. package/dist/runtime-rules/undefined-component-usage.js +138 -0
  232. package/dist/runtime-rules/undefined-component-usage.js.map +1 -0
  233. package/dist/runtime-rules/undefined-jsx-component.d.ts +25 -0
  234. package/dist/runtime-rules/undefined-jsx-component.d.ts.map +1 -0
  235. package/dist/runtime-rules/undefined-jsx-component.js +269 -0
  236. package/dist/runtime-rules/undefined-jsx-component.js.map +1 -0
  237. package/dist/runtime-rules/unsafe-array-operations.d.ts +25 -0
  238. package/dist/runtime-rules/unsafe-array-operations.d.ts.map +1 -0
  239. package/dist/runtime-rules/unsafe-array-operations.js +347 -0
  240. package/dist/runtime-rules/unsafe-array-operations.js.map +1 -0
  241. package/dist/runtime-rules/unsafe-formatting-methods.d.ts +24 -0
  242. package/dist/runtime-rules/unsafe-formatting-methods.d.ts.map +1 -0
  243. package/dist/runtime-rules/unsafe-formatting-methods.js +277 -0
  244. package/dist/runtime-rules/unsafe-formatting-methods.js.map +1 -0
  245. package/dist/runtime-rules/unused-component-dependencies.d.ts +19 -0
  246. package/dist/runtime-rules/unused-component-dependencies.d.ts.map +1 -0
  247. package/dist/runtime-rules/unused-component-dependencies.js +90 -0
  248. package/dist/runtime-rules/unused-component-dependencies.js.map +1 -0
  249. package/dist/runtime-rules/unused-libraries.d.ts +19 -0
  250. package/dist/runtime-rules/unused-libraries.d.ts.map +1 -0
  251. package/dist/runtime-rules/unused-libraries.js +127 -0
  252. package/dist/runtime-rules/unused-libraries.js.map +1 -0
  253. package/dist/runtime-rules/use-function-declaration.d.ts +18 -0
  254. package/dist/runtime-rules/use-function-declaration.d.ts.map +1 -0
  255. package/dist/runtime-rules/use-function-declaration.js +127 -0
  256. package/dist/runtime-rules/use-function-declaration.js.map +1 -0
  257. package/dist/runtime-rules/use-unwrap-components.d.ts +19 -0
  258. package/dist/runtime-rules/use-unwrap-components.d.ts.map +1 -0
  259. package/dist/runtime-rules/use-unwrap-components.js +84 -0
  260. package/dist/runtime-rules/use-unwrap-components.js.map +1 -0
  261. package/dist/runtime-rules/useeffect-unstable-dependencies.d.ts +23 -0
  262. package/dist/runtime-rules/useeffect-unstable-dependencies.d.ts.map +1 -0
  263. package/dist/runtime-rules/useeffect-unstable-dependencies.js +215 -0
  264. package/dist/runtime-rules/useeffect-unstable-dependencies.js.map +1 -0
  265. package/dist/runtime-rules/utilities-api-validation.d.ts +24 -0
  266. package/dist/runtime-rules/utilities-api-validation.d.ts.map +1 -0
  267. package/dist/runtime-rules/utilities-api-validation.js +121 -0
  268. package/dist/runtime-rules/utilities-api-validation.js.map +1 -0
  269. package/dist/runtime-rules/utilities-no-direct-instantiation.d.ts +20 -0
  270. package/dist/runtime-rules/utilities-no-direct-instantiation.d.ts.map +1 -0
  271. package/dist/runtime-rules/utilities-no-direct-instantiation.js +58 -0
  272. package/dist/runtime-rules/utilities-no-direct-instantiation.js.map +1 -0
  273. package/dist/runtime-rules/validate-component-references.d.ts +19 -0
  274. package/dist/runtime-rules/validate-component-references.d.ts.map +1 -0
  275. package/dist/runtime-rules/validate-component-references.js +255 -0
  276. package/dist/runtime-rules/validate-component-references.js.map +1 -0
  277. package/dist/schema-validation/component-prop-rule.d.ts +131 -0
  278. package/dist/schema-validation/component-prop-rule.d.ts.map +1 -0
  279. package/dist/schema-validation/component-prop-rule.js +625 -0
  280. package/dist/schema-validation/component-prop-rule.js.map +1 -0
  281. package/dist/schema-validation/index.d.ts +26 -0
  282. package/dist/schema-validation/index.d.ts.map +1 -0
  283. package/dist/schema-validation/index.js +26 -0
  284. package/dist/schema-validation/index.js.map +1 -0
  285. package/dist/schema-validation/semantic-validators/index.d.ts +23 -0
  286. package/dist/schema-validation/semantic-validators/index.d.ts.map +1 -0
  287. package/dist/schema-validation/semantic-validators/index.js +23 -0
  288. package/dist/schema-validation/semantic-validators/index.js.map +1 -0
  289. package/dist/schema-validation/semantic-validators/required-when-validator.d.ts +43 -0
  290. package/dist/schema-validation/semantic-validators/required-when-validator.d.ts.map +1 -0
  291. package/dist/schema-validation/semantic-validators/required-when-validator.js +94 -0
  292. package/dist/schema-validation/semantic-validators/required-when-validator.js.map +1 -0
  293. package/dist/schema-validation/semantic-validators/semantic-validator-registry.d.ts +122 -0
  294. package/dist/schema-validation/semantic-validators/semantic-validator-registry.d.ts.map +1 -0
  295. package/dist/schema-validation/semantic-validators/semantic-validator-registry.js +166 -0
  296. package/dist/schema-validation/semantic-validators/semantic-validator-registry.js.map +1 -0
  297. package/dist/schema-validation/semantic-validators/semantic-validator.d.ts +260 -0
  298. package/dist/schema-validation/semantic-validators/semantic-validator.d.ts.map +1 -0
  299. package/dist/schema-validation/semantic-validators/semantic-validator.js +301 -0
  300. package/dist/schema-validation/semantic-validators/semantic-validator.js.map +1 -0
  301. package/dist/schema-validation/semantic-validators/sql-where-clause-validator.d.ts +115 -0
  302. package/dist/schema-validation/semantic-validators/sql-where-clause-validator.d.ts.map +1 -0
  303. package/dist/schema-validation/semantic-validators/sql-where-clause-validator.js +381 -0
  304. package/dist/schema-validation/semantic-validators/sql-where-clause-validator.js.map +1 -0
  305. package/dist/schema-validation/semantic-validators/subset-of-entity-fields-validator.d.ts +60 -0
  306. package/dist/schema-validation/semantic-validators/subset-of-entity-fields-validator.d.ts.map +1 -0
  307. package/dist/schema-validation/semantic-validators/subset-of-entity-fields-validator.js +195 -0
  308. package/dist/schema-validation/semantic-validators/subset-of-entity-fields-validator.js.map +1 -0
  309. package/dist/schema-validation/semantic-validators/validation-context.d.ts +335 -0
  310. package/dist/schema-validation/semantic-validators/validation-context.d.ts.map +1 -0
  311. package/dist/schema-validation/semantic-validators/validation-context.js +13 -0
  312. package/dist/schema-validation/semantic-validators/validation-context.js.map +1 -0
  313. package/dist/styles-type-analyzer.d.ts +64 -0
  314. package/dist/styles-type-analyzer.d.ts.map +1 -0
  315. package/dist/styles-type-analyzer.js +242 -0
  316. package/dist/styles-type-analyzer.js.map +1 -0
  317. package/dist/type-context.d.ts +184 -0
  318. package/dist/type-context.d.ts.map +1 -0
  319. package/dist/type-context.js +415 -0
  320. package/dist/type-context.js.map +1 -0
  321. package/dist/type-inference-engine.d.ts +181 -0
  322. package/dist/type-inference-engine.d.ts.map +1 -0
  323. package/dist/type-inference-engine.js +1151 -0
  324. package/dist/type-inference-engine.js.map +1 -0
  325. package/dist/type-rules/type-compatibility-rule.d.ts +85 -0
  326. package/dist/type-rules/type-compatibility-rule.d.ts.map +1 -0
  327. package/dist/type-rules/type-compatibility-rule.js +211 -0
  328. package/dist/type-rules/type-compatibility-rule.js.map +1 -0
  329. package/package.json +35 -7
  330. package/README.md +0 -45
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subset-of-entity-fields-validator.js","sourceRoot":"","sources":["../../../src/schema-validation/semantic-validators/subset-of-entity-fields-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;;;;;;AAMH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD;;;;;;;;;GASG;AAEI,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,iBAAiB;IAClE;;;;;;OAMG;IACH,QAAQ,CACN,OAA0B,EAC1B,UAA8B;QAE9B,MAAM,UAAU,GAA0B,EAAE,CAAC;QAE7C,wDAAwD;QACxD,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;YAC/C,OAAO,UA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,CAAC;iBACT,CACF,CACF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,8EAA8E,CAAC;IACxF,CAAC;CACF,CAAA;AAzNY,6BAA6B;IADzC,aAAa,CAAC,iBAAiB,EAAE,yBAAyB,CAAC;GAC/C,6BAA6B,CAyNzC"}
@@ -0,0 +1,335 @@
1
+ /**
2
+ * Validation Context
3
+ *
4
+ * Provides all the information a semantic validator needs to perform validation.
5
+ * This context is passed to validators by the linter rule and includes:
6
+ * - AST node and path information for location tracking
7
+ * - Component spec for type lookups
8
+ * - Sibling props for dependency resolution
9
+ * - Entity/query metadata from data requirements
10
+ * - Helper methods for common validation tasks
11
+ */
12
+ import * as t from '@babel/types';
13
+ import { NodePath } from '@babel/traverse';
14
+ import { ComponentSpec } from '@memberjunction/interactive-component-types';
15
+ import type { SQLParserDialect } from '@memberjunction/sql-dialect';
16
+ import { TypeInferenceEngine } from '../../type-inference-engine.js';
17
+ import { ExtractedValue } from '../../prop-value-extractor.js';
18
+ /**
19
+ * Context object passed to semantic validators
20
+ *
21
+ * Contains all information needed to validate a prop value against semantic constraints.
22
+ */
23
+ export interface ValidationContext {
24
+ /**
25
+ * The AST node being validated
26
+ *
27
+ * This is typically the JSXAttribute node, but validators can traverse
28
+ * to child nodes for more specific location information.
29
+ */
30
+ node: t.Node;
31
+ /**
32
+ * Babel traversal path for the node
33
+ *
34
+ * Provides access to parent nodes, scope information, and AST manipulation.
35
+ * Validators should not modify the AST - this is read-only validation.
36
+ */
37
+ path: NodePath<any>;
38
+ /**
39
+ * Name of the component being validated
40
+ *
41
+ * Example: "DataGrid", "EntityDataGrid", "SimpleChart"
42
+ */
43
+ componentName: string;
44
+ /**
45
+ * Full component specification
46
+ *
47
+ * Provides access to:
48
+ * - Type definitions (for custom type validation)
49
+ * - Data requirements (entities, queries)
50
+ * - Other properties (for cross-property validation)
51
+ * - Dependency specs (for validating nested components)
52
+ */
53
+ componentSpec: ComponentSpec;
54
+ /**
55
+ * Name of the property being validated
56
+ *
57
+ * Example: "fields", "columns", "entityName", "extraFilter"
58
+ */
59
+ propertyName: string;
60
+ /**
61
+ * Extracted value of the property
62
+ *
63
+ * This is the result of PropValueExtractor.extract() and can be:
64
+ * - Primitive: string, number, boolean, null
65
+ * - Array: Array of extracted values
66
+ * - Object: Record<string, ExtractedValue>
67
+ * - DynamicValue: { _type: 'identifier' | 'expression', name?, description? }
68
+ *
69
+ * If the value is a DynamicValue, validators should typically skip validation
70
+ * and return an empty violations array (the linter will warn the user).
71
+ */
72
+ propertyValue: ExtractedValue;
73
+ /**
74
+ * Map of sibling props on the same JSX element
75
+ *
76
+ * Key is prop name, value is extracted value.
77
+ * Used for constraints with `dependsOn` to access related prop values.
78
+ *
79
+ * Example:
80
+ * ```typescript
81
+ * // <EntityDataGrid entityName="Members" fields={['FirstName', 'LastName']} />
82
+ * siblingProps.get('entityName') // => "Members"
83
+ * siblingProps.get('fields') // => ['FirstName', 'LastName']
84
+ * ```
85
+ */
86
+ siblingProps: Map<string, ExtractedValue>;
87
+ /**
88
+ * Map of entity name to entity metadata
89
+ *
90
+ * Populated from componentSpec.dataRequirements.entities
91
+ * Used by validators that check field names, entity references, etc.
92
+ *
93
+ * Example:
94
+ * ```typescript
95
+ * const memberEntity = entities.get('Members');
96
+ * const fields = memberEntity.fields; // Array of EntityFieldInfo
97
+ * ```
98
+ */
99
+ entities: Map<string, EntityMetadata>;
100
+ /**
101
+ * Map of query name to query metadata
102
+ *
103
+ * Populated from componentSpec.dataRequirements.queries
104
+ * Used by validators that check query references and parameters.
105
+ *
106
+ * Example:
107
+ * ```typescript
108
+ * const query = queries.get('Sales by Region');
109
+ * const params = query.parameters; // Array of QueryParameter
110
+ * ```
111
+ */
112
+ queries: Map<string, QueryMetadata>;
113
+ /**
114
+ * Type inference engine for checking expression types
115
+ *
116
+ * Used for advanced type checking beyond what PropValueExtractor provides.
117
+ * Can infer types of variables, function calls, etc.
118
+ */
119
+ typeEngine: TypeInferenceEngine;
120
+ /**
121
+ * SQL dialect for WHERE clause parsing and validation.
122
+ *
123
+ * Used by the SqlWhereClauseValidator to parse SQL with the correct syntax
124
+ * for the target database platform (SQL Server, PostgreSQL, etc.).
125
+ * If not provided, the validator falls back to SQL Server dialect.
126
+ */
127
+ dialect?: SQLParserDialect;
128
+ /**
129
+ * Get field metadata for an entity
130
+ *
131
+ * @param entityName - Name of the entity
132
+ * @returns Array of field info, or empty array if entity not found
133
+ *
134
+ * @example
135
+ * ```typescript
136
+ * const fields = context.getEntityFields('Members');
137
+ * const fieldNames = fields.map(f => f.name);
138
+ * ```
139
+ */
140
+ getEntityFields(entityName: string): EntityFieldInfo[];
141
+ /**
142
+ * Get the data type of a specific field on an entity
143
+ *
144
+ * @param entityName - Name of the entity
145
+ * @param fieldName - Name of the field
146
+ * @returns Data type string (e.g., 'string', 'number', 'date'), or null if not found
147
+ *
148
+ * @example
149
+ * ```typescript
150
+ * const fieldType = context.getEntityFieldType('Members', 'JoinDate');
151
+ * // => 'date'
152
+ * ```
153
+ */
154
+ getEntityFieldType(entityName: string, fieldName: string): string | null;
155
+ /**
156
+ * Find field names similar to the given field name (for suggestions)
157
+ *
158
+ * Uses fuzzy matching (Levenshtein distance or similar) to find close matches.
159
+ * Useful for "Did you mean?" error messages.
160
+ *
161
+ * @param fieldName - The field name to find matches for
162
+ * @param entityName - Name of the entity to search in
163
+ * @param maxResults - Maximum number of suggestions (default: 3)
164
+ * @returns Array of similar field names, sorted by similarity
165
+ *
166
+ * @example
167
+ * ```typescript
168
+ * const suggestions = context.findSimilarFieldNames('FristName', 'Members', 3);
169
+ * // => ['FirstName', 'FirstNameNormalized', 'FirstNameMasked']
170
+ * ```
171
+ */
172
+ findSimilarFieldNames(fieldName: string, entityName: string, maxResults?: number): string[];
173
+ /**
174
+ * Get parameter metadata for a query
175
+ *
176
+ * @param queryName - Name of the query
177
+ * @returns Array of parameter info, or empty array if query not found
178
+ *
179
+ * @example
180
+ * ```typescript
181
+ * const params = context.getQueryParameters('Sales by Region');
182
+ * const requiredParams = params.filter(p => p.required);
183
+ * ```
184
+ */
185
+ getQueryParameters(queryName: string): QueryParameter[];
186
+ /**
187
+ * Check if a query exists in the component's data requirements
188
+ *
189
+ * @param queryName - Name of the query to check
190
+ * @param categoryPath - Optional category path for disambiguation
191
+ * @returns True if the query exists
192
+ *
193
+ * @example
194
+ * ```typescript
195
+ * if (!context.hasQuery('Sales Report', '/Reports/Sales')) {
196
+ * // Query not found
197
+ * }
198
+ * ```
199
+ */
200
+ hasQuery(queryName: string, categoryPath?: string): boolean;
201
+ /**
202
+ * Check if an entity exists in the component's data requirements
203
+ *
204
+ * @param entityName - Name of the entity to check
205
+ * @returns True if the entity exists
206
+ *
207
+ * @example
208
+ * ```typescript
209
+ * if (!context.hasEntity('Members')) {
210
+ * // Entity not found
211
+ * }
212
+ * ```
213
+ */
214
+ hasEntity(entityName: string): boolean;
215
+ }
216
+ /**
217
+ * Entity metadata extracted from data requirements
218
+ */
219
+ export interface EntityMetadata {
220
+ /**
221
+ * Entity name
222
+ */
223
+ name: string;
224
+ /**
225
+ * Entity description (if available)
226
+ */
227
+ description?: string;
228
+ /**
229
+ * Array of field metadata for this entity
230
+ */
231
+ fields: EntityFieldInfo[];
232
+ /**
233
+ * Primary key field name(s)
234
+ */
235
+ primaryKeys?: string[];
236
+ }
237
+ /**
238
+ * Field metadata for an entity
239
+ */
240
+ export interface EntityFieldInfo {
241
+ /**
242
+ * Field name
243
+ */
244
+ name: string;
245
+ /**
246
+ * Data type (e.g., 'string', 'number', 'date', 'boolean')
247
+ */
248
+ type: string;
249
+ /**
250
+ * SQL data type (e.g., 'nvarchar', 'int', 'datetime', 'bit')
251
+ */
252
+ sqlType?: string;
253
+ /**
254
+ * Whether this field is required (NOT NULL)
255
+ */
256
+ required?: boolean;
257
+ /**
258
+ * Field description (if available)
259
+ */
260
+ description?: string;
261
+ /**
262
+ * Whether this is a primary key field
263
+ */
264
+ isPrimaryKey?: boolean;
265
+ /**
266
+ * If this is a foreign key, the related entity name
267
+ */
268
+ relatedEntity?: string;
269
+ /**
270
+ * Maximum length for string fields
271
+ */
272
+ maxLength?: number;
273
+ }
274
+ /**
275
+ * Query metadata extracted from data requirements
276
+ */
277
+ export interface QueryMetadata {
278
+ /**
279
+ * Query name
280
+ */
281
+ name: string;
282
+ /**
283
+ * Query description (if available)
284
+ */
285
+ description?: string;
286
+ /**
287
+ * Category path for disambiguation
288
+ */
289
+ categoryPath?: string;
290
+ /**
291
+ * Array of parameter metadata for this query
292
+ */
293
+ parameters: QueryParameter[];
294
+ /**
295
+ * Expected result fields (if specified)
296
+ */
297
+ resultFields?: Array<{
298
+ name: string;
299
+ type: string;
300
+ }>;
301
+ }
302
+ /**
303
+ * Parameter metadata for a query
304
+ */
305
+ export interface QueryParameter {
306
+ /**
307
+ * Parameter name
308
+ */
309
+ name: string;
310
+ /**
311
+ * Parameter data type
312
+ */
313
+ type: string;
314
+ /**
315
+ * SQL data type
316
+ */
317
+ sqlType?: string;
318
+ /**
319
+ * Whether this parameter is required
320
+ */
321
+ required?: boolean;
322
+ /**
323
+ * Default value if not provided
324
+ */
325
+ defaultValue?: any;
326
+ /**
327
+ * Example/test value for documentation
328
+ */
329
+ testValue?: any;
330
+ /**
331
+ * Parameter description (if available)
332
+ */
333
+ description?: string;
334
+ }
335
+ //# sourceMappingURL=validation-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-context.d.ts","sourceRoot":"","sources":["../../../src/schema-validation/semantic-validators/validation-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACp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ACtD;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,GAAG,CAAC;IAEhB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Validation Context
3
+ *
4
+ * Provides all the information a semantic validator needs to perform validation.
5
+ * This context is passed to validators by the linter rule and includes:
6
+ * - AST node and path information for location tracking
7
+ * - Component spec for type lookups
8
+ * - Sibling props for dependency resolution
9
+ * - Entity/query metadata from data requirements
10
+ * - Helper methods for common validation tasks
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=validation-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-context.js","sourceRoot":"","sources":["../../../src/schema-validation/semantic-validators/validation-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @fileoverview Analyzes the ComponentStyles TypeScript interface to validate style property access
3
+ * @module @memberjunction/react-test-harness
4
+ */
5
+ /**
6
+ * Analyzes the ComponentStyles interface from @memberjunction/interactive-component-types
7
+ * to provide validation and suggestions for style property access
8
+ */
9
+ export declare class StylesTypeAnalyzer {
10
+ private validPaths;
11
+ private propertyMap;
12
+ private defaultStyles;
13
+ constructor();
14
+ /**
15
+ * Analyzes the ComponentStyles interface to extract all valid property paths
16
+ */
17
+ private analyzeComponentStylesInterface;
18
+ /**
19
+ * Finds an interface by name in a source file
20
+ */
21
+ private findInterface;
22
+ /**
23
+ * Recursively extracts property paths from an interface
24
+ */
25
+ private extractPaths;
26
+ /**
27
+ * Extracts paths from a type node
28
+ */
29
+ private extractPathsFromType;
30
+ /**
31
+ * Adds a path to our tracking structures
32
+ */
33
+ private addPath;
34
+ /**
35
+ * Loads structure from the actual runtime default styles
36
+ */
37
+ private loadFallbackStructure;
38
+ /**
39
+ * Builds paths from a structure object
40
+ */
41
+ private buildPathsFromStructure;
42
+ /**
43
+ * Checks if a property path is valid
44
+ */
45
+ isValidPath(pathArray: string[]): boolean;
46
+ /**
47
+ * Finds all paths containing a specific property name
48
+ */
49
+ findPropertyPaths(propertyName: string): string[];
50
+ /**
51
+ * Gets suggestions for an invalid path
52
+ */
53
+ getSuggestionsForPath(invalidPath: string[]): {
54
+ correctPaths: string[];
55
+ availableAtParent: string[];
56
+ didYouMean: string | null;
57
+ };
58
+ /**
59
+ * Gets the actual default value from the runtime styles object
60
+ * This ensures we have a single source of truth for default values
61
+ */
62
+ getDefaultValueForPath(pathArray: string[]): string;
63
+ }
64
+ //# sourceMappingURL=styles-type-analyzer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles-type-analyzer.d.ts","sourceRoot":"","sources":["../src/styles-type-analyzer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,aAAa,CAAkB;;IAYvC;;OAEG;IACH,OAAO,CAAC,+BAA+B;IA0CvC;;OAEG;IACH,OAAO,CAAC,aAAa;IAerB;;OAEG;IACH,OAAO,CAAC,YAAY;IAqBpB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAa5B;;OAEG;IACH,OAAO,CAAC,OAAO;IAYf;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAM7B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAa/B;;OAEG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO;IAMzC;;OAEG;IACH,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE;IAWjD;;OAEG;IACH,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG;QAC5C,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,iBAAiB,EAAE,MAAM,EAAE,CAAC;QAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAC1B;IAgDD;;;OAGG;IACH,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM;CAgCpD"}
@@ -0,0 +1,242 @@
1
+ /**
2
+ * @fileoverview Analyzes the ComponentStyles TypeScript interface to validate style property access
3
+ * @module @memberjunction/react-test-harness
4
+ */
5
+ import * as ts from 'typescript';
6
+ import * as path from 'path';
7
+ import * as fs from 'fs';
8
+ import { createRequire } from 'module';
9
+ import { SetupStyles } from '@memberjunction/react-runtime';
10
+ // ESM compatibility: require.resolve is not available in ESM, use createRequire
11
+ // See: https://nodejs.org/api/module.html#modulecreaterequirefilename
12
+ const _require = createRequire(import.meta.url);
13
+ /**
14
+ * Analyzes the ComponentStyles interface from @memberjunction/interactive-component-types
15
+ * to provide validation and suggestions for style property access
16
+ */
17
+ export class StylesTypeAnalyzer {
18
+ constructor() {
19
+ this.validPaths = new Set();
20
+ this.propertyMap = new Map();
21
+ // Get the default styles from the runtime - single source of truth
22
+ this.defaultStyles = SetupStyles();
23
+ this.analyzeComponentStylesInterface();
24
+ }
25
+ /**
26
+ * Analyzes the ComponentStyles interface to extract all valid property paths
27
+ */
28
+ analyzeComponentStylesInterface() {
29
+ try {
30
+ // Find the type definition file
31
+ const typePackagePath = _require.resolve('@memberjunction/interactive-component-types');
32
+ const packageDir = path.dirname(typePackagePath);
33
+ const typeFile = path.join(packageDir, 'src', 'runtime-types.ts');
34
+ // Check if file exists, if not try the dist version
35
+ const actualFile = fs.existsSync(typeFile)
36
+ ? typeFile
37
+ : path.join(packageDir, 'runtime-types.d.ts');
38
+ if (!fs.existsSync(actualFile)) {
39
+ // Fallback to hardcoded structure if we can't find the file
40
+ this.loadFallbackStructure();
41
+ return;
42
+ }
43
+ const sourceCode = fs.readFileSync(actualFile, 'utf-8');
44
+ // Create a TypeScript program to parse the file
45
+ const sourceFile = ts.createSourceFile(actualFile, sourceCode, ts.ScriptTarget.Latest, true);
46
+ // Find the ComponentStyles interface
47
+ const interfaceNode = this.findInterface(sourceFile, 'ComponentStyles');
48
+ if (interfaceNode) {
49
+ this.extractPaths(interfaceNode, []);
50
+ }
51
+ else {
52
+ // Fallback if we can't find the interface
53
+ this.loadFallbackStructure();
54
+ }
55
+ }
56
+ catch (error) {
57
+ console.warn('Failed to analyze ComponentStyles interface, using fallback structure:', error);
58
+ this.loadFallbackStructure();
59
+ }
60
+ }
61
+ /**
62
+ * Finds an interface by name in a source file
63
+ */
64
+ findInterface(sourceFile, name) {
65
+ let result;
66
+ const visit = (node) => {
67
+ if (ts.isInterfaceDeclaration(node) && node.name?.text === name) {
68
+ result = node;
69
+ return;
70
+ }
71
+ ts.forEachChild(node, visit);
72
+ };
73
+ visit(sourceFile);
74
+ return result;
75
+ }
76
+ /**
77
+ * Recursively extracts property paths from an interface
78
+ */
79
+ extractPaths(node, currentPath) {
80
+ if (ts.isInterfaceDeclaration(node) || ts.isTypeLiteralNode(node)) {
81
+ const members = ts.isInterfaceDeclaration(node) ? node.members : node.members;
82
+ members.forEach(member => {
83
+ if (ts.isPropertySignature(member) && member.name && ts.isIdentifier(member.name)) {
84
+ const propName = member.name.text;
85
+ const newPath = [...currentPath, propName];
86
+ // Add this path
87
+ this.addPath(newPath);
88
+ // If the type is an object/interface, recurse
89
+ if (member.type) {
90
+ this.extractPathsFromType(member.type, newPath);
91
+ }
92
+ }
93
+ });
94
+ }
95
+ }
96
+ /**
97
+ * Extracts paths from a type node
98
+ */
99
+ extractPathsFromType(typeNode, currentPath) {
100
+ if (ts.isTypeLiteralNode(typeNode)) {
101
+ this.extractPaths(typeNode, currentPath);
102
+ }
103
+ else if (ts.isUnionTypeNode(typeNode)) {
104
+ // For union types, we might have object literals
105
+ typeNode.types.forEach(type => {
106
+ if (ts.isTypeLiteralNode(type)) {
107
+ this.extractPaths(type, currentPath);
108
+ }
109
+ });
110
+ }
111
+ }
112
+ /**
113
+ * Adds a path to our tracking structures
114
+ */
115
+ addPath(pathArray) {
116
+ const pathStr = pathArray.join('.');
117
+ this.validPaths.add(pathStr);
118
+ // Add to property map for quick lookup
119
+ const lastProp = pathArray[pathArray.length - 1];
120
+ if (!this.propertyMap.has(lastProp)) {
121
+ this.propertyMap.set(lastProp, []);
122
+ }
123
+ this.propertyMap.get(lastProp).push(pathStr);
124
+ }
125
+ /**
126
+ * Loads structure from the actual runtime default styles
127
+ */
128
+ loadFallbackStructure() {
129
+ // Use the actual default styles as the structure source
130
+ // We need to cast through unknown because ComponentStyles doesn't have an index signature
131
+ this.buildPathsFromStructure(this.defaultStyles, []);
132
+ }
133
+ /**
134
+ * Builds paths from a structure object
135
+ */
136
+ buildPathsFromStructure(obj, currentPath) {
137
+ for (const key in obj) {
138
+ const newPath = [...currentPath, key];
139
+ this.addPath(newPath);
140
+ const value = obj[key];
141
+ // Check if it's an object but not a boolean (which was being compared incorrectly)
142
+ if (value && typeof value === 'object') {
143
+ this.buildPathsFromStructure(value, newPath);
144
+ }
145
+ }
146
+ }
147
+ /**
148
+ * Checks if a property path is valid
149
+ */
150
+ isValidPath(pathArray) {
151
+ // Remove 'styles' from the beginning if present
152
+ const cleanPath = pathArray[0] === 'styles' ? pathArray.slice(1) : pathArray;
153
+ return this.validPaths.has(cleanPath.join('.'));
154
+ }
155
+ /**
156
+ * Finds all paths containing a specific property name
157
+ */
158
+ findPropertyPaths(propertyName) {
159
+ const paths = [];
160
+ // Look for exact matches
161
+ if (this.propertyMap.has(propertyName)) {
162
+ paths.push(...this.propertyMap.get(propertyName));
163
+ }
164
+ return paths;
165
+ }
166
+ /**
167
+ * Gets suggestions for an invalid path
168
+ */
169
+ getSuggestionsForPath(invalidPath) {
170
+ // Remove 'styles' prefix if present
171
+ const cleanPath = invalidPath[0] === 'styles' ? invalidPath.slice(1) : invalidPath;
172
+ const suggestions = {
173
+ correctPaths: [],
174
+ availableAtParent: [],
175
+ didYouMean: null
176
+ };
177
+ // Find where the misplaced property might exist
178
+ const lastProp = cleanPath[cleanPath.length - 1];
179
+ suggestions.correctPaths = this.findPropertyPaths(lastProp)
180
+ .map(p => 'styles.' + p);
181
+ // Get available properties at the parent level
182
+ if (cleanPath.length > 1) {
183
+ const parentPath = cleanPath.slice(0, -1).join('.');
184
+ this.validPaths.forEach(validPath => {
185
+ if (validPath.startsWith(parentPath + '.')) {
186
+ const nextProp = validPath.substring(parentPath.length + 1).split('.')[0];
187
+ if (nextProp && !suggestions.availableAtParent.includes(nextProp)) {
188
+ suggestions.availableAtParent.push(nextProp);
189
+ }
190
+ }
191
+ });
192
+ }
193
+ else {
194
+ // At root level, show root properties
195
+ this.validPaths.forEach(validPath => {
196
+ const rootProp = validPath.split('.')[0];
197
+ if (!suggestions.availableAtParent.includes(rootProp)) {
198
+ suggestions.availableAtParent.push(rootProp);
199
+ }
200
+ });
201
+ }
202
+ // Generate "did you mean" suggestion
203
+ if (suggestions.correctPaths.length > 0) {
204
+ suggestions.didYouMean = suggestions.correctPaths[0];
205
+ }
206
+ return suggestions;
207
+ }
208
+ /**
209
+ * Gets the actual default value from the runtime styles object
210
+ * This ensures we have a single source of truth for default values
211
+ */
212
+ getDefaultValueForPath(pathArray) {
213
+ const cleanPath = pathArray[0] === 'styles' ? pathArray.slice(1) : pathArray;
214
+ // Navigate the actual default styles object to get the real value
215
+ // Cast through unknown because ComponentStyles doesn't have an index signature
216
+ let current = this.defaultStyles;
217
+ for (const prop of cleanPath) {
218
+ if (current && typeof current === 'object' && prop in current) {
219
+ current = current[prop];
220
+ }
221
+ else {
222
+ // Path doesn't exist in defaults, return empty string
223
+ return "undefined";
224
+ }
225
+ }
226
+ // If we found a value, return it properly quoted
227
+ if (current !== undefined && current !== null) {
228
+ // For string values, add quotes
229
+ if (typeof current === 'string') {
230
+ return `'${current}'`;
231
+ }
232
+ // For objects (intermediate paths), return undefined since we can't provide a meaningful default
233
+ if (typeof current === 'object') {
234
+ return "{}";
235
+ }
236
+ // For other primitive types, convert to string
237
+ return String(current);
238
+ }
239
+ return "undefined";
240
+ }
241
+ }
242
+ //# sourceMappingURL=styles-type-analyzer.js.map