@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,217 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import * as t from '@babel/types';
8
+ import { RegisterClass } from '@memberjunction/global';
9
+ import { BaseLintRule } from '../lint-rule.js';
10
+ import { createViolation } from '../lint-utils.js';
11
+ /**
12
+ * Rule: no-iife-wrapper
13
+ *
14
+ * Ensures that component code is not wrapped in an IIFE (Immediately Invoked Function Expression).
15
+ * Components should be defined as plain functions.
16
+ *
17
+ * Severity: critical
18
+ * Applies to: all components
19
+ */
20
+ let NoIifeWrapperRule = class NoIifeWrapperRule extends BaseLintRule {
21
+ get Name() { return 'no-iife-wrapper'; }
22
+ get AppliesTo() { return 'all'; }
23
+ Test(ast) {
24
+ const violations = [];
25
+ // Check if the entire code is wrapped in an IIFE
26
+ if (ast.program && ast.program.body) {
27
+ for (const statement of ast.program.body) {
28
+ // Check for IIFE pattern: (function() { ... })() or (function() { ... }())
29
+ if (t.isExpressionStatement(statement)) {
30
+ const expr = statement.expression;
31
+ // Pattern 1: (function() { ... })()
32
+ if (t.isCallExpression(expr)) {
33
+ const callee = expr.callee;
34
+ // Check if calling a function expression wrapped in parentheses
35
+ if (t.isParenthesizedExpression && t.isParenthesizedExpression(callee)) {
36
+ const inner = callee.expression;
37
+ if (t.isFunctionExpression(inner) || t.isArrowFunctionExpression(inner)) {
38
+ violations.push(createViolation('no-iife-wrapper', 'critical', statement, `Component code must not be wrapped in an IIFE (Immediately Invoked Function Expression). Define the component function directly.`, statement.toString().substring(0, 50) + '...', {
39
+ text: 'Remove the IIFE wrapper. Component code should be plain functions, not wrapped in immediately invoked functions.',
40
+ example: `// ❌ WRONG - IIFE wrapper patterns:
41
+ (function() {
42
+ function MyComponent({ utilities, styles, components }) {
43
+ return <div>Hello</div>;
44
+ }
45
+ return MyComponent;
46
+ })();
47
+
48
+ // Also wrong:
49
+ (function() {
50
+ const MyComponent = ({ utilities }) => {
51
+ return <div>Hello</div>;
52
+ };
53
+ })();
54
+
55
+ // Also wrong - arrow function IIFE:
56
+ (() => {
57
+ function MyComponent({ utilities }) {
58
+ return <div>Hello</div>;
59
+ }
60
+ })();
61
+
62
+ // ✅ CORRECT - Direct function declaration:
63
+ function MyComponent({ utilities, styles, components }) {
64
+ return <div>Hello</div>;
65
+ }
66
+
67
+ // Why no IIFE?
68
+ // 1. Components run in their own scope already
69
+ // 2. The runtime handles isolation
70
+ // 3. IIFEs prevent proper component discovery
71
+ // 4. Makes debugging harder
72
+ // 5. Unnecessary complexity`,
73
+ }));
74
+ }
75
+ }
76
+ // Also check without ParenthesizedExpression (some parsers handle it differently)
77
+ if (t.isFunctionExpression(callee) || t.isArrowFunctionExpression(callee)) {
78
+ violations.push(createViolation('no-iife-wrapper', 'critical', statement, `Component code must not be wrapped in an IIFE. Define the component function directly.`, statement.toString().substring(0, 50) + '...', {
79
+ text: 'Remove the IIFE wrapper. Component code should be plain functions, not wrapped in immediately invoked functions.',
80
+ example: `// ❌ WRONG - IIFE wrapper patterns:
81
+ (function() {
82
+ function MyComponent({ utilities, styles, components }) {
83
+ return <div>Hello</div>;
84
+ }
85
+ return MyComponent;
86
+ })();
87
+
88
+ // Also wrong:
89
+ (function() {
90
+ const MyComponent = ({ utilities }) => {
91
+ return <div>Hello</div>;
92
+ };
93
+ })();
94
+
95
+ // Also wrong - arrow function IIFE:
96
+ (() => {
97
+ function MyComponent({ utilities }) {
98
+ return <div>Hello</div>;
99
+ }
100
+ })();
101
+
102
+ // ✅ CORRECT - Direct function declaration:
103
+ function MyComponent({ utilities, styles, components }) {
104
+ return <div>Hello</div>;
105
+ }
106
+
107
+ // Why no IIFE?
108
+ // 1. Components run in their own scope already
109
+ // 2. The runtime handles isolation
110
+ // 3. IIFEs prevent proper component discovery
111
+ // 4. Makes debugging harder
112
+ // 5. Unnecessary complexity`,
113
+ }));
114
+ }
115
+ }
116
+ // Pattern 2: (function() { ... }())
117
+ if (t.isParenthesizedExpression && t.isParenthesizedExpression(expr)) {
118
+ const inner = expr.expression;
119
+ if (t.isCallExpression(inner)) {
120
+ const callee = inner.callee;
121
+ if (t.isFunctionExpression(callee) || t.isArrowFunctionExpression(callee)) {
122
+ violations.push(createViolation('no-iife-wrapper', 'critical', statement, `Component code must not be wrapped in an IIFE. Define the component function directly.`, statement.toString().substring(0, 50) + '...', {
123
+ text: 'Remove the IIFE wrapper. Component code should be plain functions, not wrapped in immediately invoked functions.',
124
+ example: `// ❌ WRONG - IIFE wrapper patterns:
125
+ (function() {
126
+ function MyComponent({ utilities, styles, components }) {
127
+ return <div>Hello</div>;
128
+ }
129
+ return MyComponent;
130
+ })();
131
+
132
+ // Also wrong:
133
+ (function() {
134
+ const MyComponent = ({ utilities }) => {
135
+ return <div>Hello</div>;
136
+ };
137
+ })();
138
+
139
+ // Also wrong - arrow function IIFE:
140
+ (() => {
141
+ function MyComponent({ utilities }) {
142
+ return <div>Hello</div>;
143
+ }
144
+ })();
145
+
146
+ // ✅ CORRECT - Direct function declaration:
147
+ function MyComponent({ utilities, styles, components }) {
148
+ return <div>Hello</div>;
149
+ }
150
+
151
+ // Why no IIFE?
152
+ // 1. Components run in their own scope already
153
+ // 2. The runtime handles isolation
154
+ // 3. IIFEs prevent proper component discovery
155
+ // 4. Makes debugging harder
156
+ // 5. Unnecessary complexity`,
157
+ }));
158
+ }
159
+ }
160
+ }
161
+ }
162
+ // Also check for variable assignment with IIFE
163
+ if (t.isVariableDeclaration(statement)) {
164
+ for (const decl of statement.declarations) {
165
+ if (decl.init && t.isCallExpression(decl.init)) {
166
+ const callee = decl.init.callee;
167
+ if (t.isFunctionExpression(callee) || t.isArrowFunctionExpression(callee)) {
168
+ violations.push(createViolation('no-iife-wrapper', 'critical', decl, `Do not use IIFE pattern for component initialization. Define components as plain functions.`, decl.toString().substring(0, 50) + '...', {
169
+ text: 'Remove the IIFE wrapper. Component code should be plain functions, not wrapped in immediately invoked functions.',
170
+ example: `// ❌ WRONG - IIFE wrapper patterns:
171
+ (function() {
172
+ function MyComponent({ utilities, styles, components }) {
173
+ return <div>Hello</div>;
174
+ }
175
+ return MyComponent;
176
+ })();
177
+
178
+ // Also wrong:
179
+ (function() {
180
+ const MyComponent = ({ utilities }) => {
181
+ return <div>Hello</div>;
182
+ };
183
+ })();
184
+
185
+ // Also wrong - arrow function IIFE:
186
+ (() => {
187
+ function MyComponent({ utilities }) {
188
+ return <div>Hello</div>;
189
+ }
190
+ })();
191
+
192
+ // ✅ CORRECT - Direct function declaration:
193
+ function MyComponent({ utilities, styles, components }) {
194
+ return <div>Hello</div>;
195
+ }
196
+
197
+ // Why no IIFE?
198
+ // 1. Components run in their own scope already
199
+ // 2. The runtime handles isolation
200
+ // 3. IIFEs prevent proper component discovery
201
+ // 4. Makes debugging harder
202
+ // 5. Unnecessary complexity`,
203
+ }));
204
+ }
205
+ }
206
+ }
207
+ }
208
+ }
209
+ }
210
+ return violations;
211
+ }
212
+ };
213
+ NoIifeWrapperRule = __decorate([
214
+ RegisterClass(BaseLintRule, 'no-iife-wrapper')
215
+ ], NoIifeWrapperRule);
216
+ export { NoIifeWrapperRule };
217
+ //# sourceMappingURL=no-iife-wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-iife-wrapper.js","sourceRoot":"","sources":["../../src/runtime-rules/no-iife-wrapper.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,18 @@
1
+ import * as t from '@babel/types';
2
+ import { BaseLintRule } from '../lint-rule.js';
3
+ import { Violation } from '../component-linter.js';
4
+ /**
5
+ * Rule: no-import-statements
6
+ *
7
+ * Ensures that interactive components do not contain import statements.
8
+ * All dependencies must be passed as props (utilities, components, styles).
9
+ *
10
+ * Severity: critical
11
+ * Applies to: all components
12
+ */
13
+ export declare class NoImportStatementsRule extends BaseLintRule {
14
+ get Name(): string;
15
+ get AppliesTo(): 'all' | 'child' | 'root';
16
+ Test(ast: t.File, componentName: string): Violation[];
17
+ }
18
+ //# sourceMappingURL=no-import-statements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-import-statements.d.ts","sourceRoot":"","sources":["../../src/runtime-rules/no-import-statements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD;;;;;;;;GAQG;AACH,qBACa,sBAAuB,SAAQ,YAAY;IACtD,IAAI,IAAI,WAAqC;IAC7C,IAAI,SAAS,IAAI,KAAK,GAAG,OAAO,GAAG,MAAM,CAAkB;IAE3D,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,SAAS,EAAE;CAiDtD"}
@@ -0,0 +1,65 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { RegisterClass } from '@memberjunction/global';
8
+ import { BaseLintRule } from '../lint-rule.js';
9
+ import { traverse, createViolation, truncateCode } from '../lint-utils.js';
10
+ /**
11
+ * Rule: no-import-statements
12
+ *
13
+ * Ensures that interactive components do not contain import statements.
14
+ * All dependencies must be passed as props (utilities, components, styles).
15
+ *
16
+ * Severity: critical
17
+ * Applies to: all components
18
+ */
19
+ let NoImportStatementsRule = class NoImportStatementsRule extends BaseLintRule {
20
+ get Name() { return 'no-import-statements'; }
21
+ get AppliesTo() { return 'all'; }
22
+ Test(ast, componentName) {
23
+ const violations = [];
24
+ traverse(ast, {
25
+ ImportDeclaration(path) {
26
+ violations.push(createViolation('no-import-statements', 'critical', path.node, `Component "${componentName}" contains an import statement. Interactive components cannot use import statements - all dependencies must be passed as props.`, truncateCode(path.toString()), {
27
+ text: 'Remove all import statements. Interactive components receive everything through props.',
28
+ example: `// ❌ WRONG - Using import statements:
29
+ import React from 'react';
30
+ import { useState } from 'react';
31
+ import { format } from 'date-fns';
32
+ import './styles.css';
33
+
34
+ function MyComponent({ utilities, styles }) {
35
+ // ...
36
+ }
37
+
38
+ // ✅ CORRECT - Everything passed as props:
39
+ function MyComponent({ utilities, styles, components }) {
40
+ // React hooks are available globally (useState, useEffect, etc.)
41
+ const [value, setValue] = useState('');
42
+
43
+ // Utilities include formatting functions
44
+ const formatted = utilities.formatDate(new Date());
45
+
46
+ // Styles are passed as props
47
+ return <div style={styles.container}>...</div>;
48
+ }
49
+
50
+ // All dependencies must be:
51
+ // 1. Passed through the 'utilities' prop (formatting, helpers)
52
+ // 2. Passed through the 'components' prop (child components)
53
+ // 3. Passed through the 'styles' prop (styling)
54
+ // 4. Available globally (React hooks)`,
55
+ }));
56
+ },
57
+ });
58
+ return violations;
59
+ }
60
+ };
61
+ NoImportStatementsRule = __decorate([
62
+ RegisterClass(BaseLintRule, 'no-import-statements')
63
+ ], NoImportStatementsRule);
64
+ export { NoImportStatementsRule };
65
+ //# sourceMappingURL=no-import-statements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-import-statements.js","sourceRoot":"","sources":["../../src/runtime-rules/no-import-statements.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAY,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElF;;;;;;;;GAQG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,YAAY;IACtD,IAAI,IAAI,KAAK,OAAO,sBAAsB,CAAC,CAAC,CAAC;IAC7C,IAAI,SAAS,KAA+B,OAAO,KAAK,CAAC,CAAC,CAAC;IAE3D,IAAI,CAAC,GAAW,EAAE,aAAqB;QACrC,MAAM,UAAU,GAAgB,EAAE,CAAC;QAEnC,QAAQ,CAAC,GAAG,EAAE;YACZ,iBAAiB,CAAC,IAAmC;gBACnD,UAAU,CAAC,IAAI,CACb,eAAe,CACb,sBAAsB,EACtB,UAAU,EACV,IAAI,CAAC,IAAI,EACT,cAAc,aAAa,iIAAiI,EAC5J,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAC7B;oBACE,IAAI,EAAE,wFAAwF;oBAC9F,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;uCA0BgB;iBAC1B,CACF,CACF,CAAC;YACJ,CAAC;SACF,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AArDY,sBAAsB;IADlC,aAAa,CAAC,YAAY,EAAE,sBAAsB,CAAC;GACvC,sBAAsB,CAqDlC"}
@@ -0,0 +1,18 @@
1
+ import * as t from '@babel/types';
2
+ import { BaseLintRule } from '../lint-rule.js';
3
+ import { Violation } from '../component-linter.js';
4
+ /**
5
+ * Rule: no-react-destructuring
6
+ *
7
+ * Ensures that components do not destructure from React.
8
+ * React hooks are available globally and don't need to be imported or destructured.
9
+ *
10
+ * Severity: critical
11
+ * Applies to: all components
12
+ */
13
+ export declare class NoReactDestructuringRule extends BaseLintRule {
14
+ get Name(): string;
15
+ get AppliesTo(): 'all' | 'child' | 'root';
16
+ Test(ast: t.File): Violation[];
17
+ }
18
+ //# sourceMappingURL=no-react-destructuring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-react-destructuring.d.ts","sourceRoot":"","sources":["../../src/runtime-rules/no-react-destructuring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD;;;;;;;;GAQG;AACH,qBACa,wBAAyB,SAAQ,YAAY;IACxD,IAAI,IAAI,WAAuC;IAC/C,IAAI,SAAS,IAAI,KAAK,GAAG,OAAO,GAAG,MAAM,CAAkB;IAE3D,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,GAAG,SAAS,EAAE;CAmC/B"}
@@ -0,0 +1,60 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import * as t from '@babel/types';
8
+ import { RegisterClass } from '@memberjunction/global';
9
+ import { BaseLintRule } from '../lint-rule.js';
10
+ import { traverse, truncateCode } from '../lint-utils.js';
11
+ /**
12
+ * Rule: no-react-destructuring
13
+ *
14
+ * Ensures that components do not destructure from React.
15
+ * React hooks are available globally and don't need to be imported or destructured.
16
+ *
17
+ * Severity: critical
18
+ * Applies to: all components
19
+ */
20
+ let NoReactDestructuringRule = class NoReactDestructuringRule extends BaseLintRule {
21
+ get Name() { return 'no-react-destructuring'; }
22
+ get AppliesTo() { return 'all'; }
23
+ Test(ast) {
24
+ const violations = [];
25
+ traverse(ast, {
26
+ VariableDeclarator(path) {
27
+ // Check for destructuring from React
28
+ if (t.isObjectPattern(path.node.id) && t.isIdentifier(path.node.init) && path.node.init.name === 'React') {
29
+ // Get the destructured properties
30
+ const destructuredProps = path.node.id.properties
31
+ .filter((prop) => t.isObjectProperty(prop) && t.isIdentifier(prop.key))
32
+ .map((prop) => prop.key)
33
+ .map((key) => key.name);
34
+ violations.push({
35
+ rule: 'no-react-destructuring',
36
+ severity: 'critical',
37
+ line: path.node.loc?.start.line || 0,
38
+ column: path.node.loc?.start.column || 0,
39
+ message: `Cannot destructure from React. The hooks (${destructuredProps.join(', ')}) are already available as global functions in the React runtime.`,
40
+ code: truncateCode(path.toString()),
41
+ suggestion: {
42
+ text: `Remove the destructuring statement. React hooks like ${destructuredProps.join(', ')} are already available globally and don't need to be imported or destructured.`,
43
+ example: `// Remove this line entirely:
44
+ // const { ${destructuredProps.join(', ')} } = React;
45
+
46
+ // Just use the hooks directly:
47
+ const [state, setState] = useState(initialValue);`,
48
+ },
49
+ });
50
+ }
51
+ },
52
+ });
53
+ return violations;
54
+ }
55
+ };
56
+ NoReactDestructuringRule = __decorate([
57
+ RegisterClass(BaseLintRule, 'no-react-destructuring')
58
+ ], NoReactDestructuringRule);
59
+ export { NoReactDestructuringRule };
60
+ //# sourceMappingURL=no-react-destructuring.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-react-destructuring.js","sourceRoot":"","sources":["../../src/runtime-rules/no-react-destructuring.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAY,YAAY,EAAE,MAAM,eAAe,CAAC;AAEjE;;;;;;;;GAQG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,YAAY;IACxD,IAAI,IAAI,KAAK,OAAO,wBAAwB,CAAC,CAAC,CAAC;IAC/C,IAAI,SAAS,KAA+B,OAAO,KAAK,CAAC,CAAC,CAAC;IAE3D,IAAI,CAAC,GAAW;QACd,MAAM,UAAU,GAAgB,EAAE,CAAC;QAEnC,QAAQ,CAAC,GAAG,EAAE;YACZ,kBAAkB,CAAC,IAAoC;gBACrD,qCAAqC;gBACrC,IAAI,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;oBACzG,kCAAkC;oBAClC,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU;yBAC9C,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;yBACtE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAE,IAAyB,CAAC,GAAmB,CAAC;yBAC7D,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBAE1B,UAAU,CAAC,IAAI,CAAC;wBACd,IAAI,EAAE,wBAAwB;wBAC9B,QAAQ,EAAE,UAAU;wBACpB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC;wBACpC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC;wBACxC,OAAO,EAAE,6CAA6C,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,mEAAmE;wBACrJ,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;wBACnC,UAAU,EAAE;4BACV,IAAI,EAAE,wDAAwD,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,gFAAgF;4BAC1K,OAAO,EAAE;aACV,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC;;;kDAGS;yBACrC;qBACF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AAvCY,wBAAwB;IADpC,aAAa,CAAC,YAAY,EAAE,wBAAwB,CAAC;GACzC,wBAAwB,CAuCpC"}
@@ -0,0 +1,18 @@
1
+ import * as t from '@babel/types';
2
+ import { BaseLintRule } from '../lint-rule.js';
3
+ import { Violation } from '../component-linter.js';
4
+ /**
5
+ * Rule: no-require-statements
6
+ *
7
+ * Ensures that interactive components do not use require() or dynamic import().
8
+ * All dependencies must be passed as props.
9
+ *
10
+ * Severity: critical
11
+ * Applies to: all components
12
+ */
13
+ export declare class NoRequireStatementsRule extends BaseLintRule {
14
+ get Name(): string;
15
+ get AppliesTo(): 'all' | 'child' | 'root';
16
+ Test(ast: t.File, componentName: string): Violation[];
17
+ }
18
+ //# sourceMappingURL=no-require-statements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-require-statements.d.ts","sourceRoot":"","sources":["../../src/runtime-rules/no-require-statements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD;;;;;;;;GAQG;AACH,qBACa,uBAAwB,SAAQ,YAAY;IACvD,IAAI,IAAI,WAAsC;IAC9C,IAAI,SAAS,IAAI,KAAK,GAAG,OAAO,GAAG,MAAM,CAAkB;IAE3D,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,SAAS,EAAE;CAuGtD"}
@@ -0,0 +1,109 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import * as t from '@babel/types';
8
+ import { RegisterClass } from '@memberjunction/global';
9
+ import { BaseLintRule } from '../lint-rule.js';
10
+ import { traverse, createViolation, truncateCode } from '../lint-utils.js';
11
+ /**
12
+ * Rule: no-require-statements
13
+ *
14
+ * Ensures that interactive components do not use require() or dynamic import().
15
+ * All dependencies must be passed as props.
16
+ *
17
+ * Severity: critical
18
+ * Applies to: all components
19
+ */
20
+ let NoRequireStatementsRule = class NoRequireStatementsRule extends BaseLintRule {
21
+ get Name() { return 'no-require-statements'; }
22
+ get AppliesTo() { return 'all'; }
23
+ Test(ast, componentName) {
24
+ const violations = [];
25
+ traverse(ast, {
26
+ CallExpression(path) {
27
+ const callee = path.node.callee;
28
+ // Check for require() calls
29
+ if (t.isIdentifier(callee) && callee.name === 'require') {
30
+ violations.push(createViolation('no-require-statements', 'critical', path.node, `Component "${componentName}" contains a require() statement. Interactive components cannot use require - all dependencies must be passed as props.`, truncateCode(path.toString()), {
31
+ text: 'Remove all require() and dynamic import() statements. Use props instead.',
32
+ example: `// ❌ WRONG - Using require or dynamic import:
33
+ function MyComponent({ utilities }) {
34
+ const lodash = require('lodash');
35
+ const module = await import('./module');
36
+
37
+ return <div>...</div>;
38
+ }
39
+
40
+ // ✅ CORRECT - Use utilities and components props:
41
+ function MyComponent({ utilities, styles, components }) {
42
+ // Use utilities for helper functions
43
+ const result = utilities.debounce(() => {
44
+ // ...
45
+ }, 300);
46
+
47
+ // Use components prop for child components
48
+ const { DataTable, FilterPanel } = components;
49
+
50
+ return (
51
+ <div>
52
+ <DataTable {...props} />
53
+ <FilterPanel {...props} />
54
+ </div>
55
+ );
56
+ }
57
+
58
+ // Everything the component needs must be:
59
+ // - Passed via props (utilities, components, styles)
60
+ // - Available globally (React hooks)
61
+ // No module loading allowed!`,
62
+ }));
63
+ }
64
+ // Also check for dynamic import() calls
65
+ if (t.isImport(callee)) {
66
+ violations.push(createViolation('no-require-statements', 'critical', path.node, `Component "${componentName}" contains a dynamic import() statement. Interactive components cannot use dynamic imports - all dependencies must be passed as props.`, truncateCode(path.toString()), {
67
+ text: 'Remove all require() and dynamic import() statements. Use props instead.',
68
+ example: `// ❌ WRONG - Using require or dynamic import:
69
+ function MyComponent({ utilities }) {
70
+ const lodash = require('lodash');
71
+ const module = await import('./module');
72
+
73
+ return <div>...</div>;
74
+ }
75
+
76
+ // ✅ CORRECT - Use utilities and components props:
77
+ function MyComponent({ utilities, styles, components }) {
78
+ // Use utilities for helper functions
79
+ const result = utilities.debounce(() => {
80
+ // ...
81
+ }, 300);
82
+
83
+ // Use components prop for child components
84
+ const { DataTable, FilterPanel } = components;
85
+
86
+ return (
87
+ <div>
88
+ <DataTable {...props} />
89
+ <FilterPanel {...props} />
90
+ </div>
91
+ );
92
+ }
93
+
94
+ // Everything the component needs must be:
95
+ // - Passed via props (utilities, components, styles)
96
+ // - Available globally (React hooks)
97
+ // No module loading allowed!`,
98
+ }));
99
+ }
100
+ },
101
+ });
102
+ return violations;
103
+ }
104
+ };
105
+ NoRequireStatementsRule = __decorate([
106
+ RegisterClass(BaseLintRule, 'no-require-statements')
107
+ ], NoRequireStatementsRule);
108
+ export { NoRequireStatementsRule };
109
+ //# sourceMappingURL=no-require-statements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-require-statements.js","sourceRoot":"","sources":["../../src/runtime-rules/no-require-statements.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAY,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElF;;;;;;;;GAQG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,YAAY;IACvD,IAAI,IAAI,KAAK,OAAO,uBAAuB,CAAC,CAAC,CAAC;IAC9C,IAAI,SAAS,KAA+B,OAAO,KAAK,CAAC,CAAC,CAAC;IAE3D,IAAI,CAAC,GAAW,EAAE,aAAqB;QACrC,MAAM,UAAU,GAAgB,EAAE,CAAC;QAEnC,QAAQ,CAAC,GAAG,EAAE;YACZ,cAAc,CAAC,IAAgC;gBAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;gBAEhC,4BAA4B;gBAC5B,IAAI,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;oBACxD,UAAU,CAAC,IAAI,CACb,eAAe,CACb,uBAAuB,EACvB,UAAU,EACV,IAAI,CAAC,IAAI,EACT,cAAc,aAAa,yHAAyH,EACpJ,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAC7B;wBACE,IAAI,EAAE,0EAA0E;wBAChF,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA6BK;qBACf,CACF,CACF,CAAC;gBACJ,CAAC;gBAED,wCAAwC;gBACxC,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;oBACvB,UAAU,CAAC,IAAI,CACb,eAAe,CACb,uBAAuB,EACvB,UAAU,EACV,IAAI,CAAC,IAAI,EACT,cAAc,aAAa,wIAAwI,EACnK,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAC7B;wBACE,IAAI,EAAE,0EAA0E;wBAChF,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA6BK;qBACf,CACF,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;SACF,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AA3GY,uBAAuB;IADnC,aAAa,CAAC,YAAY,EAAE,uBAAuB,CAAC;GACxC,uBAAuB,CA2GnC"}
@@ -0,0 +1,18 @@
1
+ import * as t from '@babel/types';
2
+ import { BaseLintRule } from '../lint-rule.js';
3
+ import { Violation } from '../component-linter.js';
4
+ /**
5
+ * Rule: no-return-component
6
+ *
7
+ * Ensures that components don't have return statements or component references
8
+ * at the end of the file. The component function should stand alone.
9
+ *
10
+ * Severity: critical
11
+ * Applies to: all components
12
+ */
13
+ export declare class NoReturnComponentRule extends BaseLintRule {
14
+ get Name(): string;
15
+ get AppliesTo(): 'all' | 'child' | 'root';
16
+ Test(ast: t.File, componentName: string): Violation[];
17
+ }
18
+ //# sourceMappingURL=no-return-component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-return-component.d.ts","sourceRoot":"","sources":["../../src/runtime-rules/no-return-component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD;;;;;;;;GAQG;AACH,qBACa,qBAAsB,SAAQ,YAAY;IACrD,IAAI,IAAI,WAAoC;IAC5C,IAAI,SAAS,IAAI,KAAK,GAAG,OAAO,GAAG,MAAM,CAAkB;IAE3D,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,SAAS,EAAE;CAoGtD"}