@oracle/oraclejet-audit 10.1.0 → 12.0.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 (759) hide show
  1. package/LICENSE.md +1 -1
  2. package/jaf-amd.js +12 -4
  3. package/jaf.js +6 -1
  4. package/jafapi.js +6 -1
  5. package/lib/AST.js +6 -1
  6. package/lib/AST_Ts.js +6 -1
  7. package/lib/AstJson.js +6 -1
  8. package/lib/AstMd.js +6 -0
  9. package/lib/AstNodeTypes.js +6 -1
  10. package/lib/Comments.js +6 -1
  11. package/lib/ComponentSvcs.js +5 -0
  12. package/lib/Components.js +6 -1
  13. package/lib/Config.js +6 -1
  14. package/lib/ConfigLib.js +6 -1
  15. package/lib/CssLib.js +5 -0
  16. package/lib/CssUtils.js +5 -0
  17. package/lib/DomUtils.js +6 -1
  18. package/lib/FileIndex.js +5 -0
  19. package/lib/FileSet.js +5 -0
  20. package/lib/FsUtils.js +6 -1
  21. package/lib/Histo.js +6 -0
  22. package/lib/HtmlTree.js +6 -1
  23. package/lib/HtmlUtils.js +5 -0
  24. package/lib/Issue.js +6 -1
  25. package/lib/JafEvents.js +5 -0
  26. package/lib/JafLib.js +6 -1
  27. package/lib/Json.js +6 -0
  28. package/lib/JsonLoader.js +6 -1
  29. package/lib/Md.js +6 -0
  30. package/lib/MetaLib.js +6 -1
  31. package/lib/NetUtils.js +5 -0
  32. package/lib/NodeTypes.js +5 -0
  33. package/lib/Parser.js +6 -1
  34. package/lib/RegTypes.js +6 -1
  35. package/lib/Registry.js +6 -1
  36. package/lib/Reporter.js +6 -1
  37. package/lib/RuleContext.js +5 -0
  38. package/lib/RulePack.js +5 -0
  39. package/lib/RuleSet.js +6 -1
  40. package/lib/Rules.js +6 -1
  41. package/lib/Scope.js +6 -1
  42. package/lib/SemVer.js +5 -0
  43. package/lib/Server.js +5 -0
  44. package/lib/SevLib.js +5 -0
  45. package/lib/Severity.js +6 -1
  46. package/lib/Stats.js +6 -0
  47. package/lib/Ts.js +6 -1
  48. package/lib/Utils.js +6 -1
  49. package/lib/Watch.js +5 -0
  50. package/lib/Writer.js +5 -0
  51. package/lib/ZipUtils.js +5 -0
  52. package/lib/api.js +6 -0
  53. package/lib/builtinpacks.js +6 -0
  54. package/lib/cliStats.js +6 -0
  55. package/lib/clone.js +6 -1
  56. package/lib/cmdline.js +6 -1
  57. package/lib/colors.js +6 -1
  58. package/lib/defaults.js +6 -0
  59. package/lib/deflist.js +6 -0
  60. package/lib/dislist.js +6 -0
  61. package/lib/exportRules.js +6 -0
  62. package/lib/extends.js +6 -0
  63. package/lib/filetypes.js +6 -0
  64. package/lib/grouplist.js +6 -0
  65. package/lib/groups.js +6 -0
  66. package/lib/help.js +6 -1
  67. package/lib/jetver.js +6 -1
  68. package/lib/macros.js +6 -0
  69. package/lib/manual.js +6 -1
  70. package/lib/metaLoader.js +5 -0
  71. package/lib/metahist.js +5 -0
  72. package/lib/msgidLoader.js +6 -1
  73. package/lib/ns.js +6 -1
  74. package/lib/nslist.js +5 -0
  75. package/lib/outFormat.js +6 -0
  76. package/lib/outfile.js +5 -0
  77. package/lib/ruleLoader.js +5 -0
  78. package/lib/scaffold.js +6 -1
  79. package/lib/scaffoldRule.js +6 -1
  80. package/lib/schema.js +6 -1
  81. package/lib/scopewalker.js +6 -0
  82. package/lib/spinner.js +6 -1
  83. package/lib/spinnernoop.js +5 -0
  84. package/lib/tabs.js +5 -0
  85. package/libext/expparser.js +6 -1
  86. package/meta/11.0.0/jetauditmeta.js +9 -0
  87. package/meta/11.1.0/jetauditmeta.js +9 -0
  88. package/meta/12.0.0/jetauditmeta.js +9 -0
  89. package/meta/metaverlist.json +1 -1
  90. package/package.json +72 -69
  91. package/rulepacks/csp/csp-html-script-unsafe-inline.js +5 -0
  92. package/rulepacks/csp/csp-html-style-unsafe-inline.js +5 -0
  93. package/rulepacks/csp/csp-html-unsafe-expr.js +5 -0
  94. package/rulepacks/csp/csp-js-script-unsafe-eval.js +6 -1
  95. package/rulepacks/csp/csp-js-style-unsafe-inline.js +5 -0
  96. package/rulepacks/csp/csp-ts-script-unsafe-eval.js +6 -0
  97. package/rulepacks/csp/csp-ts-style-unsafe-inline.js +6 -0
  98. package/rulepacks/csp/msgid.json +6 -1
  99. package/rulepacks/csp/rules.json +6 -1
  100. package/rulepacks/jetwc/jetwc-absolute-jetversion.js +6 -1
  101. package/rulepacks/jetwc/jetwc-aria-redefinition.js +6 -1
  102. package/rulepacks/jetwc/jetwc-bootstrap.js +6 -1
  103. package/rulepacks/jetwc/jetwc-compjson-bp-ar.js +6 -1
  104. package/rulepacks/jetwc/jetwc-compjson-bp-obj.js +6 -1
  105. package/rulepacks/jetwc/jetwc-component-dependencies.js +6 -1
  106. package/rulepacks/jetwc/jetwc-component-displayname.js +6 -1
  107. package/rulepacks/jetwc/jetwc-component-foldername.js +6 -1
  108. package/rulepacks/jetwc/jetwc-component-location.js +6 -1
  109. package/rulepacks/jetwc/jetwc-component-type.js +6 -1
  110. package/rulepacks/jetwc/jetwc-css-oj-complete.js +6 -0
  111. package/rulepacks/jetwc/jetwc-data-property-prefix.js +6 -1
  112. package/rulepacks/jetwc/jetwc-deprecated-lifecycle.js +6 -1
  113. package/rulepacks/jetwc/jetwc-disabled-property.js +6 -1
  114. package/rulepacks/jetwc/jetwc-displayname.js +6 -1
  115. package/rulepacks/jetwc/jetwc-dynamic-slot-context.js +6 -1
  116. package/rulepacks/jetwc/jetwc-dynamic-slots-naming.js +6 -1
  117. package/rulepacks/jetwc/jetwc-event-displayname.js +6 -1
  118. package/rulepacks/jetwc/jetwc-events.js +6 -1
  119. package/rulepacks/jetwc/jetwc-jet-version.js +6 -1
  120. package/rulepacks/jetwc/jetwc-loader-file.js +6 -1
  121. package/rulepacks/jetwc/jetwc-markdown-link.js +6 -0
  122. package/rulepacks/jetwc/jetwc-method-displayname.js +6 -1
  123. package/rulepacks/jetwc/jetwc-methods.js +6 -1
  124. package/rulepacks/jetwc/jetwc-namespace.js +6 -1
  125. package/rulepacks/jetwc/jetwc-nested-defaults.js +6 -1
  126. package/rulepacks/jetwc/jetwc-nls-languages.js +6 -1
  127. package/rulepacks/jetwc/jetwc-nls-root.js +6 -1
  128. package/rulepacks/jetwc/jetwc-oj-register.js +6 -1
  129. package/rulepacks/jetwc/jetwc-ojcss.js +6 -1
  130. package/rulepacks/jetwc/jetwc-pack-children.js +6 -1
  131. package/rulepacks/jetwc/jetwc-packable-components.js +6 -1
  132. package/rulepacks/jetwc/jetwc-prerelease-dependencies.js +6 -1
  133. package/rulepacks/jetwc/jetwc-prerelease-pattern.js +6 -1
  134. package/rulepacks/jetwc/jetwc-prerelease-version.js +6 -1
  135. package/rulepacks/jetwc/jetwc-property-changed.js +6 -1
  136. package/rulepacks/jetwc/jetwc-property-displayname.js +6 -1
  137. package/rulepacks/jetwc/jetwc-property-nesting.js +6 -1
  138. package/rulepacks/jetwc/jetwc-public-modules.js +6 -1
  139. package/rulepacks/jetwc/jetwc-register-css.js +6 -1
  140. package/rulepacks/jetwc/jetwc-register-with-promises.js +6 -1
  141. package/rulepacks/jetwc/jetwc-require-paths.js +6 -1
  142. package/rulepacks/jetwc/jetwc-required-subproperty.js +6 -0
  143. package/rulepacks/jetwc/jetwc-reserved-property.js +6 -1
  144. package/rulepacks/jetwc/jetwc-schema.js +6 -1
  145. package/rulepacks/jetwc/jetwc-semantic-version.js +6 -1
  146. package/rulepacks/jetwc/jetwc-slot-displayname.js +6 -1
  147. package/rulepacks/jetwc/jetwc-slots.js +6 -1
  148. package/rulepacks/jetwc/jetwc-standard-files.js +6 -1
  149. package/rulepacks/jetwc/jetwc-subproperty-writeback.js +6 -0
  150. package/rulepacks/jetwc/jetwc-template-slots.js +6 -1
  151. package/rulepacks/jetwc/jetwc-unused-events.js +6 -1
  152. package/rulepacks/jetwc/jetwc-unused-slots.js +6 -1
  153. package/rulepacks/jetwc/jetwc-vb-category.js +6 -1
  154. package/rulepacks/jetwc/jetwc-vb-icon.js +6 -1
  155. package/rulepacks/jetwc/jetwc-vcomponent-jetversion.js +6 -0
  156. package/rulepacks/jetwc/jetwc-vcomponent-loader.js +6 -0
  157. package/rulepacks/jetwc/jetwc-vcomponent-version.js +6 -0
  158. package/rulepacks/jetwc/jetwc-version-openrange.js +6 -1
  159. package/rulepacks/jetwc/jetwc-writeback-required.js +6 -1
  160. package/rulepacks/jetwc/msgid.json +6 -0
  161. package/rulepacks/jetwc/rules.json +6 -1
  162. package/rulepacks/jetwc-lib/jetwcutils-auditComponentCacheManager.js +6 -0
  163. package/rulepacks/jetwc-lib/jetwcutils-commonListenerImpls.js +6 -0
  164. package/rulepacks/jetwc-lib/jetwcutils-componentAuditUtils.js +6 -0
  165. package/rulepacks/jetwc-lib/jetwcutils-componentFinder.js +6 -0
  166. package/rulepacks/jetwc-lib/jetwcutils-preCompiler.js +6 -0
  167. package/rulepacks/jetwc-lib/jetwcutils-tsxUtils.js +6 -0
  168. package/rulepacks/jetwco/jetwco-bootstrap.js +6 -1
  169. package/rulepacks/jetwco/jetwco-cacc-auditConstraints.js +6 -0
  170. package/rulepacks/jetwco/jetwco-cacc-dependencies.js +6 -0
  171. package/rulepacks/jetwco/jetwco-cacc-dynamicSlots.js +6 -0
  172. package/rulepacks/jetwco/jetwco-cacc-eventBubbles.js +6 -0
  173. package/rulepacks/jetwco/jetwco-cacc-eventCancelable.js +6 -0
  174. package/rulepacks/jetwco/jetwco-cacc-eventPayload.js +6 -0
  175. package/rulepacks/jetwco/jetwco-cacc-events.js +6 -0
  176. package/rulepacks/jetwco/jetwco-cacc-helpers.js +6 -0
  177. package/rulepacks/jetwco/jetwco-cacc-jetVer.js +6 -0
  178. package/rulepacks/jetwco/jetwco-cacc-methodParamTypes.js +6 -0
  179. package/rulepacks/jetwco/jetwco-cacc-methodParams.js +6 -0
  180. package/rulepacks/jetwco/jetwco-cacc-methodReturnType.js +6 -0
  181. package/rulepacks/jetwco/jetwco-cacc-methods.js +6 -0
  182. package/rulepacks/jetwco/jetwco-cacc-packBundle.js +6 -0
  183. package/rulepacks/jetwco/jetwco-cacc-packBundleContent.js +6 -0
  184. package/rulepacks/jetwco/jetwco-cacc-packContent.js +6 -0
  185. package/rulepacks/jetwco/jetwco-cacc-properties.js +6 -0
  186. package/rulepacks/jetwco/jetwco-cacc-propertyDefault.js +6 -0
  187. package/rulepacks/jetwco/jetwco-cacc-propertyEnumeration.js +6 -0
  188. package/rulepacks/jetwco/jetwco-cacc-propertyReadOnly.js +6 -0
  189. package/rulepacks/jetwco/jetwco-cacc-propertyRequired.js +6 -0
  190. package/rulepacks/jetwco/jetwco-cacc-propertyType.js +6 -0
  191. package/rulepacks/jetwco/jetwco-cacc-propertyWriteback.js +6 -0
  192. package/rulepacks/jetwco/jetwco-cacc-publicModules.js +6 -0
  193. package/rulepacks/jetwco/jetwco-cacc-slotDataVariable.js +6 -0
  194. package/rulepacks/jetwco/jetwco-cacc-slotDataVariableType.js +6 -0
  195. package/rulepacks/jetwco/jetwco-cacc-slots.js +6 -0
  196. package/rulepacks/jetwco/jetwco-cacc-styleClasses.js +6 -0
  197. package/rulepacks/jetwco/jetwco-cacc-styleVariables.js +6 -0
  198. package/rulepacks/jetwco/jetwco-compjson-ns-reg.js +6 -1
  199. package/rulepacks/jetwco/jetwco-component-api-baseline-changes.js +6 -0
  200. package/rulepacks/jetwco/jetwco-component-api-changes.js +6 -1
  201. package/rulepacks/jetwco/jetwco-component-api-controlled-changes.js +6 -0
  202. package/rulepacks/jetwco/jetwco-component-cdn.js +6 -1
  203. package/rulepacks/jetwco/jetwco-description-standards.js +6 -0
  204. package/rulepacks/jetwco/jetwco-displayname-standards.js +6 -0
  205. package/rulepacks/jetwco/jetwco-exchange-version-check.js +6 -1
  206. package/rulepacks/jetwco/jetwco-license-info.js +6 -1
  207. package/rulepacks/jetwco/jetwco-prerelease-cdn.js +6 -1
  208. package/rulepacks/jetwco/jetwco-thirdparty-ba.js +6 -1
  209. package/rulepacks/jetwco/msgid.json +6 -0
  210. package/rulepacks/jetwco/rules.json +6 -1
  211. package/rulepacks/spoc/msgid.json +5 -0
  212. package/rulepacks/spoc/rules.json +5 -0
  213. package/rulepacks/spoc/spoc-dom-manip-inv-tag.js +5 -0
  214. package/rulepacks/spoc/spoc-dom-manip-tag-pos.js +5 -0
  215. package/rulepacks/spoc/spoc-dom-manip.js +5 -0
  216. package/{tests/rules/oj-js-diagnose/js_FAIL_1.js → rulepacks/wdt/msgid.json} +3 -9
  217. package/rulepacks/wdt/rules.json +6 -0
  218. package/rulepacks/wdt/wd-driver-sleep.js +6 -0
  219. package/rulepacks/wdt/wd-xpath.js +6 -0
  220. package/rules/jaf/jaf-css-diagnose.js +5 -0
  221. package/rules/jaf/jaf-html-diagnose.js +5 -0
  222. package/rules/jaf/jaf-init-schema.js +5 -0
  223. package/rules/jaf/jaf-js-diagnose.js +5 -0
  224. package/rules/jaf/jaf-ts-diagnose.js +6 -0
  225. package/rules/jaf/msgid.json +6 -1
  226. package/rules/jaf/rules.json +6 -1
  227. package/rules/jet/helpers/acc-aria-label.js +6 -1
  228. package/rules/jet/helpers/bp-checkPropType.js +5 -0
  229. package/rules/jet/helpers/cssHelper.js +6 -1
  230. package/rules/jet/helpers/extractStylesFromClass.js +6 -1
  231. package/rules/jet/helpers/has-slot-name.js +6 -1
  232. package/rules/jet/helpers/has-slot.js +5 -0
  233. package/rules/jet/helpers/json-prop-pos.js +5 -0
  234. package/rules/jet/helpers/json-propname-pos.js +5 -0
  235. package/rules/jet/helpers/style-selector.js +6 -1
  236. package/rules/jet/helpers/valid-attr.js +5 -0
  237. package/rules/jet/helpers/vartrack.js +5 -0
  238. package/rules/jet/jet-css-ojselector.js +5 -0
  239. package/rules/jet/msgid.json +6 -1
  240. package/rules/jet/oj-acc-aria-labelledby.js +5 -0
  241. package/rules/jet/oj-acc-aria-prop.js +6 -1
  242. package/rules/jet/oj-acc-avatar-aria-role.js +6 -1
  243. package/rules/jet/oj-acc-combobox-aria-label.js +6 -1
  244. package/rules/jet/oj-acc-film-strip-aria-label.js +6 -1
  245. package/rules/jet/oj-acc-input-aria-label.js +6 -1
  246. package/rules/jet/oj-acc-select-aria-label.js +6 -1
  247. package/rules/jet/oj-cca-compjson-bp-ar.js +5 -0
  248. package/rules/jet/oj-cca-compjson-bp-dsplyname.js +5 -0
  249. package/rules/jet/oj-cca-compjson-bp-jetver.js +5 -0
  250. package/rules/jet/oj-cca-compjson-bp-obj.js +5 -0
  251. package/rules/jet/oj-cca-compjson-ns-reg.js +5 -0
  252. package/rules/jet/oj-css-bp-border-color.js +5 -0
  253. package/rules/jet/oj-css-bp-dir-flow.js +6 -1
  254. package/rules/jet/oj-css-bp-float.js +5 -0
  255. package/rules/jet/oj-css-bp-textalign.js +5 -0
  256. package/rules/jet/oj-css-style-abs-units.js +6 -1
  257. package/rules/jet/oj-css-style-bp-color.js +5 -0
  258. package/rules/jet/oj-css-style-bp-display.js +6 -1
  259. package/rules/jet/oj-css-style-bp-font-family.js +6 -1
  260. package/rules/jet/oj-css-style-bp-font.js +5 -0
  261. package/rules/jet/oj-css-style-deprecated.js +6 -1
  262. package/rules/jet/oj-css-style-override.js +6 -1
  263. package/rules/jet/oj-css-var-override.js +5 -0
  264. package/rules/jet/oj-form-maxcols.js +6 -1
  265. package/rules/jet/oj-html-5-attr-obs.js +5 -0
  266. package/rules/jet/oj-html-5-tag-obs.js +5 -0
  267. package/rules/jet/oj-html-alta-deprecated.js +6 -0
  268. package/rules/jet/oj-html-attr-$unique.js +5 -0
  269. package/rules/jet/oj-html-attr-2def.js +5 -0
  270. package/rules/jet/oj-html-attr-json.js +6 -1
  271. package/rules/jet/oj-html-attr-prefix-expr.js +6 -1
  272. package/rules/jet/oj-html-attr-prefix-ro.js +5 -0
  273. package/rules/jet/oj-html-attr-req.js +5 -0
  274. package/rules/jet/oj-html-bindforeach-data.js +6 -1
  275. package/rules/jet/oj-html-bindif-test.js +6 -1
  276. package/rules/jet/oj-html-binding-attr.js +6 -1
  277. package/rules/jet/oj-html-cca-count.js +5 -0
  278. package/rules/jet/oj-html-cca-tagname.js +6 -1
  279. package/rules/jet/oj-html-cdn.js +5 -0
  280. package/rules/jet/oj-html-combo-converter.js +5 -0
  281. package/rules/jet/oj-html-cspexpr.js +6 -1
  282. package/rules/jet/oj-html-databind-all.js +5 -0
  283. package/rules/jet/oj-html-dlg-title.js +6 -1
  284. package/rules/jet/oj-html-file-pick-accept.js +6 -1
  285. package/rules/jet/oj-html-form-bindif.js +6 -1
  286. package/rules/jet/oj-html-form-layout-maxcols.js +6 -1
  287. package/rules/jet/oj-html-form-noflex.js +5 -0
  288. package/rules/jet/oj-html-input-isodate.js +6 -0
  289. package/rules/jet/oj-html-invalid-doctype.js +6 -1
  290. package/rules/jet/oj-html-jq-databind.js +6 -1
  291. package/rules/jet/oj-html-ko-comment.js +5 -0
  292. package/rules/jet/oj-html-ko-databind.js +6 -1
  293. package/rules/jet/oj-html-label-for-prefix.js +5 -0
  294. package/rules/jet/oj-html-missing-doctype.js +6 -1
  295. package/rules/jet/oj-html-msgs-cat-text.js +6 -0
  296. package/rules/jet/oj-html-no-style-tag.js +6 -0
  297. package/rules/jet/oj-html-notag-style.js +6 -0
  298. package/rules/jet/oj-html-oj-lib.js +5 -0
  299. package/rules/jet/oj-html-ojattr-520.js +6 -1
  300. package/rules/jet/oj-html-ojattr-deprecated.js +6 -1
  301. package/rules/jet/oj-html-ojattr-enum-deprecated.js +6 -1
  302. package/rules/jet/oj-html-ojattr-evt-syntax.js +6 -1
  303. package/rules/jet/oj-html-ojattr-value.js +6 -1
  304. package/rules/jet/oj-html-ojattr.js +6 -1
  305. package/rules/jet/oj-html-ojevent.js +6 -1
  306. package/rules/jet/oj-html-ojslot.js +6 -1
  307. package/rules/jet/oj-html-ojstyle.js +5 -0
  308. package/rules/jet/oj-html-ojtag-datacmd.js +6 -1
  309. package/rules/jet/oj-html-ojtag-datactx.js +5 -0
  310. package/rules/jet/oj-html-ojtag-deprecated.js +6 -1
  311. package/rules/jet/oj-html-ojtag-globattr-noprefix.js +6 -1
  312. package/rules/jet/oj-html-ojtag-id.js +5 -0
  313. package/rules/jet/oj-html-ojtag-nonglobattr-prefix.js +6 -1
  314. package/rules/jet/oj-html-ojtag-ns.js +5 -0
  315. package/rules/jet/oj-html-picker-attrs.js +6 -0
  316. package/rules/jet/oj-html-redwood-cssnovars.js +6 -0
  317. package/rules/jet/oj-html-redwood-cssvars.js +6 -0
  318. package/rules/jet/oj-html-self-close.js +5 -0
  319. package/rules/jet/oj-html-slot-item-minmax.js +6 -0
  320. package/rules/jet/oj-html-slot-name.js +6 -1
  321. package/rules/jet/oj-html-slot-pref-content.js +6 -0
  322. package/rules/jet/oj-html-style-abs-units.js +5 -0
  323. package/rules/jet/oj-html-style-bp-color.js +5 -0
  324. package/rules/jet/oj-html-style-bp-display.js +6 -1
  325. package/rules/jet/oj-html-style-bp-font-family.js +5 -0
  326. package/rules/jet/oj-html-style-bp-font.js +5 -0
  327. package/rules/jet/oj-html-style-deprecated.js +6 -1
  328. package/rules/jet/oj-html-style.js +6 -1
  329. package/rules/jet/oj-html-stylesel.js +6 -1
  330. package/rules/jet/oj-html-tag-attr-noprefix.js +6 -1
  331. package/rules/jet/oj-html-template-index.js +6 -1
  332. package/rules/jet/oj-html-unsup-theme.js +6 -1
  333. package/rules/jet/oj-html-wctag-$props.js +6 -1
  334. package/rules/jet/oj-html-wctag-arialabelledby.js +5 -0
  335. package/rules/jet/oj-html-wctag-for.js +5 -0
  336. package/rules/jet/oj-html-wctag-id.js +6 -1
  337. package/rules/jet/oj-html-wctag-nested.js +6 -0
  338. package/rules/jet/oj-html-wctag-packprivate.js +6 -0
  339. package/rules/jet/oj-js-comp-attr-deprecated.js +6 -1
  340. package/rules/jet/oj-js-comp-meth-deprecated.js +6 -1
  341. package/rules/jet/oj-js-no-ext-final.js +5 -0
  342. package/rules/jet/oj-js-noconsole.js +5 -0
  343. package/rules/jet/oj-js-ojcomp-deprecated.js +6 -1
  344. package/rules/jet/oj-js-ojcomp-exist.js +5 -0
  345. package/rules/jet/oj-js-ojcomp-new.js +5 -0
  346. package/rules/jet/oj-js-poly-promise.js +6 -1
  347. package/rules/jet/oj-js-var-undef.js +5 -0
  348. package/rules/jet/oj-json-syntax.js +5 -0
  349. package/rules/jet/oj-ts-comp-attr-deprecated.js +6 -1
  350. package/rules/jet/oj-ts-comp-meth-deprecated.js +6 -1
  351. package/rules/jet/oj-ts-no-ext-final.js +6 -0
  352. package/rules/jet/oj-ts-noconsole.js +6 -1
  353. package/rules/jet/oj-ts-ojcomp-deprecated.js +6 -1
  354. package/rules/jet/oj-ts-ojcomp-exist.js +6 -1
  355. package/rules/jet/oj-ts-ojcomp-new.js +6 -1
  356. package/rules/jet/oj-ts-poly-promise.js +6 -1
  357. package/rules/jet/rules.json +6 -1
  358. package/schema/component-schema.json +125 -2
  359. package/src/JafCore.js +6 -1
  360. package/types/index.d.ts +175 -37
  361. package/lib/stats.js +0 -1
  362. package/rulepacks/jetwc-lib/component-audit-utils.js +0 -1
  363. package/rules/exch/helpers/json-prop-pos.js +0 -1
  364. package/rules/exch/msgid.json +0 -1
  365. package/rules/exch/oj-cca-comp-zip-content-composite.js +0 -1
  366. package/rules/exch/oj-cca-comp-zip-content-pack.js +0 -1
  367. package/rules/exch/oj-cca-comp-zip-expand.js +0 -1
  368. package/rules/exch/oj-cca-compjson-evnames.js +0 -1
  369. package/rules/exch/oj-cca-compjson-file.js +0 -1
  370. package/rules/exch/oj-cca-compjson-prefix.js +0 -1
  371. package/rules/exch/oj-cca-compjson-prop-compdeps.js +0 -1
  372. package/rules/exch/oj-cca-compjson-prop-deps.js +0 -1
  373. package/rules/exch/oj-cca-compjson-prop-jetver.js +0 -1
  374. package/rules/exch/oj-cca-compjson-prop-obs.js +0 -1
  375. package/rules/exch/oj-cca-compjson-prop-type.js +0 -1
  376. package/rules/exch/oj-cca-compjson-prop-types.js +0 -1
  377. package/rules/exch/oj-cca-compjson-prop-undef.js +0 -1
  378. package/rules/exch/oj-cca-compjson-prop-version.js +0 -1
  379. package/rules/exch/oj-cca-compjson-schema.js +0 -1
  380. package/rules/exch/oj-cca-zip-compjson.js +0 -1
  381. package/rules/exch/rules.json +0 -1
  382. package/rules/jet/oj-css-bp-bgcolor.js +0 -1
  383. package/tests/components/attr-req-test/component.json +0 -1
  384. package/tests/components/demo-analog-clock/component.json +0 -1
  385. package/tests/components/demo-analog-clock/demo-analog-clock-viewModel.js +0 -1
  386. package/tests/components/demo-analog-clock/extension/demo/js/viewModels/demo.js +0 -1
  387. package/tests/components/demo-analog-clock/loader.js +0 -1
  388. package/tests/components/demo-card/component.json +0 -1
  389. package/tests/components/demo-chart-orientation-control/component.json +0 -1
  390. package/tests/components/demo-chart-stack-control/component.json +0 -1
  391. package/tests/components/made-up/component.json +0 -1
  392. package/tests/components/oj-made-up/component.json +0 -1
  393. package/tests/components/sp-activity-item/component.json +0 -1
  394. package/tests/config/config_base.json +0 -1
  395. package/tests/golden/10.0.0/golden_base.json +0 -1
  396. package/tests/golden/8.1.0/golden_base.json +0 -1
  397. package/tests/golden/9.0.0/golden_base.json +0 -1
  398. package/tests/rulepacks/hooks/hook-rpext.js +0 -1
  399. package/tests/rulepacks/hooks/hook-start-close-rulepack.js +0 -1
  400. package/tests/rulepacks/hooks/rule-rpext.js +0 -1
  401. package/tests/rulepacks/hooks/rules.json +0 -1
  402. package/tests/rulepacks/tags/proc_directive.js +0 -1
  403. package/tests/rulepacks/tags/rules.json +0 -1
  404. package/tests/rulepacks/tags/tag-count-setup.js +0 -1
  405. package/tests/rulepacks/tags/tag-count.js +0 -1
  406. package/tests/rules/bugs/JET-4770_PASS_1.html +0 -9
  407. package/tests/rules/comments/com_FAIL_1.js +0 -57
  408. package/tests/rules/comments/com_FAIL_2.js +0 -96
  409. package/tests/rules/comments/com_PASS_1.js +0 -42
  410. package/tests/rules/comments/com_PASS_2.js +0 -63
  411. package/tests/rules/comments/com_PASS_3.js +0 -40
  412. package/tests/rules/comments/com_PASS_4.js +0 -36
  413. package/tests/rules/comments/com_PASS_5.js +0 -19
  414. package/tests/rules/csp/html-script-unsafe-inline/FAIL_1.html +0 -11
  415. package/tests/rules/csp/html-script-unsafe-inline/FAIL_2.html +0 -8
  416. package/tests/rules/csp/html-script-unsafe-inline/PASS_1.html +0 -8
  417. package/tests/rules/csp/html-script-unsafe-inline/PASS_2.html +0 -8
  418. package/tests/rules/csp/html-script-unsafe-inline/PASS_3.html +0 -8
  419. package/tests/rules/csp/html-style-unsafe-inline/FAIL_1.html +0 -11
  420. package/tests/rules/csp/html-style-unsafe-inline/PASS_1.html +0 -11
  421. package/tests/rules/csp/html-unsafe-expr/FAIL_1.html +0 -14
  422. package/tests/rules/csp/html-unsafe-expr/PASS_1.html +0 -23
  423. package/tests/rules/csp/js-script-unsafe-eval/FAIL_1.js +0 -17
  424. package/tests/rules/csp/js-script-unsafe-eval/FAIL_2.js +0 -40
  425. package/tests/rules/csp/js-script-unsafe-eval/FAIL_3.js +0 -22
  426. package/tests/rules/csp/js-script-unsafe-eval/PASS_1.js +0 -20
  427. package/tests/rules/csp/js-script-unsafe-eval/PASS_2.js +0 -44
  428. package/tests/rules/csp/js-script-unsafe-eval/PASS_3.js +0 -16
  429. package/tests/rules/csp/js-style-unsafe-inline/FAIL_1.js +0 -25
  430. package/tests/rules/csp/js-style-unsafe-inline/PASS.js +0 -22
  431. package/tests/rules/demo/noself_FAIL_1.js +0 -101
  432. package/tests/rules/import/import_FAIL_1.js +0 -11
  433. package/tests/rules/import/import_PASS_1.js +0 -10
  434. package/tests/rules/jet-composites/demo-buttonset-enum/component.json +0 -57
  435. package/tests/rules/jet-composites/demo-buttonset-enum/loader.js +0 -19
  436. package/tests/rules/jet-composites/demo-buttonset-enum/view.html +0 -48
  437. package/tests/rules/jet-composites/demo-card/component.json +0 -28
  438. package/tests/rules/jet-composites/demo-card/loader.js +0 -16
  439. package/tests/rules/jet-composites/demo-card/view.html +0 -30
  440. package/tests/rules/jet-composites/demo-card/viewModel.js +0 -46
  441. package/tests/rules/jet-composites/demo-card/view_PASS_1.html +0 -21
  442. package/tests/rules/jet-composites/demo-contact-form/component.json +0 -23
  443. package/tests/rules/jet-composites/demo-contact-form/loader.js +0 -16
  444. package/tests/rules/jet-composites/demo-contact-form/view.html +0 -9
  445. package/tests/rules/jet-composites/demo-grocery-list/component.json +0 -18
  446. package/tests/rules/jet-composites/demo-grocery-list/loader.js +0 -19
  447. package/tests/rules/jet-composites/demo-grocery-list/view.html +0 -22
  448. package/tests/rules/jet-composites/demo-grocery-list/viewModel.js +0 -48
  449. package/tests/rules/jet-composites/dummy-component-1/component.json +0 -82
  450. package/tests/rules/jet-composites/dummy-component-2/component.json +0 -72
  451. package/tests/rules/jet-composites/foo-my-cca/component.json +0 -14
  452. package/tests/rules/jet-composites/foo-unsup-theme/component.json +0 -29
  453. package/tests/rules/jet-composites/header/component.json +0 -12
  454. package/tests/rules/jet-composites/oj-cgbu-omc/attribute-selection/component.json +0 -154
  455. package/tests/rules/jet-composites/oj-cgbu-omc/component.json +0 -11
  456. package/tests/rules/jet-composites/oj-cgbu-omc/reference/component.json +0 -185
  457. package/tests/rules/jet-composites/oj-cgbu-omc/wctag_props_FAIL_1.html +0 -34
  458. package/tests/rules/jet-composites/oj-enum-depr/component.json +0 -69
  459. package/tests/rules/jet-composites/oj-html-wctag-id/id_FAIL_1.html +0 -10
  460. package/tests/rules/jet-composites/oj-html-wctag-id/id_PASS_1.html +0 -6
  461. package/tests/rules/misc/oj.js +0 -12
  462. package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_FAIL_1.html +0 -23
  463. package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_FAIL_2.html +0 -22
  464. package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_1.html +0 -23
  465. package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_2.html +0 -22
  466. package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_3.html +0 -22
  467. package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_4.html +0 -22
  468. package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_5.html +0 -22
  469. package/tests/rules/oj-acc-aria-prop/aria_prop_FAIL_1.html +0 -22
  470. package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_FAIL_1.html +0 -20
  471. package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_1.html +0 -23
  472. package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_2.html +0 -24
  473. package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_3.html +0 -21
  474. package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_4.html +0 -22
  475. package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_5.html +0 -22
  476. package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_FAIL_1.html +0 -20
  477. package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_FAIL_2.html +0 -21
  478. package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_PASS_1.html +0 -20
  479. package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_FAIL_1.html +0 -21
  480. package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_FAIL_2.html +0 -22
  481. package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_PASS_1.html +0 -22
  482. package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_FAIL_1.html +0 -18
  483. package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_FAIL_2.html +0 -18
  484. package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_1.html +0 -18
  485. package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_2.html +0 -19
  486. package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_3.html +0 -22
  487. package/tests/rules/oj-acc-input-aria-label/oj_input_date_FAIL_1.html +0 -21
  488. package/tests/rules/oj-acc-input-aria-label/oj_input_date_FAIL_2.html +0 -22
  489. package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_1.html +0 -16
  490. package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_2.html +0 -17
  491. package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_3.html +0 -26
  492. package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_FAIL_1.html +0 -19
  493. package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_FAIL_2.html +0 -20
  494. package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_PASS_1.html +0 -19
  495. package/tests/rules/oj-acc-input-aria-label/oj_input_number_FAIL_1.html +0 -17
  496. package/tests/rules/oj-acc-input-aria-label/oj_input_number_FAIL_2.html +0 -18
  497. package/tests/rules/oj-acc-input-aria-label/oj_input_number_PASS_1.html +0 -17
  498. package/tests/rules/oj-acc-input-aria-label/oj_input_password_FAIL_1.html +0 -17
  499. package/tests/rules/oj-acc-input-aria-label/oj_input_password_FAIL_2.html +0 -17
  500. package/tests/rules/oj-acc-input-aria-label/oj_input_password_PASS_1.html +0 -17
  501. package/tests/rules/oj-acc-input-aria-label/oj_input_text_3_PASS_1.html +0 -20
  502. package/tests/rules/oj-acc-input-aria-label/oj_input_text_FAIL_1.html +0 -20
  503. package/tests/rules/oj-acc-input-aria-label/oj_input_text_FAIL_2.html +0 -21
  504. package/tests/rules/oj-acc-input-aria-label/oj_input_text_PASS_2.html +0 -62
  505. package/tests/rules/oj-acc-input-aria-label/oj_input_text_nolabel_PASS_2.html +0 -17
  506. package/tests/rules/oj-acc-input-aria-label/oj_input_time_FAIL_1.html +0 -19
  507. package/tests/rules/oj-acc-input-aria-label/oj_input_time_FAIL_2.html +0 -20
  508. package/tests/rules/oj-acc-input-aria-label/oj_input_time_PASS_1.html +0 -19
  509. package/tests/rules/oj-acc-select-aria-label/aria_selectmany_FAIL_1.html +0 -19
  510. package/tests/rules/oj-acc-select-aria-label/aria_selectmany_FAIL_2.html +0 -20
  511. package/tests/rules/oj-acc-select-aria-label/aria_selectmany_PASS_1.html +0 -19
  512. package/tests/rules/oj-acc-select-aria-label/aria_selectone_FAIL_1.html +0 -20
  513. package/tests/rules/oj-acc-select-aria-label/aria_selectone_FAIL_2.html +0 -21
  514. package/tests/rules/oj-cca-comp-zip/zip_FAIL_1.zip +0 -1
  515. package/tests/rules/oj-cca-comp-zip/zip_FAIL_2.zip +0 -0
  516. package/tests/rules/oj-cca-comp-zip/zip_FAIL_3.zip +0 -0
  517. package/tests/rules/oj-cca-comp-zip/zip_FAIL_4.zip +0 -0
  518. package/tests/rules/oj-cca-comp-zip/zip_FAIL_5.zip +0 -0
  519. package/tests/rules/oj-cca-comp-zip/zip_FAIL_6.zip +0 -0
  520. package/tests/rules/oj-cca-comp-zip/zip_FAIL_7.zip +0 -0
  521. package/tests/rules/oj-cca-comp-zip/zip_FAIL_8.zip +0 -0
  522. package/tests/rules/oj-cca-comp-zip/zip_PASS_1.zip +0 -0
  523. package/tests/rules/oj-cca-ns-reg/oj-cca-ns-FAIL_1/component.json +0 -19
  524. package/tests/rules/oj-cca-ns-reg/oj-cca-ns-PASS_1/component.json +0 -19
  525. package/tests/rules/oj-cgbu-omc_tests/html_ojevent_FAIL_1.html +0 -15
  526. package/tests/rules/oj-cgbu-omc_tests/html_ojevent_PASS_1.html +0 -17
  527. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_1/component.json +0 -16
  528. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_10/component.json +0 -103
  529. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_11/component.json +0 -24
  530. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_12/component.json +0 -17
  531. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_13/component.json +0 -17
  532. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_14/component.json +0 -40
  533. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_15/component.json +0 -24
  534. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_16/component.json +0 -44
  535. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_17/component.json +0 -8
  536. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_18/component.json +0 -8
  537. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_19/component.json +0 -8
  538. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_2/component.json +0 -15
  539. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_20/component.json +0 -18
  540. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_21/component.json +0 -16
  541. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_22/component.json +0 -19
  542. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_3/component.json +0 -15
  543. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_4/component.json +0 -16
  544. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_5/component.json +0 -16
  545. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_6/component.json +0 -18
  546. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_7/component.json +0 -15
  547. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_8/component.json +0 -15
  548. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_9/component.json +0 -52
  549. package/tests/rules/oj-compjson-syntax/ojcomp-PASS_1/component.json +0 -17
  550. package/tests/rules/oj-compjson-syntax/ojcomp-PASS_2/component.json +0 -88
  551. package/tests/rules/oj-compjson-syntax/ojcomp-PASS_3/component.json +0 -19
  552. package/tests/rules/oj-css-bp-dir-flow/dirflow_FAIL_1.html +0 -22
  553. package/tests/rules/oj-css-bp-dir-flow/dirflow_FAIL_2.html +0 -22
  554. package/tests/rules/oj-css-diagnose/css_FAIL_1.html +0 -14
  555. package/tests/rules/oj-css-diagnose/css_PASS_1.html +0 -14
  556. package/tests/rules/oj-css-var-override/varovr_FAIL_1.html +0 -8
  557. package/tests/rules/oj-html-5-attr-depr/attrdepr_FAIL_1.html +0 -16
  558. package/tests/rules/oj-html-5-attr-depr/attrdepr_PASS_1.html +0 -16
  559. package/tests/rules/oj-html-5-tag-depr/tagdepr_FAIL_1.html +0 -9
  560. package/tests/rules/oj-html-attr/attr_FAIL_1.html +0 -27
  561. package/tests/rules/oj-html-attr-$unique/attr_$unique1_FAIL_1.html +0 -19
  562. package/tests/rules/oj-html-attr-$unique/attr_$unique_FAIL_2.html +0 -25
  563. package/tests/rules/oj-html-attr-2def/attr2def_FAIL_1.html +0 -10
  564. package/tests/rules/oj-html-attr-2def/attr2def_PASS_1.html +0 -10
  565. package/tests/rules/oj-html-attr-json/attr-json_FAIL_1.html +0 -20
  566. package/tests/rules/oj-html-attr-json/attr-json_FAIL_2.html +0 -20
  567. package/tests/rules/oj-html-attr-json/attr-json_FAIL_3.html +0 -20
  568. package/tests/rules/oj-html-attr-json/attr-json_PASS_1.html +0 -20
  569. package/tests/rules/oj-html-attr-json/attr-json_PASS_2.html +0 -20
  570. package/tests/rules/oj-html-attr-json/attr-json_PASS_3.html +0 -8
  571. package/tests/rules/oj-html-attr-prefix-expr/attrprefixexpr_FAIL_1.html +0 -10
  572. package/tests/rules/oj-html-attr-prefix-expr/attrprefixexpr_PASS_1.html +0 -10
  573. package/tests/rules/oj-html-attr-prefix-ro/attrprefixro_FAIL_1.html +0 -10
  574. package/tests/rules/oj-html-attr-prefix-ro/attrprefixro_PASS_1.html +0 -10
  575. package/tests/rules/oj-html-attr-req/attrreq_FAIL_1.html +0 -17
  576. package/tests/rules/oj-html-attr-req/attrreq_FAIL_2.html +0 -13
  577. package/tests/rules/oj-html-attr-req/attrreq_FAIL_3.html +0 -8
  578. package/tests/rules/oj-html-attr-req/attrreq_FAIL_4.html +0 -13
  579. package/tests/rules/oj-html-attr-req/attrreq_FAIL_5.html +0 -17
  580. package/tests/rules/oj-html-attr-req/attrreq_PASS_1.html +0 -24
  581. package/tests/rules/oj-html-attr-req/attrreq_PASS_2.html +0 -24
  582. package/tests/rules/oj-html-attr-req/attrreq_PASS_3.html +0 -10
  583. package/tests/rules/oj-html-attr-req/attrreq_PASS_4.html +0 -11
  584. package/tests/rules/oj-html-bindforeach-data/bindforeach_data_FAIL_1.html +0 -19
  585. package/tests/rules/oj-html-bindforeach-data/bindforeach_data_PASS_1.html +0 -10
  586. package/tests/rules/oj-html-bindif-test/bindif_test_FAIL_1.html +0 -22
  587. package/tests/rules/oj-html-bindif-test/bindif_test_PASS_1.html +0 -11
  588. package/tests/rules/oj-html-binding-attr/binding-foreach_FAIL_2.html +0 -28
  589. package/tests/rules/oj-html-binding-attr/binding-if_FAIL_1.html +0 -23
  590. package/tests/rules/oj-html-binding-attr/binding-if_PASS_1.html +0 -23
  591. package/tests/rules/oj-html-cca-count/cca-count_FAIL_1.html +0 -119
  592. package/tests/rules/oj-html-cca-tagname/ccatag_FAIL_1.html +0 -7
  593. package/tests/rules/oj-html-cca-tagname/ccatag_PASS_1.html +0 -7
  594. package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_1.html +0 -8
  595. package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_2.html +0 -8
  596. package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_3.html +0 -8
  597. package/tests/rules/oj-html-cca-tagname/tag_ns_PASS_1.html +0 -10
  598. package/tests/rules/oj-html-cdn/html_cdn_FAIL_1.html +0 -18
  599. package/tests/rules/oj-html-cspexpr/cspexpr_FAIL_1.html +0 -14
  600. package/tests/rules/oj-html-cspexpr/cspexpr_FAIL_2.html +0 -10
  601. package/tests/rules/oj-html-cspexpr/cspexpr_PASS_1.html +0 -23
  602. package/tests/rules/oj-html-cspexpr/cspexpr_PASS_2.html +0 -10
  603. package/tests/rules/oj-html-cspexpr/cspexpr_PASS_3.html +0 -13
  604. package/tests/rules/oj-html-dlg-title/dlgtitle_FAIL_1.html +0 -12
  605. package/tests/rules/oj-html-dlg-title/dlgtitle_PASS_1.html +0 -12
  606. package/tests/rules/oj-html-form-noflex/noflex_FAIL_1.html +0 -10
  607. package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_1.html +0 -20
  608. package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_2.html +0 -13
  609. package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_3.html +0 -16
  610. package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_4.html +0 -13
  611. package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_1.html +0 -6
  612. package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_2.html +0 -7
  613. package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_3.html +0 -7
  614. package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_1.html +0 -37
  615. package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_2.html +0 -34
  616. package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_3.html +0 -27
  617. package/tests/rules/oj-html-jq-databind/jq-databind_PASS_1.html +0 -30
  618. package/tests/rules/oj-html-ko-comment/ko-comment_FAIL_1.html +0 -47
  619. package/tests/rules/oj-html-ko-comment/ko-comment_FAIL_2.html +0 -36
  620. package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_1.html +0 -24
  621. package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_2.html +0 -36
  622. package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_3.html +0 -29
  623. package/tests/rules/oj-html-label-for-prefix/for_FAIL_1.html +0 -8
  624. package/tests/rules/oj-html-label-for-prefix/for_PASS_1.html +0 -8
  625. package/tests/rules/oj-html-missing-doctype/doctype_missing_FAIL_1.html +0 -12
  626. package/tests/rules/oj-html-missing-doctype/doctype_missing_FAIL_2.html +0 -11
  627. package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_1.html +0 -14
  628. package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_2.html +0 -5
  629. package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_3.html +0 -12
  630. package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_5.html +0 -6
  631. package/tests/rules/oj-html-nonvoid-close/close_FAIL_1.html +0 -28
  632. package/tests/rules/oj-html-nonvoid-close/close_FAIL_2.html +0 -14
  633. package/tests/rules/oj-html-nonvoid-close/close_FAIL_3.html +0 -13
  634. package/tests/rules/oj-html-nonvoid-close/close_FAIL_5.html +0 -28
  635. package/tests/rules/oj-html-nonvoid-close/close_FAIL_6.html +0 -28
  636. package/tests/rules/oj-html-nonvoid-close/close_PASS_1.html +0 -7
  637. package/tests/rules/oj-html-oj-lib/oj_lib_FAIL_1.html +0 -15
  638. package/tests/rules/oj-html-ojattr/ojattr_PASS_1.html +0 -8
  639. package/tests/rules/oj-html-ojattr/ojattr_PASS_2.html +0 -10
  640. package/tests/rules/oj-html-ojattr/ojattr_PASS_3.html +0 -7
  641. package/tests/rules/oj-html-ojattr/ojattr_PASS_4.html +0 -7
  642. package/tests/rules/oj-html-ojattr-deprecated/ojattr-dep_FAIL1.html +0 -156
  643. package/tests/rules/oj-html-ojattr-enum-deprecated/enum_FAIL_1.html +0 -19
  644. package/tests/rules/oj-html-ojattr-enum-deprecated/enum_FAIL_2.html +0 -20
  645. package/tests/rules/oj-html-ojattr-enum-deprecated/enum_PASS_1.html +0 -25
  646. package/tests/rules/oj-html-ojattr-evt-syntax/evt-attr-syntax_FAIL_1.html +0 -6
  647. package/tests/rules/oj-html-ojattr-evt-syntax/evt-attr-syntax_PASS_1.html +0 -6
  648. package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_1.html +0 -26
  649. package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_2.html +0 -26
  650. package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_3.html +0 -8
  651. package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_4.html +0 -8
  652. package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_5.html +0 -8
  653. package/tests/rules/oj-html-ojattr-value/attr-value_PASS_1.html +0 -26
  654. package/tests/rules/oj-html-ojattr-value/attr-value_PASS_2.html +0 -8
  655. package/tests/rules/oj-html-ojattr-value/attr-value_PASS_3.html +0 -7
  656. package/tests/rules/oj-html-ojattr-value/attr-value_PASS_6.html +0 -7
  657. package/tests/rules/oj-html-ojattr-value/attr-value_PASS_7.html +0 -10
  658. package/tests/rules/oj-html-ojattr-value/attr_value_PASS_4.html +0 -7
  659. package/tests/rules/oj-html-ojattr-value/attr_value_PASS_5.html +0 -9
  660. package/tests/rules/oj-html-ojslot/ojslot_FAIL_1.html +0 -11
  661. package/tests/rules/oj-html-ojslot/ojslot_PASS_1.html +0 -12
  662. package/tests/rules/oj-html-ojstyle/style_FAIL_1.html +0 -103
  663. package/tests/rules/oj-html-ojstyle/style_PASS_2.html +0 -7
  664. package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_1.html +0 -10
  665. package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_2.html +0 -18
  666. package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_3.html +0 -10
  667. package/tests/rules/oj-html-ojtag-datacmd/datacmd_PASS_1.html +0 -28
  668. package/tests/rules/oj-html-ojtag-datacmd/datacmd_PASS_2.html +0 -15
  669. package/tests/rules/oj-html-ojtag-datactx/datactx_FAIL_1.html +0 -14
  670. package/tests/rules/oj-html-ojtag-datactx/datactx_PASS_1.html +0 -14
  671. package/tests/rules/oj-html-ojtag-globattr-noprefix/globattr-noprefix_FAIL_1.html +0 -36
  672. package/tests/rules/oj-html-ojtag-nonglobattr-prefix/nonglobattr-prefix_FAIL_1.html +0 -26
  673. package/tests/rules/oj-html-slot-name/slot_name.FAIL_1.html +0 -24
  674. package/tests/rules/oj-html-slot-name/slot_name.FAIL_2.html +0 -46
  675. package/tests/rules/oj-html-slot-name/slot_name.FAIL_3.html +0 -10
  676. package/tests/rules/oj-html-slot-name/slot_name.PASS_1.html +0 -24
  677. package/tests/rules/oj-html-slot-name/slot_name.PASS_2.html +0 -39
  678. package/tests/rules/oj-html-slot-name/slot_name.PASS_3.html +0 -10
  679. package/tests/rules/oj-html-slot-name/slot_name_PASS_4.html +0 -16
  680. package/tests/rules/oj-html-slot-name/slot_name_PASS_5.html +0 -11
  681. package/tests/rules/oj-html-slot-name/slot_name_PASS_6.html +0 -14
  682. package/tests/rules/oj-html-slot-name/slot_name_PASS_7.html +0 -10
  683. package/tests/rules/oj-html-style/style_FAIL_1.html +0 -7
  684. package/tests/rules/oj-html-style/style_PASS_1.html +0 -12
  685. package/tests/rules/oj-html-style/style_PASS_2.html +0 -7
  686. package/tests/rules/oj-html-style-bp-color/color-FAIL_1.html +0 -17
  687. package/tests/rules/oj-html-style-bp-color/color-FAIL_2.html +0 -15
  688. package/tests/rules/oj-html-style-bp-color/color-FAIL_3.html +0 -7
  689. package/tests/rules/oj-html-style-bp-color/color-PASS_1.html +0 -7
  690. package/tests/rules/oj-html-style-bp-font-family/fam_FAIL_1.html +0 -23
  691. package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_FAIL_1.html +0 -15
  692. package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_FAIL_2.html +0 -9
  693. package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_PASS_1.html +0 -9
  694. package/tests/rules/oj-html-unsup-theme/unsup_FAIL_1.html +0 -8
  695. package/tests/rules/oj-html-wctag-for/for_FAIL_1.html +0 -8
  696. package/tests/rules/oj-html-wctag-for/for_PASS_1.html +0 -8
  697. package/tests/rules/oj-js-comp-attr-deprecated/attr-del_FAIL_1.js +0 -20
  698. package/tests/rules/oj-js-comp-attr-deprecated/attr-dep_FAIL_1.js +0 -20
  699. package/tests/rules/oj-js-comp-meth-deprecated/meth-del_FAIL_1.js +0 -20
  700. package/tests/rules/oj-js-comp-meth-deprecated/meth-dep_FAIL_1.js +0 -20
  701. package/tests/rules/oj-js-define-promise/def-prom_FAIL_1.js +0 -16
  702. package/tests/rules/oj-js-define-promise/def-prom_FAIL_2.js +0 -16
  703. package/tests/rules/oj-js-diagnose/es6_PASS_1.js +0 -24
  704. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_1.js +0 -30
  705. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_2.js +0 -23
  706. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_3.js +0 -22
  707. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_4.js +0 -20
  708. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_5.js +0 -24
  709. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_6.js +0 -30
  710. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_7.js +0 -15
  711. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_8.js +0 -16
  712. package/tests/rules/oj-js-no-ext-final/noextfinal_PASS_1.js +0 -17
  713. package/tests/rules/oj-js-no-ext-final/noextfinal_PASS_2.js +0 -17
  714. package/tests/rules/oj-js-noconsole/nocons_FAIL_1.js +0 -11
  715. package/tests/rules/oj-js-ojcomp-deprecated/jscomp_FAIL_1.js +0 -27
  716. package/tests/rules/oj-json-syntax/json_FAIL_1.json +0 -8
  717. package/tests/rules/oj-json-syntax/json_FAIL_2.json +0 -12
  718. package/tests/rules/oj-json-syntax/json_PASS_1.json +0 -25
  719. package/tests/rules/oj-json-syntax/json_PASS_2.json +0 -12
  720. package/tests/rules/oj-json-syntax/json_PASS_3.json +0 -14
  721. package/tests/rules/ojcompjson/attrreq_FAIL_1/component.json +0 -69
  722. package/tests/rules/pack-compjson/audit-pack/component-1/component-1-view.html +0 -6
  723. package/tests/rules/pack-compjson/audit-pack/component-1/component-1-viewModel.js +0 -56
  724. package/tests/rules/pack-compjson/audit-pack/component-1/component.json +0 -13
  725. package/tests/rules/pack-compjson/audit-pack/component-1/loader.js +0 -20
  726. package/tests/rules/pack-compjson/audit-pack/component-1/resources/nls/component-1-strings.js +0 -18
  727. package/tests/rules/pack-compjson/audit-pack/component-2/component-2-view.html +0 -5
  728. package/tests/rules/pack-compjson/audit-pack/component-2/component-2-viewModel.js +0 -56
  729. package/tests/rules/pack-compjson/audit-pack/component-2/component.json +0 -13
  730. package/tests/rules/pack-compjson/audit-pack/component-2/loader.js +0 -20
  731. package/tests/rules/pack-compjson/audit-pack/component-2/resources/nls/component-1-strings.js +0 -18
  732. package/tests/rules/pack-compjson/audit-pack/component.json +0 -12
  733. package/tests/rules/pack-compjson/audit-singleton-1/audit-singleton-1-view.html +0 -5
  734. package/tests/rules/pack-compjson/audit-singleton-1/audit-singleton-1-viewModel.js +0 -56
  735. package/tests/rules/pack-compjson/audit-singleton-1/component.json +0 -20
  736. package/tests/rules/pack-compjson/audit-singleton-1/loader.js +0 -20
  737. package/tests/rules/pack-compjson/audit-singleton-1/resources/nls/audit-singleton-1-strings.js +0 -18
  738. package/tests/rules/pack-compjson/audit-singleton-2/audit-singleton-2-view.html +0 -8
  739. package/tests/rules/pack-compjson/audit-singleton-2/audit-singleton-2-viewModel.js +0 -56
  740. package/tests/rules/pack-compjson/audit-singleton-2/component.json +0 -15
  741. package/tests/rules/pack-compjson/audit-singleton-2/loader.js +0 -20
  742. package/tests/rules/pack-compjson/audit-singleton-2/resources/nls/audit-singleton-2-strings.js +0 -18
  743. package/tests/rules/parse-html/proc_instr.html +0 -9
  744. package/tests/rules/spoc-dom-manip/dom-manip_FAIL_1.js +0 -113
  745. package/tests/rules/spoc-dom-manip/dom-manip_FAIL_2.js +0 -151
  746. package/tests/rules/spoc-dom-manip/dom-manip_PASS_1.js +0 -149
  747. package/tests/rules/spoc-dom-manip/dom-manip_PASS_2.js +0 -147
  748. package/tests/rules/spoc-dom-manip/dom-manip_PASS_3.js +0 -147
  749. package/tests/rules/spoc-dom-manip/dom-manip_PASS_4.js +0 -20
  750. package/tests/rules/spoc-dom-manip/dom-manip_PASS_5.js +0 -246
  751. package/tests/rules/tab-tests/tab-test_FAIL_1.html +0 -37
  752. package/tests/rules/tab-tests/tab-test_FAIL_2.html +0 -8
  753. package/tests/rules/webcomptests/jet-composites/oj-html-wctag-$props/prop_PASS_1.html +0 -8
  754. package/tests/rules/webcomptests/jet-composites/oj-html-wctag-$props/prop_PASS_2.html +0 -8
  755. package/tests/rules/webcomptests/jet-composites/oj-html-wctag-for/for_FAIL_1.html +0 -8
  756. package/tests/rules/webcomptests/jet-composites/oj-html-wctag-for/for_PASS_1.html +0 -8
  757. package/tests/src/JetTest.js +0 -1
  758. package/tests/src/server.js +0 -1
  759. package/tests/test.js +0 -1
@@ -1 +1 @@
1
- {"metaList":{"6.0.0":{"version":"6.0.1","date":"Friday Jul 12, 2019","time":"10:58am pdt"},"5.2.0":{"version":"5.2.3","date":"Friday Jul 12, 2019","time":"10:55am pdt"},"6.1.0":{"version":"6.1.3","date":"Friday Jul 12, 2019","time":"11:00am pdt"},"6.2.0":{"version":"6.2.2","date":"Friday Jul 12, 2019","time":"11:02am pdt"},"7.0.0":{"version":"7.0.1","date":"Friday Jul 12, 2019","time":"11:04am pdt"},"7.1.0":{"version":"7.1.0","date":"Friday Jul 12, 2019","time":"11:06am pdt"},"7.2.0":{"version":"7.2.0","date":"Sunday Feb 16, 2020","time":"10:13pm est"},"7.3.0":{"version":"7.3.0","date":"Tuesday May 05, 2020","time":"12:50am edt"},"8.0.0":{"version":"8.0.0","date":"Sunday Feb 16, 2020","time":"10:51pm est"},"8.1.0":{"version":"8.1.0","date":"Sunday Feb 16, 2020","time":"10:20pm est"},"8.2.0":{"version":"8.2.0","date":"Friday Apr 17, 2020","time":"1:08am utc"},"8.3.0":{"version":"8.3.0","date":"Monday May 04, 2020","time":"4:34pm edt"},"9.0.0":{"version":"9.0.0","date":"Friday Jun 12, 2020","time":"1:57am utc"},"9.1.0":{"version":"9.1.0","date":"Thursday Aug 06, 2020","time":"2:13am utc"},"9.2.0":{"version":"9.2.0","date":"Wednesday Oct 07, 2020","time":"5:41pm utc"},"10.0.0":{"version":"10.0.0","date":"Thursday Jan 07, 2021","time":"9:20pm utc"},"10.1.0":{"version":"10.1.0","date":"Saturday Apr 17, 2021","time":"4:01pm utc"}}}
1
+ {"metaList":{"6.0.0":{"version":"6.0.1","date":"Friday Jul 12, 2019","time":"10:58am pdt"},"5.2.0":{"version":"5.2.3","date":"Friday Jul 12, 2019","time":"10:55am pdt"},"6.1.0":{"version":"6.1.3","date":"Friday Jul 12, 2019","time":"11:00am pdt"},"6.2.0":{"version":"6.2.2","date":"Friday Jul 12, 2019","time":"11:02am pdt"},"7.0.0":{"version":"7.0.1","date":"Friday Jul 12, 2019","time":"11:04am pdt"},"7.1.0":{"version":"7.1.0","date":"Friday Jul 12, 2019","time":"11:06am pdt"},"7.2.0":{"version":"7.2.0","date":"Sunday Feb 16, 2020","time":"10:13pm est"},"7.3.0":{"version":"7.3.0","date":"Tuesday May 05, 2020","time":"12:50am edt"},"8.0.0":{"version":"8.0.0","date":"Sunday Feb 16, 2020","time":"10:51pm est"},"8.1.0":{"version":"8.1.0","date":"Sunday Feb 16, 2020","time":"10:20pm est"},"8.2.0":{"version":"8.2.0","date":"Friday Apr 17, 2020","time":"1:08am utc"},"8.3.0":{"version":"8.3.0","date":"Monday May 04, 2020","time":"4:34pm edt"},"9.0.0":{"version":"9.0.0","date":"Friday Jun 12, 2020","time":"1:57am utc"},"9.1.0":{"version":"9.1.0","date":"Thursday Aug 06, 2020","time":"2:13am utc"},"9.2.0":{"version":"9.2.0","date":"Wednesday Oct 07, 2020","time":"5:41pm utc"},"10.0.0":{"version":"10.0.0","date":"Thursday Jan 07, 2021","time":"9:20pm utc"},"10.1.0":{"version":"10.1.0","date":"Saturday Apr 17, 2021","time":"4:01pm utc"},"11.0.0":{"version":"11.0.0","date":"Friday Jul 02, 2021","time":"3:02am utc"},"11.1.0":{"version":"11.1.0","date":"Thursday Sep 30, 2021","time":"9:33pm utc"},"12.0.0":{"version":"12.0.0","date":"Friday Feb 04, 2022","time":"2:29am utc"}}}
package/package.json CHANGED
@@ -1,69 +1,72 @@
1
- {
2
- "name": "@oracle/oraclejet-audit",
3
- "version": "10.1.0",
4
- "description": "JET AUDIT FRAMEWORK",
5
- "main": "jaf.js",
6
- "files": [
7
- "jafconfig.json",
8
- "*.js",
9
- "html",
10
- "lib",
11
- "libext",
12
- "meta",
13
- "schema",
14
- "rulepacks",
15
- "rules",
16
- "src",
17
- "tests",
18
- "types"
19
- ],
20
- "scripts": {
21
- "start": "node jaf.js -e ",
22
- "test": "node ./tests/test.js -ut -c ./tests/config/config_base.json",
23
- "test-jetwc": "mocha ./tests/jetwc-tests/*.test.js",
24
- "test-jetwco": "mocha ./tests/jetwco-tests/*.test.js --timeout 20000",
25
- "build": "node ./build/build.js",
26
- "metadel": "node ./build/metadel.js",
27
- "buildmeta": "node ./build/metabuild.js --show"
28
- },
29
- "bin": {
30
- "ojaf": "./jaf.js"
31
- },
32
- "keywords": [
33
- "html",
34
- "css",
35
- "js",
36
- "json",
37
- "jet",
38
- "audit",
39
- "lint"
40
- ],
41
- "Jaf": {
42
- "version": "2.10.29"
43
- },
44
- "license": "UPL-1.0",
45
- "dependencies": {
46
- "@typescript-eslint/typescript-estree": "4.9.1",
47
- "adm-zip": "0.4.16",
48
- "ajv": "6.12.6",
49
- "css-tree": "1.0.0-alpha.39",
50
- "decache": "4.6.0",
51
- "espree": "7.3.1",
52
- "estraverse": "5.2.0",
53
- "glob": "7.1.6",
54
- "htmlparser2": "3.10.1",
55
- "md5": "2.3.0",
56
- "mock-http-server": "1.4.2",
57
- "parserlib": "1.1.1",
58
- "really-relaxed-json": "0.2.24",
59
- "semver": "6.3.0",
60
- "strip-json-comments": "2.0.1",
61
- "sync-request": "6.1.0",
62
- "tmp": "0.0.33",
63
- "typescript": "4.1.2"
64
- },
65
- "devDependencies": {
66
- "chai": "^4.2.0",
67
- "mocha": "^7.2.0"
68
- }
69
- }
1
+ {
2
+ "name": "@oracle/oraclejet-audit",
3
+ "version": "12.0.0",
4
+ "description": "JET AUDIT FRAMEWORK",
5
+ "main": "jaf.js",
6
+ "files": [
7
+ "jafconfig.json",
8
+ "*.js",
9
+ "html",
10
+ "lib",
11
+ "libext",
12
+ "meta",
13
+ "schema",
14
+ "rulepacks",
15
+ "rules",
16
+ "src",
17
+ "tests",
18
+ "types"
19
+ ],
20
+ "scripts": {
21
+ "start": "node jaf.js -e ",
22
+ "test": "node ./tests/test.js -ut -c ./tests/config/config_base.json",
23
+ "test-jetwc": "mocha ./tests/jetwc-tests/*.test.js --timeout 5000",
24
+ "test-jetwco": "mocha ./tests/jetwco-tests/*.test.js --timeout 20000",
25
+ "build": "node ./build/build.js",
26
+ "metadel": "node ./build/metadel.js",
27
+ "buildmeta": "node ./build/metabuild.js --show",
28
+ "test-oj-sample": "node ./tests/scripts/testCaseAudit oj-sample base",
29
+ "test-spectra": "node ./tests/scripts/testCaseAudit spectra-components base",
30
+ "test-cx-common": "node ./tests/scripts/testCaseAudit cx-common base"
31
+ },
32
+ "bin": {
33
+ "ojaf": "./jaf.js"
34
+ },
35
+ "keywords": [
36
+ "html",
37
+ "css",
38
+ "js",
39
+ "json",
40
+ "jet",
41
+ "audit",
42
+ "lint"
43
+ ],
44
+ "Jaf": {
45
+ "version": "3.12.4"
46
+ },
47
+ "license": "UPL-1.0",
48
+ "dependencies": {
49
+ "@typescript-eslint/typescript-estree": "4.9.1",
50
+ "adm-zip": "0.4.16",
51
+ "ajv": "6.12.6",
52
+ "css-tree": "1.0.0-alpha.39",
53
+ "decache": "4.6.0",
54
+ "espree": "7.3.1",
55
+ "glob": "7.1.6",
56
+ "htmlparser2": "3.10.1",
57
+ "markdown-it": "12.2.0",
58
+ "md5": "2.3.0",
59
+ "mock-http-server": "1.4.2",
60
+ "parserlib": "1.1.1",
61
+ "really-relaxed-json": "0.2.24",
62
+ "semver": "6.3.0",
63
+ "strip-json-comments": "2.0.1",
64
+ "sync-request": "6.1.0",
65
+ "tmp": "0.0.33",
66
+ "typescript": "4.1.2"
67
+ },
68
+ "devDependencies": {
69
+ "chai": "^4.2.0",
70
+ "mocha": "^7.2.0"
71
+ }
72
+ }
@@ -1 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const RULE_NAME="csp-html-script-unsafe-inline";const LONG_DESCRIPT="CSP-1020:<br>"+"Inline script blocks are considered to be CSP violation. The general solution is to use hashes or a nonce to allow inline scripts to run."+"<p>CSP-1021:<br>"+"The execution of a JS event handler from inline HTML markup is a CSP violation. e.g. onclick onload onmouseover onsubmit, etc.<p>"+"The general solution is to use <b>addEventListener()</b>. e.g.<p>"+" &nbsp; &nbsp; <b>&lt;button id=\"btn\" <b>onclick='doSomething()'&gt;</b><p>"+"can be replaced with<p>"+" &nbsp; &nbsp; document.getElementById(\"btn\")<b>.addEventListener('click', doSomething)</b>";const SHORT_DESCRIPT=LONG_DESCRIPT;const TYPE="type";const MIME_TEXT_HTML="text/html";const NONCE="nonce";const SRC="src";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(regCtx){return{"script":_fnScript,"tag":_fnElem}};function _fnScript(context){var o,a,issue;o=context.tagNode.attribs;for(a in o){if(a===SRC||a===NONCE||a===TYPE&&o[a]===MIME_TEXT_HTML){return}}issue=new context.Issue("inline <script> 'nonce' attribute required - CSP violation");issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context)};function _fnElem(context,elem){var node,attribs,attrib,issue,attrPos;node=context.node;if(!node||!node.attribs){return}attribs=node.attribs;for(attrib in attribs){if(!attrib.startsWith(":")&&attrib.startsWith("on")&&!attrib.startsWith("on-")){if(context.utils.DomUtils.isCommonEventAttr(attrib)){issue=new context.Issue("inline event handler '"+attrib+"' - CSP violation");attrPos=context.utils.DomUtils.getAttrPosition(context.data,context.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);issue.setMsgKey(context.ruleName+"_2");context.reporter.addIssue(issue,context)}}}};module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const RULE_NAME="csp-html-style-unsafe-inline";const LONG_DESCRIPT="<b>CSP-1030:</b><br>"+"Embedding styles into HTML using &lt;style&gt; tags is a CSP violation.<br>"+"For example, the following implementation will be blocked:<p>"+"<b>&lt;style&gt;<br>"+" &nbsp; &nbsp; #inline-style { background: red }<br>"+"&lt;/style&gt;</b><p>"+"The general solution is to extract the styles into a style sheet and reference it in the HTML using <b>&lt;link href=\". . .\"&gt;</b>"+"<b><p>CSP-1031:</b><br>"+"Setting a style attribute directly on element, e.g.<b>&lt;div style=\". . .\"&gt;</b> is a CSP violation.<p>"+"The general solution is to set properties directly on the element's style property, e.g.<br><b>element.style.display = \"none\"</b><p>"+"Alternatively, styles can be added by changing to a class and including the class in the HTML element.";const SHORT_DESCRIPT=LONG_DESCRIPT;function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(regCtx){return{"tag":_fnTag,"ojtag":_fnTag}};function _fnTag(context,tag){var attrs,attr,nonce,issue;if(tag==="style"){attrs=context.tagNode.attribs;if(attrs){for(attr in attrs){if(attr==="nonce"){nonce=true;break}}}if(!nonce){issue=new context.Issue("inline <style> element : 'nonce' not specified - CSP violation");issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context)}}_checkAttrs(context,tag);if(attrs){for(attr in attrs){if(attr==="nonce"){nonce=true;break}}}}function _checkAttrs(context,tag){var attrs,attr,issue,attrPos;attrs=context.tagNode.attribs;if(attrs){for(attr in attrs){if(attr==="style"){issue=new context.Issue("inline 'style' attribute on <"+tag+"> - CSP violation");attrPos=context.utils.DomUtils.getAttrPosition(context.data,context.node,attr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);issue.setMsgKey(context.ruleName+"_2");context.reporter.addIssue(issue,context)}}}};module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  var exprEval;const RULE_NAME="csp-html-unsafe-expr";const LONG_DESCRIPT="Attribute contains an expression that violates the Content Security Policy, and is not supported. Execution of the attribute's expression will be blocked.";const SHORT_DESCRIPT="Expressions of this format are unsupported if the content_security_policy does not have an exception for unsafe eval";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(regCtx){if(regCtx.runMode==="api"&&regCtx.VsCodeExtHint){if(exprEval){regCtx.decache(exprEval)}}exprEval=require("../../libext/expparser");exprEval=new exprEval;return{"attrexpr":_handle}};function _handle(context,attrName,attrValue){var p,issue,msg;attrValue=attrValue.trim();if(attrName.charAt(0)===":"){attrName=attrName.substring(1)}attrValue=attrValue.substring(2,attrValue.length-2);try{p=exprEval.parse(attrValue)}catch(e){msg=_cleanUp(e.message);issue=new context.Issue("Attribute '"+attrName+"' contains an expression that may not be compatible with all Content Security policies: "+msg);context.reporter.addIssue(issue,context)}};function _cleanUp(msg){msg=msg.replace("character","attribute value position");return msg}module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
- const RULE_NAME="csp-js-script-unsafe-eval";const LONG_DESCRIPT="CSP-1000:<br>Dynamically evaluated code is a security risk. "+"<b>eval()</b> executes the code it is passed with the privileges of the caller. If you run eval() with a string "+"that could be compromised by a malicious party, you may end up running malicious code on a user machine "+"with the permissions of your webpage/extension.<p>"+"CSP-1001:<br>A dynamically evaluated \"Function\" poses a security risk by allowing arbitrary JS execution "+"that can contain untrusted data. Strings passed to Function() may be constructed from user-provided or compromised "+"data. The data could thus contain arbitrary code supplied by an attacker, and used to inject content into the DOM.<p>"+"CSP-1002:<br>Using a string as the first argument to functions such as <b>setTimeout/setInterval</b> poses a security risk "+"by allowing arbitrary JS execution of untrusted data. Variants of the API that take a function as the first argument are permitted. "+"Where possible, remove the argument's delimiting quotes in calls such as<p>"+" &nbsp; &nbsp; <b>setTimeout(STRING, delay)</b><p>"+"and wrap the content in a function e.g.<p>"+" &nbsp; &nbsp; <b>(setTimeout(function() { CODE }, delay) )</b><p>"+"When this is not possible, the code can be wrapped in a function and served in a .js file.";const SHORT_DESCRIPT=LONG_DESCRIPT;const FUNC_EXPR="FunctionExpression";const ARROW_FUNC_EXPR="ArrowFunctionExpression";const IDENTIFIER="Identifier";const LITERAL="Literal";const BLOCK_STMT="BlockStatement";const CALL_EXPR="CallExpression";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(regCtx){return{CallExpression:_fn,NewExpression:_fn}};function _fn(context,node){_checkEval(context,node);_checkFunction(context,node);_checkTimer(context,node)};function _checkEval(context,node){var callee,obj,issue;if(node.callee){callee=node.callee;obj=callee.property?callee.property:callee;if(obj.name==="eval"){if(!callee.object){issue=new context.Issue("eval() found - CSP violation");issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context)}}}};function _checkFunction(context,node){var obj,issue;if(node.callee){obj=node.callee.property?node.callee.property:node.callee;if(obj.type===IDENTIFIER&&obj.name==="Function"){issue=new context.Issue("Use of Function() - CSP violation");issue.setMsgKey(context.ruleName+"_2");context.reporter.addIssue(issue,context)}}};function _checkTimer(context,node){var obj,funcName,issue;if(node.callee){obj=node.callee.property?node.callee.property:node.callee;funcName=obj.name;if(funcName==="setTimeout"||funcName==="setInterval"){issue=_checkTimerFuncs(context,node,funcName);if(issue){issue.setMsgKey(context.ruleName+"_3");context.reporter.addIssue(issue,context)}}}};function _checkTimerFuncs(context,node,funcName){var obj,callee,args,arg,issue;callee=node.callee;obj=callee.property?callee.property:callee;if(obj.type===IDENTIFIER){if(node.arguments){args=node.arguments;if(args.length>=1){arg=args[0];if(arg.type!==FUNC_EXPR&&arg.type!==ARROW_FUNC_EXPR){if(arg.type!==CALL_EXPR&&arg.type!="NewExpression"){if(arg.type===LITERAL||_isIdentAString(node,arg.name)){issue=new context.Issue("function "+funcName+"() - first argument CSP violation")}}}}}}return issue};function _isIdentAString(node,ident){var n,decls,decl,i,j,s,isFunc=false;node=node.parent;while(node){if(!node){break}if(node.type!==BLOCK_STMT){if(node.type!=="Program"){node=node.parent;continue}for(i=0;i<node.body.length;i++){n=node.body[i];if(n.type==="FunctionDeclaration"){if(n.id&&n.id.type===IDENTIFIER&&n.id.name===ident){return false}}}}if(node.body){for(i=0;i<node.body.length;i++){n=node.body[i];if(n.type==="VariableDeclaration"){decls=n.declarations;if(decls&&decls.length){for(j=0;j<decls.length;j++){decl=decls[j];if(decl.type==="VariableDeclarator"){if(decl.id&&decl.id.type===IDENTIFIER&&decl.id.name===ident){if(decl.init){if(decl.init.type===LITERAL){s=decl.init.raw.charAt(0);if(s==="\""||s==="'"){return true}}}return false}}}}}}}node=node.parent}return false};module.exports={getName,getDescription,getShortDescription,register};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="csp-js-script-unsafe-eval";const LONG_DESCRIPT="CSP-1000:<br>Dynamically evaluated code is a security risk. "+"<b>eval()</b> executes the code it is passed with the privileges of the caller. If you run eval() with a string "+"that could be compromised by a malicious party, you may end up running malicious code on a user machine "+"with the permissions of your webpage/extension.<p>"+"CSP-1001:<br>A dynamically evaluated \"Function\" poses a security risk by allowing arbitrary JS execution "+"that can contain untrusted data. Strings passed to Function() may be constructed from user-provided or compromised "+"data. The data could thus contain arbitrary code supplied by an attacker, and used to inject content into the DOM.<p>"+"CSP-1002:<br>Using a string as the first argument to functions such as <b>setTimeout/setInterval</b> poses a security risk "+"by allowing arbitrary JS execution of untrusted data. Variants of the API that take a function as the first argument are permitted. "+"Where possible, remove the argument's delimiting quotes in calls such as<p>"+" &nbsp; &nbsp; <b>setTimeout(STRING, delay)</b><p>"+"and wrap the content in a function e.g.<p>"+" &nbsp; &nbsp; <b>(setTimeout(function() { CODE }, delay) )</b><p>"+"When this is not possible, the code can be wrapped in a function and served in a .js file.";const SHORT_DESCRIPT=LONG_DESCRIPT;const FUNC_EXPR="FunctionExpression";const ARROW_FUNC_EXPR="ArrowFunctionExpression";const IDENTIFIER="Identifier";const LITERAL="Literal";const BLOCK_STMT="BlockStatement";const CALL_EXPR="CallExpression";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{CallExpression:_fn,NewExpression:_fn}};function _fn(context,node){_checkEval(context,node);_checkFunction(context,node);_checkTimer(context,node)};function _checkEval(context,node){var callee,obj,issue;if(node.callee){callee=node.callee;obj=callee.property?callee.property:callee;if(obj.name==="eval"){if(!callee.object){issue=new context.Issue("eval() found - CSP violation");issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context)}}}};function _checkFunction(context,node){var obj,issue;if(node.callee){obj=node.callee.property?node.callee.property:node.callee;if(obj.type===IDENTIFIER&&obj.name==="Function"){issue=new context.Issue("Use of Function() - CSP violation");issue.setMsgKey(context.ruleName+"_2");context.reporter.addIssue(issue,context)}}};function _checkTimer(context,node){var obj,funcName,issue;if(node.callee){obj=node.callee.property?node.callee.property:node.callee;funcName=obj.name;if(funcName==="setTimeout"||funcName==="setInterval"){issue=_checkTimerFuncs(context,node,funcName);if(issue){issue.setMsgKey(context.ruleName+"_3");context.reporter.addIssue(issue,context)}}}};function _checkTimerFuncs(context,node,funcName){var obj,callee,args,arg,issue;callee=node.callee;obj=callee.property?callee.property:callee;if(obj.type===IDENTIFIER){if(node.arguments){args=node.arguments;if(args.length>=1){arg=args[0];if(arg.type!==FUNC_EXPR&&arg.type!==ARROW_FUNC_EXPR){if(arg.type!==CALL_EXPR&&arg.type!="NewExpression"){if(arg.type===LITERAL||_isIdentAString(node,arg.name)){issue=new context.Issue("function "+funcName+"() - first argument CSP violation")}}}}}}return issue};function _isIdentAString(node,ident){var n,decls,decl,i,j,s,isFunc=false;node=node.parent;while(node){if(!node){break}if(node.type!==BLOCK_STMT){if(node.type!=="Program"){node=node.parent;continue}for(i=0;i<node.body.length;i++){n=node.body[i];if(n.type==="FunctionDeclaration"){if(n.id&&n.id.type===IDENTIFIER&&n.id.name===ident){return false}}}}if(node.body){for(i=0;i<node.body.length;i++){n=node.body[i];if(n.type==="VariableDeclaration"){decls=n.declarations;if(decls&&decls.length){for(j=0;j<decls.length;j++){decl=decls[j];if(decl.type==="VariableDeclarator"){if(decl.id&&decl.id.type===IDENTIFIER&&decl.id.name===ident){if(decl.init){if(decl.init.type===LITERAL){s=decl.init.raw.charAt(0);if(s==="\""||s==="'"){return true}}}return false}}}}}}}node=node.parent}return false};module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const RULE_NAME="csp-js-style-unsafe-inline";const LONG_DESCRIPT="Styles applied in JavaScript by setting the style attribute directly using setAttribute() are a CSP violation. "+"Style properties that are set directly on an element's style property permit safe style manipulation in JavaScript. e.g. in place of<p>"+" &nbsp; &nbsp; elem<b>.setAttribute</b>('style', 'background-color : red;')<p>"+"use<p>"+" &nbsp; &nbsp; elem<b>.style</b>.backgroundColor = 'red';";const SHORT_DESCRIPT=LONG_DESCRIPT;function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(regCtx){return{CallExpression:_fnCall}};function _fnCall(context,node){var callee,meth,args,arg,issue;callee=node.callee;if(callee.property&&callee.property.type==="Identifier"){meth=callee.property.name;if(meth==="setAttribute"||meth==="attr"){args=node.arguments;if(meth==="attr"&&args.length<2){return}arg=args[0];if(arg.type==="Literal"&&arg.value==="style"){if(meth==="setAttribute"||_isKO(node)){issue=new context.Issue("setAttribute('style') - CSP violation");context.reporter.addIssue(issue,context)}}}}};function _isKO(node){var callee=node.callee;var o=callee.object;return o&&o.callee&&o.callee.type==="Identifier"&&o.callee.name==="$"}module.exports={getName,getDescription,getShortDescription,register};
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="csp-ts-script-unsafe-eval";const LONG_DESCRIPT="CSP-1000:<br>Dynamically evaluated code is a security risk. "+"<b>eval()</b> executes the code it is passed with the privileges of the caller. If you run eval() with a string "+"that could be compromised by a malicious party, you may end up running malicious code on a user machine "+"with the permissions of your webpage/extension.<p>"+"CSP-1001:<br>A dynamically evaluated \"Function\" poses a security risk by allowing arbitrary JS execution "+"that can contain untrusted data. Strings passed to Function() may be constructed from user-provided or compromised "+"data. The data could thus contain arbitrary code supplied by an attacker, and used to inject content into the DOM.<p>"+"CSP-1002:<br>Using a string as the first argument to functions such as <b>setTimeout/setInterval</b> poses a security risk "+"by allowing arbitrary JS execution of untrusted data. Variants of the API that take a function as the first argument are permitted. "+"Where possible, remove the argument's delimiting quotes in calls such as<p>"+" &nbsp; &nbsp; <b>setTimeout(STRING, delay)</b><p>"+"and wrap the content in a function e.g.<p>"+" &nbsp; &nbsp; <b>(setTimeout(function() { CODE }, delay) )</b><p>"+"When this is not possible, the code can be wrapped in a function and served in a .js file.";const SHORT_DESCRIPT=LONG_DESCRIPT;const FUNC_EXPR="FunctionExpression";const ARROW_FUNC_EXPR="ArrowFunctionExpression";const IDENTIFIER="Identifier";const LITERAL="Literal";const BLOCK_STMT="BlockStatement";const CALL_EXPR="CallExpression";var _scopes;function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{CallExpression:_fn,NewExpression:_fn,endfile:_onEndFile}};function _fn(ruleCtx,node){_checkEval(ruleCtx,node);_checkFunction(ruleCtx,node);_checkTimer(ruleCtx,node)};function _checkEval(ruleCtx,node){var callee,obj,issue;if(node.callee){callee=node.callee;obj=callee.property?callee.property:callee;if(obj.name==="eval"){if(!callee.object){issue=new ruleCtx.Issue("eval() found - CSP violation");issue.setMsgKey(ruleCtx.ruleName+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _checkFunction(ruleCtx,node){var obj,issue;if(node.callee){obj=node.callee.property?node.callee.property:node.callee;if(obj.type===IDENTIFIER&&obj.name==="Function"){issue=new ruleCtx.Issue("Use of Function() - CSP violation");issue.setPosition(null,null,obj.range[0],obj.range[1]);issue.setMsgKey(ruleCtx.ruleName+"_2");ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _checkTimer(ruleCtx,node){var obj,funcName,issue;if(node.callee){obj=node.callee.property?node.callee.property:node.callee;funcName=obj.name;if(funcName==="setTimeout"||funcName==="setInterval"){issue=_checkTimerFuncs(ruleCtx,node,funcName);if(issue){issue.setMsgKey(ruleCtx.ruleName+"_3");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _onEndFile(){_scopes=null};function _checkTimerFuncs(ruleCtx,node,funcName){var obj,callee,args,arg,issue;callee=node.callee;obj=callee.property?callee.property:callee;if(obj.type===IDENTIFIER){if(node.arguments){args=node.arguments;if(args.length>=1){arg=args[0];if(arg.type!==FUNC_EXPR&&arg.type!==ARROW_FUNC_EXPR){if(arg.type!==CALL_EXPR&&arg.type!="NewExpression"){if(arg.type===IDENTIFIER){if(!this._scopes){_scopes=ruleCtx.utils.AstUtils.getScopes()}if(_scopes.getVarType(arg)==="TSStringType"){issue=true}}else if(arg.type===LITERAL||_isIdentAString(node,arg.name)){issue=true}if(issue){issue=new ruleCtx.Issue("function "+funcName+"() - first argument CSP violation")}}}}}}return issue};function _isIdentAString(node,ident){var n,decls,decl,i,j,s,isFunc=false;node=node.parent;while(node){if(!node){break}if(node.type!==BLOCK_STMT){if(node.type!=="Program"){node=node.parent;continue}for(i=0;i<node.body.length;i++){n=node.body[i];if(n.type==="FunctionDeclaration"){if(n.id&&n.id.type===IDENTIFIER&&n.id.name===ident){return false}}}}if(node.body){for(i=0;i<node.body.length;i++){n=node.body[i];if(n.type==="VariableDeclaration"){decls=n.declarations;if(decls&&decls.length){for(j=0;j<decls.length;j++){decl=decls[j];if(decl.type==="VariableDeclarator"){if(decl.id&&decl.id.type===IDENTIFIER&&decl.id.name===ident){if(decl.init){if(decl.init.type===LITERAL){s=decl.init.raw.charAt(0);if(s==="\""||s==="'"){return true}}}return false}}}}}}}node=node.parent}return false};module.exports={getName,getDescription,getShortDescription,register};
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="csp-ts-style-unsafe-inline";const LONG_DESCRIPT="Styles applied in JavaScript by setting the style attribute directly using setAttribute() are a CSP violation. "+"Style properties that are set directly on an element's style property permit safe style manipulation in JavaScript. e.g. in place of<p>"+" &nbsp; &nbsp; elem<b>.setAttribute</b>('style', 'background-color : red;')<p>"+"use<p>"+" &nbsp; &nbsp; elem<b>.style</b>.backgroundColor = 'red';";const SHORT_DESCRIPT=LONG_DESCRIPT;var _scopes;function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{CallExpression:_fnCall}};function _fnCall(ruleCtx,node){var callee,meth,args,arg,issue;callee=node.callee;if(callee.property&&callee.property.type==="Identifier"){meth=callee.property.name;if(meth==="setAttribute"||meth==="attr"){args=node.arguments;if(meth==="attr"&&args.length<2){return}arg=args[0];if(arg.value==="style"){if(arg.type==="Literal"){if(meth==="setAttribute"||_isKO(node)){issue=true}}}if(issue){issue=new ruleCtx.Issue("setAttribute('style') - CSP violation");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _isKO(node){var callee=node.callee;var o=callee.object;return o&&o.callee&&o.callee.type==="Identifier"&&o.callee.name==="$"};module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
- {"csp-js-script-unsafe-eval_1":"1000","csp-js-script-unsafe-eval_2":"1001","csp-js-script-unsafe-eval_3":"1002","csp-js-style-unsafe-inline":"1010","csp-html-script-unsafe-inline_1":"1020","csp-html-script-unsafe-inline_2":"1021","csp-html-style-unsafe-inline_1":"1030","csp-html-style-unsafe-inline_2":"1031","csp-html-unsafe-expr":"1040"}
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ {"csp-js-script-unsafe-eval_1":"1000","csp-js-script-unsafe-eval_2":"1001","csp-js-script-unsafe-eval_3":"1002","csp-js-style-unsafe-inline":"1010","csp-html-script-unsafe-inline_1":"1020","csp-html-script-unsafe-inline_2":"1021","csp-html-style-unsafe-inline_1":"1030","csp-html-style-unsafe-inline_2":"1031","csp-html-unsafe-expr":"1040","csp-ts-script-unsafe-eval_1":"1100","csp-ts-script-unsafe-eval_2":"1101","csp-ts-script-unsafe-eval_3":"1102","csp-ts-style-unsafe-inline":"1110"}
@@ -1 +1,6 @@
1
- {"title":"CSP Builtin Rulepack","version":"1.0.0","prefix":"CSP","rules":{"csp-js-script-unsafe-eval":{"severity":"major","filetype":"js","group":["jet-js","jet-html","jet-csp"],"status":"ready"},"csp-html-script-unsafe-inline":{"severity":"major","filetype":"html","group":["jet-html","jet-csp"],"status":"ready"},"csp-html-style-unsafe-inline":{"severity":"major","filetype":"html","group":["jet-html","jet-csp"],"status":"ready"},"csp-js-style-unsafe-inline":{"severity":"major","filetype":"js","group":["jet-js","jet-html","jet-csp"],"status":"ready"},"csp-html-unsafe-expr":{"severity":"blocker","filetype":"html","group":["jet-html","jet-csp"],"status":"ready"}}}
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ {"title":"CSP Builtin Rulepack","version":"1.1.0","prefix":"CSP","rules":{"csp-js-script-unsafe-eval":{"severity":"major","filetype":"js","group":["jet-js","jet-html","jet-csp"],"status":"production"},"csp-ts-script-unsafe-eval":{"severity":"major","filetype":["ts","tsx"],"group":["jet-ts","jet-tsx","jet-csp"],"amd":false,"status":"production"},"csp-html-script-unsafe-inline":{"severity":"major","filetype":"html","group":["jet-html","jet-csp"],"status":"production"},"csp-html-style-unsafe-inline":{"severity":"major","filetype":"html","group":["jet-html","jet-csp"],"status":"production"},"csp-js-style-unsafe-inline":{"severity":"major","filetype":"js","group":["jet-js","jet-html","jet-csp"],"status":"production"},"csp-ts-style-unsafe-inline":{"severity":"major","filetype":["ts","tsx"],"group":["jet-js","jet-tsx","jet-csp"],"amd":false,"status":"production"},"csp-html-unsafe-expr":{"severity":"blocker","filetype":"html","group":["jet-html","jet-csp"],"status":"production"}}}
@@ -1 +1,6 @@
1
- const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-absolute-jetversion'};ruleDef.prototype.getShortDescription=function(){return'Verify support for some range of JET versions'};ruleDef.prototype.getDescription=function(){return'This rule checks that a component has not be hard-wired to a specific version of JET - e.g. specifies some form of range at least'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);if(context.suppData.obj.jetVersion){if(context.utils.semVerUtils.isValid(meta.jetVersion)){issue=new context.Issue(`Component ${fullName} is hardwired to a specific JET version (${meta.jetVersion}), not a range`,'0035');context.reporter.addIssue(issue,context,'minor')}}}};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const TsxUtils=require('../jetwc-lib/jetwcutils-tsxUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-absolute-jetversion'};ruleDef.prototype.getShortDescription=function(){return'Verify support for some range of JET versions'};ruleDef.prototype.getDescription=function(){return'This rule checks that a component has not be hard-wired to a specific version of JET - e.g. specifies some form of range at least'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit,Program:this._doVComponentAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);if(context.suppData.obj.jetVersion){this._versionCheck(context,fullName,meta.jetVersion)}}};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);if(componentInfo&&componentInfo.jetVersion){this._versionCheck(context,componentInfo.fullName,componentInfo.jetVersion)}};ruleDef.prototype._versionCheck=function(context,fullName,version){if(context.utils.semVerUtils.isValid(version)){const issue=new context.Issue(`Component ${fullName} is hardwired to a specific JET version (${version}), not a range`);context.reporter.addIssue(issue,context)}};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-aria-redefinition'};ruleDef.prototype.getShortDescription=function(){return'Ensure that the component does not re-define any WAI-ARIA properties'};ruleDef.prototype.getDescription=function(){return'This rule checks that a component has not overridden or tries to introduce (any custom) WAI-ARIA attributes'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'&&meta.properties){const ariaDetect=/^aria[A-Z\-].*$/;Object.keys(meta.properties).forEach(propName=>{if(ariaDetect.test(propName)){issue=new context.Issue(`Component ${fullName} defines a WAI-ARIA property ${propName} which is not allowed`,'0088');context.reporter.addIssue(issue,context,'minor')}})}}};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const TsxUtils=require('../jetwc-lib/jetwcutils-tsxUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-aria-redefinition'};ruleDef.prototype.getShortDescription=function(){return'Ensure that the component does not re-define any WAI-ARIA properties'};ruleDef.prototype.getDescription=function(){return'This rule checks that a component has not overridden or tries to introduce (any custom) WAI-ARIA attributes'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit,Program:this._doVComponentAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'){this._checkProps(context,fullName,meta.properties)}}};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);if(componentInfo){this._checkProps(context,componentInfo.fullName,componentInfo.properties)}};ruleDef.prototype._checkProps=function(context,fullName,properties){let issue;if(properties){const ariaDetect=/^aria[A-Z\-].*$/;Object.keys(properties).forEach(propName=>{if(ariaDetect.test(propName)){issue=new context.Issue(`Component ${fullName} defines a WAI-ARIA property ${propName} which is not allowed`);context.reporter.addIssue(issue,context)}})}};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-bootstrap'};ruleDef.prototype.getShortDescription=function(){return'Bootstrap processing for the JETWC rulset'};ruleDef.prototype.getDescription=function(){return'This rule is for internal use by the ruleset and should not be disabled'};ruleDef.prototype.register=function(context){this.componentRoots=context.config.components;this.jetConfig=context.ojetConfig;return{startupRP:this._getAllVisibleComponents,closedownRP:this._reportDiagnostics}};ruleDef.prototype._getAllVisibleComponents=function(context){console.info(`${context.rulePack.getPackInfo().prefix} : ${context.rulePack.getPackInfo().version}`);const auditBuildOutput=context.rulePack.getRuleOptions().auditBuildOutput;const componentRootFolder=context.rulePack.getRuleOptions().componentRoot||'jet-composites';let masterComponentList=[];let jsroot;let tsroot;if(this.jetConfig){let generalSourceRoot;if(!auditBuildOutput){generalSourceRoot=this.jetConfig.paths.source.common||'src';const tssrc=this.jetConfig.paths.source.typescript||'ts';tsroot=Utils.toJAFPath(path.join(generalSourceRoot,tssrc))}else{generalSourceRoot=this.jetConfig.paths.staging.web||'web'}const jssrc=this.jetConfig.paths.source.javascript||'js';jsroot=Utils.toJAFPath(path.join(generalSourceRoot,jssrc));if(this.jetConfig&&this.jetConfig.components){masterComponentList=masterComponentList.concat(this._getComponents('jet_components',false,false,context))}}if(this.componentRoots&&this.componentRoots.length>0){this.componentRoots.forEach(root=>{masterComponentList=masterComponentList.concat(this._getComponents(root,true,auditBuildOutput,context))})}else{if(jsroot){masterComponentList=masterComponentList.concat(this._getComponents(Utils.toJAFPath(path.join(jsroot,componentRootFolder)),true,auditBuildOutput,context))}if(tsroot){masterComponentList=masterComponentList.concat(this._getComponents(Utils.toJAFPath(path.join(tsroot,componentRootFolder)),true,false,context))}}const allComponentsMap=masterComponentList.reduce((wmap,component)=>{if(!auditBuildOutput||auditBuildOutput&&!wmap.has(component.fullName)){wmap.set(component.fullName,component)}return wmap},new Map);const referenceComponents=new Map;const componentPaths=new Map;allComponentsMap.forEach(component=>{if(tsroot){component.language=component.rootFolder.startsWith(tsroot)?'ts':'js'}else{const pathSegs=component.rootFolder.split('/');if(pathSegs.includes('ts')||pathSegs.includes('TS')){component.language='ts'}else{component.language='js'}}switch(component.type){case'reference':referenceComponents.set(component.fullName,component.ba);break;case'composite':case'resource':if(component.local){if(component.dependencies){Object.values(component.dependencies).forEach(dependencyName=>{if(allComponentsMap.has(dependencyName)){const proxyPaths=allComponentsMap.get(dependencyName).requirePaths;proxyPaths.forEach(path=>{component.requirePaths.add(path)})}})}componentPaths.set(component.rootFolder,component.fullName)}break;}});context.rulePack.setExtension({rulepackVersion:context.rulePack.getPackInfo().version,platform:Utils.isWindows?'Windows':'Unix-like',componentHome:`/${componentRootFolder}/`,auditBuildOutput:auditBuildOutput,componentRoots:this.componentRoots,allReferenceComponents:referenceComponents,allComponents:allComponentsMap,auditableComponentPaths:componentPaths,allAuditableFilePaths:new Map})};ruleDef.prototype._getComponents=function(rootDir,isLocal,builtOutput,auditContext){let componentArray=[];if(auditContext.utils.fsUtils.pathExistsSync(rootDir)){const compFileStructure=auditContext.utils.fsUtils.readDir(rootDir);compFileStructure.forEach(l1file=>{let componentInfo;if(!l1file.isFile&&l1file.files.length>0){l1file.files.forEach(l2file=>{if(!builtOutput){if(l2file.isFile&&l2file.name==='component.json'){componentInfo=Utils.extractComponentInfoFromJSONFile(auditContext,path.join(rootDir,l1file.name),'component.json',isLocal);componentArray.push(componentInfo);if(componentInfo.type==='pack'){const packMembers=this._getComponents(Utils.toJAFPath(path.join(rootDir,l1file.name)),isLocal,false,auditContext);componentArray=componentArray.concat(packMembers)}}}else{if(!l2file.isFile&&l2file.files.length>0){l2file.files.forEach(l3file=>{if(l3file.isFile&&l3file.name==='component.json'){componentInfo=Utils.extractComponentInfoFromJSONFile(auditContext,path.join(rootDir,l1file.name,l2file.name),'component.json',isLocal);if(!componentInfo.pack){componentArray.push(componentInfo);if(componentInfo.type==='pack'){const packMembers=this._getComponents(Utils.toJAFPath(path.join(rootDir,l1file.name,l2file.name)),isLocal,false,auditContext);componentArray=componentArray.concat(packMembers)}}}})}}})}})}return componentArray};ruleDef.prototype._reportDiagnostics=function(context){const opts=context.rulePack.getRuleOptions();if(opts.debug&&opts.diagnosticFile){console.log(`Writing JETWC diagnostics to ${opts.diagnosticFile}.json`);const dFile=Utils.toJAFPath(path.join(path.resolve('.'),opts.diagnosticFile+'.json'));context.utils.fsUtils.writeJsonSync(context.rulePack.getExtension(),dFile,{spaces:2,replacer:Utils.diagnosticReplacer})}};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const path=require('path');const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const componentFinder=require('../jetwc-lib/jetwcutils-componentFinder');const TsxUtils=require('../jetwc-lib/jetwcutils-tsxUtils');const preCompiler=require('../jetwc-lib/jetwcutils-preCompiler');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-bootstrap'};ruleDef.prototype.getShortDescription=function(){return'Bootstrap processing for the JETWC rulset'};ruleDef.prototype.getDescription=function(){return'This rule is for internal use by the ruleset and should not be disabled'};ruleDef.prototype.register=function(context){this.componentRoots=context.config.components;this.auditBase=context.config.base;this.typeScriptCompile=context.config.typescript&&context.config.typescript.compile;return{startupRP:this._getAllVisibleComponents,closedownRP:this._reportDiagnostics}};ruleDef.prototype._getAllVisibleComponents=function(context){const{msgLib}=context.utils;msgLib.info(`builtinJetWcRules (${context.rulePack.getPackInfo().prefix}): ${context.rulePack.getPackInfo().version}`);const projectPathInfo=Utils.getKeyPathInfoForRulepack(context,this.auditBase);const componentRootFolder=context.rulePack.getRuleOptions().componentRoot||projectPathInfo.componentRootFolder;let precompileCache;if(this.typeScriptCompile){precompileCache=preCompiler.getPrecompileCacheIfNeeded(context,this.auditBase,projectPathInfo.tsSource,projectPathInfo.componentRootFolder)}const masterComponentList=componentFinder.findAllComponents(context,projectPathInfo,this.componentRoots,precompileCache);if(masterComponentList&&masterComponentList.length>0){const allComponentsMap=masterComponentList.reduce((wmap,component)=>{if(!projectPathInfo.isBuiltOutput||projectPathInfo.isBuiltOutput&&!wmap.has(component.fullName)){wmap.set(component.fullName,component)}return wmap},new Map);const referenceComponents=new Map;const componentPaths=new Map;allComponentsMap.forEach(component=>{component.language=Utils.detectComponentSourceType(context,component.rootFolder,component.vcomponent);switch(component.type){case'reference':referenceComponents.set(component.fullName,component.ba);break;case'composite':case'resource':if(component.local){if(component.dependencies){Object.values(component.dependencies).forEach(dependency=>{if(allComponentsMap.has(dependency.name)){const proxyPaths=allComponentsMap.get(dependency.name).requirePaths;proxyPaths.forEach(path=>{component.requirePaths.add(path)})}else{msgLib.debug(`JETWC: missing dependency lookup for ${dependency.name} when resolving requirePaths`)}})}componentPaths.set(component.rootFolder,component.fullName)}break;}});context.rulePack.setExtension({rulepackVersion:context.rulePack.getPackInfo().version,bootStrap:true,platform:Utils.isWindows?'Windows':'Unix-like',precompiled:this.typeScriptCompile,componentHome:`/${componentRootFolder}/`,auditBuildOutput:projectPathInfo.isBuiltOutput,discoveredPaths:projectPathInfo,componentRoots:this.componentRoots,allReferenceComponents:referenceComponents,allComponents:allComponentsMap,auditableComponentPaths:componentPaths,allAuditableFilePaths:new Map})}else{msgLib.error(`No components have been discovered from the JAF configuration for the ${context.rulePack.getPackInfo().prefix} ruleset to process. You will need to configure the "components" array to point at your component root folder`);Utils.disableRulePack(context)}};ruleDef.prototype._reportDiagnostics=function(context){const msg=context.utils.msgLib;const opts=context.rulePack.getRuleOptions();const diagnostics=context.rulePack.getExtension();if(!opts.testMode){let foundVMMapping=0;let candidateLocal=0;if(diagnostics&&diagnostics.allComponents&&diagnostics.allComponents.length>0){diagnostics.allComponents.forEach((component,compName)=>{if(component.local&&component.type==='composite'){candidateLocal++;if(component.viewModel&&component.viewModel.resolved){foundVMMapping++}}});if(foundVMMapping!==candidateLocal){msgLib.error(`Error: Audit was only able to map ${foundVMMapping} out of ${candidateLocal} components to their viewModels. Some audits will be unable to operate.`)}}}if(opts.debug&&opts.diagnosticFile&&diagnostics){msgLib.msg(`Writing JETWC diagnostics to ${opts.diagnosticFile}.json`);const dFile=Utils.toJAFPath(path.join(path.resolve('.'),opts.diagnosticFile+'.json'));context.utils.fsUtils.writeJsonSync(diagnostics,dFile,{spaces:2,replacer:Utils.diagnosticReplacer})}};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const helperPos=require('../../rules/jet/helpers/json-propname-pos');const helperProp=require('../../rules/jet/helpers/bp-checkPropType');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-compjson-bp-ar'};ruleDef.prototype.getShortDescription=function(){return'Web component component.json metadata should follow best practices and avoid plain \'array\' type properties'};ruleDef.prototype.getDescription=function(){return'For best practices, web components should avoid use of unqualified property type \'array\', and provide a more complete definition of the API using a closure type definition'};ruleDef.prototype.register=function(context){if(context.rulePack.isRuleEnabled('oj-cca-compjson-bp-ar','JET')){return false}else{return{compjson:this._doAudit}}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const componentName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'){const properties=meta.properties;if(properties){const arrayProps=helperProp(properties,'a');if(arrayProps){for(let i=0;i<arrayProps.length;i++){const checkProperty=arrayProps[i];const checkPropertyType=Utils.getPropertyAttributeFromPath(context,componentName,checkProperty,'type');if(checkPropertyType.toLowerCase()==='array'){if(!Utils.shouldIgnoreCheck(context,'jetwc-compjson-bp-ar',componentName,'properties',checkProperty)){const issue=new context.Issue(`property '${checkProperty}' is defined with unqualified type 'array'. Provide a more complete API definition using a closure type definition.`,'0102');const pos=helperPos(context,checkProperty);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+6:0);context.reporter.addIssue(issue,context,'info')}}}}}}}};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const path=require('path');const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const helperProp=require('../../rules/jet/helpers/bp-checkPropType');const TsxUtils=require('../jetwc-lib/jetwcutils-tsxUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-compjson-bp-ar'};ruleDef.prototype.getShortDescription=function(){return'Web component component.json metadata should follow best practices and avoid plain \'array\' type properties'};ruleDef.prototype.getDescription=function(){return'For best practices, web components should avoid use of unqualified property type \'array\', and provide a more complete definition of the API using a closure type definition'};ruleDef.prototype.register=function(context){if(context.rulePack.isRuleEnabled('oj-cca-compjson-bp-ar','JET')){return false}else{return{compjson:this._doAudit,Program:this._doVComponentAudit}}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'){this._checkProps(context,fullName,meta.properties)}}};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);if(componentInfo){this._checkProps(context,componentInfo.fullName,componentInfo.properties)}};ruleDef.prototype._checkProps=function(context,fullName,properties){if(properties){const arrayProps=helperProp(properties,'a');if(arrayProps){for(let i=0;i<arrayProps.length;i++){const checkProperty=arrayProps[i];const checkPropertyType=Utils.getPropertyAttributeFromPath(context,fullName,checkProperty,'type');if(checkPropertyType.toLowerCase()==='array'){if(!Utils.shouldIgnoreCheck(context,'jetwc-compjson-bp-ar',fullName,'properties',checkProperty)){const issue=new context.Issue(`property '${checkProperty}' is defined with unqualified type 'array'. Provide a more complete API definition using a closure type definition.`);context.reporter.addIssue(issue,context)}}}}}};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const helperPos=require('../../rules/jet/helpers/json-propname-pos');const helperProp=require('../../rules/jet/helpers/bp-checkPropType');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-compjson-bp-obj'};ruleDef.prototype.getShortDescription=function(){return'Web component component.json metadata should follow best practices and avoid \'object\' type properties'};ruleDef.prototype.getDescription=function(){return'For best practices, web components should avoid use of the property type \'object\' without sub-properties, and provide a more complete definition of the API either using sub-properties or using a closure type definition'};ruleDef.prototype.register=function(context){if(context.rulePack.isRuleEnabled('oj-cca-compjson-bp-obj','JET')){return false}else{return{compjson:this._doAudit}}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const componentName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'){const properties=meta.properties;if(properties){const objectProps=helperProp(properties,'o');if(objectProps){for(let i=0;i<objectProps.length;i++){const checkProperty=objectProps[i];if(!this._hasSub_properties(properties,checkProperty)){if(!Utils.shouldIgnoreCheck(context,'jetwc-compjson-bp-obj',componentName,'properties',checkProperty)){const issue=new context.Issue(`property '${checkProperty}' of type 'object' has no sub-properties. Provide a more complete API definition using sub-properties or a closure type definition`,'0101');const pos=helperPos(context,checkProperty);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+6:0);context.reporter.addIssue(issue,context,'info')}}}}}}}};ruleDef.prototype._hasSub_properties=function(props,prop){var subprop,a,i;if(!prop.includes('.')){return!!props[prop].properties}a=prop.split('.');for(i=0;i<a.length;i++){subprop=props[a[i]];if(subprop&&subprop.properties){if(a.length-1===i){return true}props=subprop.properties;continue}break}return false};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const helperProp=require('../../rules/jet/helpers/bp-checkPropType');const TsxUtils=require('../jetwc-lib/jetwcutils-tsxUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-compjson-bp-obj'};ruleDef.prototype.getShortDescription=function(){return'Web component component.json metadata should follow best practices and avoid \'object\' type properties'};ruleDef.prototype.getDescription=function(){return'For best practices, web components should avoid use of the property type \'object\' without sub-properties, and provide a more complete definition of the API either using sub-properties or using a closure type definition'};ruleDef.prototype.register=function(context){if(context.rulePack.isRuleEnabled('oj-cca-compjson-bp-obj','JET')){return false}else{return{compjson:this._doAudit,Program:this._doVComponentAudit}}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'){this._checkProps(context,fullName,meta.properties)}}};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);if(componentInfo){this._checkProps(context,componentInfo.fullName,componentInfo.properties)}};ruleDef.prototype._checkProps=function(context,fullName,properties){if(properties){const objectProps=helperProp(properties,'o');if(objectProps){for(let i=0;i<objectProps.length;i++){const checkProperty=objectProps[i];if(!this._hasSub_properties(properties,checkProperty)){if(!Utils.shouldIgnoreCheck(context,'jetwc-compjson-bp-obj',fullName,'properties',checkProperty)){const issue=new context.Issue(`property '${checkProperty}' of type 'object' has no sub-properties. Provide a more complete API definition using sub-properties or a closure type definition`);context.reporter.addIssue(issue,context)}}}}}};ruleDef.prototype._hasSub_properties=function(props,prop){var subprop,a,i;if(!prop.includes('.')){return!!props[prop].properties}a=prop.split('.');for(i=0;i<a.length;i++){subprop=props[a[i]];if(subprop&&subprop.properties){if(a.length-1===i){return true}props=subprop.properties;continue}break}return false};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-component-dependencies'};ruleDef.prototype.getShortDescription=function(){return'Validate the stated dependencies for a component'};ruleDef.prototype.getDescription=function(){return'This rule checks that any dependencies defined for a component actually exist in the context of the project and are correct'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){const componentMetadata=context.suppData.obj;const componentType=Utils.getComponentType(componentMetadata);const allVisibleComponents=context.rulePack.getExtension().allComponents;if(componentMetadata){let issue;if(componentMetadata.dependencies){Object.keys(componentMetadata.dependencies).forEach(dependency=>{const dependentVersion=componentMetadata.dependencies[dependency];if(componentType==='pack'){if(!context.utils.semVerUtils.isValid(dependentVersion)){issue=new context.Issue(`Pack dependency '${dependency}':'${componentMetadata.dependencies[dependency]}' in ${componentMetadata.name} must be an absolute semver version not a range`,'0021');context.reporter.addIssue(issue,context,'blocker')}}else{if(!context.utils.semVerUtils.isValidRange(dependentVersion)){issue=new context.Issue(`Component dependency '${dependency}':'${componentMetadata.dependencies[dependency]}' in ${componentMetadata.name} is not a valid semver or semver range`,'0022');context.reporter.addIssue(issue,context,'blocker')}else{if(componentMetadata.type&&componentMetadata.type==='demo'&&context.utils.semVerUtils.isValid(dependentVersion)){issue=new context.Issue(`Demo component ${componentMetadata.name} depends on an absolute version of '${dependency}':'${componentMetadata.dependencies[dependency]}', range support is preferred for demos`,'0023');context.reporter.addIssue(issue,context,'info')}}}if(!issue){if(!allVisibleComponents.has(dependency)){issue=new context.Issue(`Component dependency '${dependency}':'${componentMetadata.dependencies[dependency]}' in '${componentMetadata.name}' has no match in the project`,'0024');context.reporter.addIssue(issue,context,'blocker')}else{const availableVersion=allVisibleComponents.get(dependency).version;if(!context.utils.semVerUtils.satisfiesRange(availableVersion,dependentVersion)){issue=new context.Issue(`Component dependency '${dependency}' in '${componentMetadata.name}' exists in the project but the versions are mismatched. Requested:'${dependentVersion}', version available in project: '${availableVersion}'`,'0025');context.reporter.addIssue(issue,context,'blocker')}}}})}}};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const TsxUtils=require('../jetwc-lib/jetwcutils-tsxUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-component-dependencies'};ruleDef.prototype.getShortDescription=function(){return'Validate the stated dependencies for a component'};ruleDef.prototype.getDescription=function(){return'This rule checks that any dependencies defined for a component actually exist in the context of the project and are correct'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit,Program:this._doVComponentAudit}};ruleDef.prototype._doAudit=function(context){if(context.rulePack.getExtension()&&context.rulePack.getExtension().hasOwnProperty('allComponents')){const componentMetadata=context.suppData.obj;const componentType=Utils.getComponentType(componentMetadata);if(componentMetadata){let issue;if(componentMetadata.dependencies){Object.keys(componentMetadata.dependencies).forEach(dependency=>{const dependentVersion=componentMetadata.dependencies[dependency];if(componentType==='pack'){if(!context.utils.semVerUtils.isValid(dependentVersion)){issue=new context.Issue(`Pack dependency '${dependency}':'${componentMetadata.dependencies[dependency]}' in ${componentMetadata.name} must be an absolute semver version not a range`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context)}}else{if(!context.utils.semVerUtils.isValidRange(dependentVersion)){issue=new context.Issue(`Component dependency '${dependency}':'${componentMetadata.dependencies[dependency]}' in ${componentMetadata.name} is not a valid semver or semver range`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context)}else{if(componentMetadata.type&&componentMetadata.type==='demo'&&context.utils.semVerUtils.isValid(dependentVersion)){issue=new context.Issue(`Demo component ${componentMetadata.name} depends on an absolute version of '${dependency}':'${componentMetadata.dependencies[dependency]}', range support is preferred for demos`);issue.setMsgKey(context.ruleName+'_3');context.reporter.addIssue(issue,context,'info')}}}if(!issue){this._validateDependency(context,componentMetadata.name,dependency,componentMetadata.dependencies[dependency])}})}}}else{Utils.reportMissingBootstrapInfo(context,'allComponents')}};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);if(componentInfo){if(componentInfo.dependencies){componentInfo.dependencies.forEach(dependency=>{this._validateDependency(context,componentInfo.fullName,dependency.name,dependency.range)})}}};ruleDef.prototype._validateDependency=function(context,fullName,dependencyName,dependencyVersion){const allVisibleComponents=context.rulePack.getExtension().allComponents;if(!allVisibleComponents.has(dependencyName)){issue=new context.Issue(`Component dependency '${dependencyName}':'${dependencyVersion}' in '${fullName}' has no match in the project`);issue.setMsgKey(context.ruleName+'_4');context.reporter.addIssue(issue,context)}else{const availableVersion=allVisibleComponents.get(dependencyName).version;if(!context.utils.semVerUtils.satisfiesRange(availableVersion,dependencyVersion)){issue=new context.Issue(`Component dependency '${dependencyName}' in '${fullName}' exists in the project but the versions are mismatched. Requested:'${dependencyVersion}', version available in project: '${availableVersion}'`);issue.setMsgKey(context.ruleName+'_5');context.reporter.addIssue(issue,context)}}};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-component-displayname'};ruleDef.prototype.getShortDescription=function(){return'Check component has display name defined'};ruleDef.prototype.getDescription=function(){return'This rule checks that the component has a display name supplied to make the user experience in Visual Builder and Exchange as useful as possible'};ruleDef.prototype.register=function(context){if(context.rulePack.isRuleEnabled('oj-cca-compjson-bp-dsplyname','JET')){return false}else{return{compjson:this._doAudit}}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;if(!meta.hasOwnProperty('displayName')){issue=new context.Issue(`displayName for component should be defined`,'0105');context.reporter.addIssue(issue,context,'info')}}};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const TsxUtils=require('../jetwc-lib/jetwcutils-tsxUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-component-displayname'};ruleDef.prototype.getShortDescription=function(){return'Check component has display name defined'};ruleDef.prototype.getDescription=function(){return'This rule checks that the component has a display name supplied to make the user experience in Visual Builder and Exchange as useful as possible'};ruleDef.prototype.register=function(context){if(context.rulePack.isRuleEnabled('oj-cca-compjson-bp-dsplyname','JET')){return false}else{return{compjson:this._doAudit,Program:this._doVComponentAudit}}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){this._checkDisplayName(context,context.suppData.obj)}};ruleDef.prototype._checkDisplayName=function(context,meta){let issue;if(!meta.hasOwnProperty('displayName')||meta.displayName===undefined||meta.displayName.length===0){issue=new context.Issue(`displayName for component should be defined`);context.reporter.addIssue(issue,context)}};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);if(componentInfo){this._checkDisplayName(context,componentInfo)}};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-component-foldername'};ruleDef.prototype.getShortDescription=function(){return'Ensure components are defined in the correctly named folder'};ruleDef.prototype.getDescription=function(){return'This rule applies to both singleton and JET Pack components and verifies that they are correctly named in the folder structure based on their type'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const processingBuilt=context.rulePack.getExtension().auditBuildOutput;const componentName=meta.name;const componentVersion=meta.version;const pathSegments=context.filepath.split('/');const componentFolder=pathSegments[pathSegments.length-2];const componentParentFolder=pathSegments[pathSegments.length-3];let expectedFolder;if(!processingBuilt||meta.pack){expectedFolder=componentName}else{expectedFolder=componentVersion}if(componentFolder!==expectedFolder){issue=new context.Issue(`${processingBuilt?'For built output ':''}Component '${fullName}' should be defined in a folder called '${processingBuilt?componentName+path.sep:''}${expectedFolder}' not '${processingBuilt?componentParentFolder+path.sep:''}${componentFolder}' for referencing to work correctly`,'0010');context.reporter.addIssue(issue,context,'blocker')}}};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const path=require('path');const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const TsxUtils=require('../jetwc-lib/jetwcutils-tsxUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-component-foldername'};ruleDef.prototype.getShortDescription=function(){return'Ensure components are defined in the correctly named folder'};ruleDef.prototype.getDescription=function(){return'This rule applies to both singleton and JET Pack components and verifies that they are correctly named in the folder structure based on their type'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit,Program:this._doVComponentAudit}};ruleDef.prototype._doAudit=function(context){if(context.rulePack.getExtension()&&context.rulePack.getExtension().hasOwnProperty('auditBuildOutput')){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentName=meta.name;const componentVersion=meta.version;const pathSegments=context.filepath.split('/');const componentFolder=pathSegments[pathSegments.length-2];const componentParentFolder=pathSegments[pathSegments.length-3];let expectedFolder;const processingBuilt=context.rulePack.getExtension().auditBuildOutput;if(!processingBuilt||meta.pack){expectedFolder=componentName}else{expectedFolder=componentVersion}if(componentFolder!==expectedFolder){issue=new context.Issue(`${processingBuilt?'For built output ':''}Component '${fullName}' should be defined in a folder called '${processingBuilt?componentName+path.sep:''}${expectedFolder}' not '${processingBuilt?componentParentFolder+path.sep:''}${componentFolder}' for referencing to work correctly`);context.reporter.addIssue(issue,context)}}}else{Utils.reportMissingBootstrapInfo(context,'auditBuildOutput')}};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);if(componentInfo){const fullName=componentInfo.fullName;let expectedPath=componentInfo.pack?componentInfo.name:componentInfo.fullName;const pathSegments=context.filepath.split('/');const componentFolder=pathSegments[pathSegments.length-2];const parentFolder=pathSegments[pathSegments.length-3];if(componentFolder!==expectedPath){issue=new context.Issue(`Component '${fullName}' should be defined in a folder called '${expectedPath}' not '${componentFolder}' for referencing to work correctly`);context.reporter.addIssue(issue,context)}}};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const path=require('path');const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-component-location'};ruleDef.prototype.getShortDescription=function(){return'Ensure components are defined in the correct folder structure'};ruleDef.prototype.getDescription=function(){return'This rule applies to both singleton and JET Pack components and verifies that they are correctly placed in the folder structure based on their naming'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const componentParentPack=meta.pack;const componentName=meta.name;const fullName=Utils.getComponentFullName(meta);const pathSegments=context.filepath.split('/');const processingBuilt=context.rulePack.getExtension().auditBuildOutput;const componentRoot=context.rulePack.getExtension().componentHome;const sepStrip=/\//g;const parentFolder=pathSegments[pathSegments.length-3];const grandParentFolder=pathSegments[pathSegments.length-4];let expectedParent;let expectedGrandParent;if(processingBuilt){if(componentParentPack){expectedParent=Utils.componentInfo(context,componentParentPack).version;expectedGrandParent=componentParentPack}else{expectedParent=componentName;expectedGrandParent=componentRoot.replace(sepStrip,'');;}}else{if(componentParentPack){expectedParent=componentParentPack;expectedGrandParent=componentRoot.replace(sepStrip,'')}else{expectedParent=componentRoot.replace(sepStrip,'')}}if(parentFolder!==expectedParent){if(!processingBuilt){issue=new context.Issue(`Component '${fullName}' should be defined in a folder which is a child of '${expectedParent}'`,'0011')}else{issue=new context.Issue(`Built component '${fullName}' should be present in a folder which is a child of '${expectedGrandParent}${path.sep}${expectedParent}'`,'0096')}}if(!issue){if(expectedGrandParent&&grandParentFolder!==expectedGrandParent){issue=new context.Issue(`Parent folder for ${processingBuilt?'built':''} component '${fullName}' should be present in a folder called '${expectedGrandParent}'`,'0012')}}if(issue){context.reporter.addIssue(issue,context,'blocker')}}};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const path=require('path');const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const TsxUtils=require('../jetwc-lib/jetwcutils-tsxUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-component-location'};ruleDef.prototype.getShortDescription=function(){return'Ensure components are defined in the correct folder structure'};ruleDef.prototype.getDescription=function(){return'This rule applies to both singleton and JET Pack components and verifies that they are correctly placed in the folder structure based on their naming'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.rulePack.getExtension()&&context.rulePack.getExtension().hasOwnProperty('auditBuildOutput')){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const componentParentPack=meta.pack;const componentName=meta.name;const fullName=Utils.getComponentFullName(meta);const pathSegments=context.filepath.split('/');const componentRoot=context.rulePack.getExtension().componentHome;const sepStrip=/\//g;const parentFolder=pathSegments[pathSegments.length-3];const grandParentFolder=pathSegments[pathSegments.length-4];let expectedParent;let expectedGrandParent;const processingBuilt=context.rulePack.getExtension().auditBuildOutput;if(processingBuilt){if(componentParentPack){expectedParent=Utils.componentInfo(context,componentParentPack).version;expectedGrandParent=componentParentPack}else{expectedParent=componentName;expectedGrandParent=componentRoot.replace(sepStrip,'')}}else{if(componentParentPack){expectedParent=componentParentPack;expectedGrandParent=componentRoot.replace(sepStrip,'')}else{expectedParent=componentRoot.replace(sepStrip,'')}}if(parentFolder!==expectedParent){if(!processingBuilt){issue=new context.Issue(`Component '${fullName}' should be defined in a folder which is a child of '${expectedParent}'`);issue.setMsgKey(context.ruleName+'_1')}else{issue=new context.Issue(`Built component '${fullName}' should be present in a folder which is a child of '${expectedGrandParent}${path.sep}${expectedParent}'`);issue.setMsgKey(context.ruleName+'_3')}}if(!issue){if(expectedGrandParent&&grandParentFolder!==expectedGrandParent){issue=new context.Issue(`Parent folder for ${processingBuilt?'built':''} component '${fullName}' should be present in a folder called '${expectedGrandParent}'`);issue.setMsgKey(context.ruleName+'_2')}}if(issue){context.reporter.addIssue(issue,context)}}}else{Utils.reportMissingBootstrapInfo(context,'auditBuildOutput')}};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-component-type'};ruleDef.prototype.getShortDescription=function(){return'Check component has an explit type defined'};ruleDef.prototype.getDescription=function(){return'This rule checks that the component explicitly defines a type attribute rather than relying on the original fallback behavior and assuming composite'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;if(!meta.hasOwnProperty('type')){issue=new context.Issue(`type for component should be explicitly defined rather than assuming the default`,'0109');context.reporter.addIssue(issue,context,'info')}}};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-component-type'};ruleDef.prototype.getShortDescription=function(){return'Check component has an explicit type defined'};ruleDef.prototype.getDescription=function(){return'This rule checks that the component explicitly defines a type attribute rather than relying on the original fallback behavior and assuming composite'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;if(!meta.hasOwnProperty('type')){issue=new context.Issue(`type for component should be explicitly defined rather than assuming the default`);context.reporter.addIssue(issue,context)}}};module.exports=ruleDef;
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-css-oj-complete'};ruleDef.prototype.getShortDescription=function(){return'Verify that a component CSS implementation includes the standard definition for hiding itself before it is fully initialized'};ruleDef.prototype.getDescription=function(){return'All custom components should include a selector definition for the component tag that ensures that it is hidden until the oj-complete marker class is applied. This is managed through the use of the :not(.oj-complete) pseudo-class setting the visibility to hidden'};ruleDef.prototype.register=function(context){return{startaudit:this._ruleSetup,'css-selector':this._detectNotSelector,endaudit:this._reportUnmatchedComponents}};ruleDef.prototype._ruleSetup=function(context){this.validOjCompleteSelectors=new Set};ruleDef.prototype._detectNotSelector=function(context,selector){if(selector.type==='Selector'&&selector.children.length===2&&selector.children[0].type==='TypeSelector'&&selector.children[1].type==='PseudoClassSelector'&&selector.children[1].name==='not'){const selectorComponentName=selector.children[0].name;const componentInfo=Utils.componentInfo(context,selectorComponentName);if(componentInfo&&selector.children[1].children.length>0&&selector.children[1].children[0].type==='SelectorList'&&selector.children[1].children[0].children.length>0&&selector.children[1].children[0].children[0].type==='Selector'&&selector.children[1].children[0].children[0].children.length>0&&selector.children[1].children[0].children[0].children[0].type==='ClassSelector'&&selector.children[1].children[0].children[0].children[0].name==='oj-complete'){this.validOjCompleteSelectors.add(selectorComponentName)}}};ruleDef.prototype._reportUnmatchedComponents=function(context){const allComponents=context.rulePack.getExtension().allComponents;debugger;if(allComponents){for(const[componentName,componentDef]of allComponents.entries()){if(componentDef.type==='composite'){const fullName=componentDef.fullName;if(!this.validOjCompleteSelectors.has(fullName)){if(!Utils.shouldIgnoreCheck(context,this.getName(),fullName)){const issue=new context.Issue(`Component '${fullName}' does not have a defined CSS sector for :not(.oj-complete)`);context.reporter.addIssue(issue,context)}}}}}};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-data-property-prefix'};ruleDef.prototype.getShortDescription=function(){return'Ensure that the component does not define properties with a data* prefix'};ruleDef.prototype.getDescription=function(){return'This rule checks that a component has not defined any property that once translated to an attribute becomes a data-* attribute. This involves checking the property name of top level properties only for the prefix of data followed by an uppercase letter. The property name data on its own is OK'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'&&meta.properties){const dataDetect=/^data[A-Z\-].*$/;Object.keys(meta.properties).forEach(propName=>{if(dataDetect.test(propName)){issue=new context.Issue(`Component ${fullName} defines a data prefixed property ${propName} which is not allowed`,'0107');context.reporter.addIssue(issue,context,'minor')}})}}};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const TsxUtils=require('../jetwc-lib/jetwcutils-tsxUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-data-property-prefix'};ruleDef.prototype.getShortDescription=function(){return'Ensure that the component does not define properties with a data* prefix'};ruleDef.prototype.getDescription=function(){return'This rule checks that a component has not defined any property that once translated to an attribute becomes a data-* attribute. This involves checking the property name of top level properties only for the prefix of data followed by an uppercase letter. The property name data on its own is OK'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit,Program:this._doVComponentAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'){this._checkProps(context,fullName,meta.properties)}}};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);if(componentInfo){this._checkProps(context,componentInfo.fullName,componentInfo.properties)}};ruleDef.prototype._checkProps=function(context,fullName,properties){let issue;if(properties){const dataDetect=/^data[A-Z\-].*$/;Object.keys(properties).forEach(propName=>{if(dataDetect.test(propName)){issue=new context.Issue(`Component ${fullName} defines a data prefixed property ${propName} which is not allowed`);context.reporter.addIssue(issue,context)}})}};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-deprecated-lifecycle'};ruleDef.prototype.getShortDescription=function(){return'Checks for deprecated component lifecycle definitions'};ruleDef.prototype.getDescription=function(){return'This rule ensures that the component does not still declare deprecated lifecycle methods such as attached'};ruleDef.prototype.register=function(context){return{FunctionExpression:Utils.setupFileMethodMapping.bind(Utils),ArrowFunctionExpression:Utils.setupFileMethodMapping.bind(Utils),CallExpression:Utils.deriveViewModels.bind(Utils),closedownRP:this._doAudit}};ruleDef.prototype._doAudit=function(context){let issue;context.rulePack.getExtension().allComponents.forEach(compInfo=>{const vmMethods=Utils.getVMMethodsForLocalComposite(context,compInfo);if(vmMethods&&(vmMethods.has('attached')||vmMethods.has('detached')||vmMethods.has('initialize')||vmMethods.has('dispose'))){issue=new context.Issue(`Component '${compInfo.fullName}' still defines one or more of the following deprecated lifecycle methods: attached(), detached(), dispose(), initialize()`,'0087');context.reporter.addIssue(issue,context,'major')}})};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-deprecated-lifecycle'};ruleDef.prototype.getShortDescription=function(){return'Checks for deprecated component lifecycle definitions'};ruleDef.prototype.getDescription=function(){return'This rule ensures that the component does not still declare deprecated lifecycle methods such as attached'};ruleDef.prototype.register=function(context){return{FunctionExpression:Utils.setupFileMethodMapping.bind(Utils),ArrowFunctionExpression:Utils.setupFileMethodMapping.bind(Utils),CallExpression:Utils.deriveViewModels.bind(Utils),MethodDefinition:Utils.setupFileMethodMappingFromMethodDefintion.bind(Utils),closedownRP:this._doAudit}};ruleDef.prototype._doAudit=function(context){let issue;if(context.rulePack.getExtension()){context.rulePack.getExtension().allComponents.forEach(compInfo=>{const vmMethods=Utils.getVMMethodsForLocalComposite(context,compInfo);if(vmMethods&&(vmMethods.has('attached')||vmMethods.has('detached')||vmMethods.has('initialize')||vmMethods.has('dispose'))){issue=new context.Issue(`Component '${compInfo.fullName}' still defines one or more of the following deprecated lifecycle methods: attached(), detached(), dispose(), initialize()`);context.reporter.addIssue(issue,context)}})}};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-disabled-property'};ruleDef.prototype.getShortDescription=function(){return'Check component does not use the problematic disabled property'};ruleDef.prototype.getDescription=function(){return'This rule checks that a component does not define a property called disabled which can cause issues with IE'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'){if(meta.properties&&meta.properties.hasOwnProperty('disabled')){var deprecated=false;if(meta.properties.disabled.hasOwnProperty('status')){var statusArray=meta.properties.disabled.status;statusArray.forEach(status=>{if(status.hasOwnProperty('type')){if(status.type==='deprecated'){deprecated=true}}})}if(!deprecated){issue=new context.Issue(`Component ${fullName} defines a property called 'disabled' this can cause problems with Internet Explorer and we recommend 'disable' as a replacement property name`,'0091');context.reporter.addIssue(issue,context,'minor')}}}}};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-disabled-property'};ruleDef.prototype.getShortDescription=function(){return'Check component does not use the problematic disabled property'};ruleDef.prototype.getDescription=function(){return'This rule checks that a component does not define a property called disabled which can cause issues with IE'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'){if(meta.properties&&meta.properties.hasOwnProperty('disabled')){var deprecated=false;if(meta.properties.disabled.hasOwnProperty('status')){var statusArray=meta.properties.disabled.status;statusArray.forEach(status=>{if(status.hasOwnProperty('type')){if(status.type==='deprecated'){deprecated=true}}})}if(!deprecated){issue=new context.Issue(`Component ${fullName} defines a property called 'disabled' this can cause problems with Internet Explorer and we recommend 'disable' as a replacement property name`);context.reporter.addIssue(issue,context)}}}}};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-displayname'};ruleDef.prototype.getShortDescription=function(){return'Check component display name will work with Visual Builder'};ruleDef.prototype.getDescription=function(){return'This rule checks both the length and the number of words of the display name - configurable'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);const ruleOptions=context.rulePack.getRuleOptions();let limits;let elimits;let plimits;switch(componentType){case'composite':elimits=ruleOptions.limits.event;plimits=ruleOptions.limits.property;case'vbcs-pattern':limits=ruleOptions.limits.component;break;case'vbcs-template':limits=ruleOptions.limits.template;break;}if(limits){const displayName=meta.displayName;if(displayName){if(displayName.length>limits.length){this._lengthError(context,fullName,componentType,limits.length)}if(displayName.split(' ').length>limits.words){this._wordCountError(context,fullName,componentType,limits.words)}}}this.checkByAttributeType(context,fullName,componentType,plimits,meta,'properties','property');this.checkByAttributeType(context,fullName,componentType,elimits,meta,'events','event')}};ruleDef.prototype._lengthError=function(context,component,type,limit,scope){issue=new context.Issue(`displayName property for Component ${component}${scope?' ('+scope+')':''} exceeds the defined length limit of ${limit} for a ${type}`,'0050');context.reporter.addIssue(issue,context,'info')};ruleDef.prototype._wordCountError=function(context,component,type,limit,scope){issue=new context.Issue(`displayName property for Component ${component}${scope?' ('+scope+')':''} exceeds the defined word count of ${limit} for a ${type}`,'0051');context.reporter.addIssue(issue,context,'info')};ruleDef.prototype.checkByAttributeType=function(context,fullName,componentType,limits,meta,attributeType,typeName){if(limits&&meta[attributeType]){Object.keys(meta[attributeType]).forEach(cName=>{const cDN=meta[attributeType][cName].displayName;if(cDN){if(cDN.length>limits.length){this._lengthError(context,fullName,componentType+' '+typeName,limits.length,attributeType+'=>'+cName)}if(cDN.split(' ').length>limits.words){this._wordCountError(context,fullName,componentType+' '+typeName,limits.words,attributeType+'=>'+cName)}}})}};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const TsxUtils=require('../jetwc-lib/jetwcutils-tsxUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-displayname'};ruleDef.prototype.getShortDescription=function(){return'Check component display name will work with Visual Builder'};ruleDef.prototype.getDescription=function(){return'This rule checks both the length and the number of words of the display name - configurable'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit,Program:this._doVComponentAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);this._checkDisplayNames(context,fullName,componentType,meta.displayName,meta.properties,meta.events,meta.slots)}};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);if(componentInfo){this._checkDisplayNames(context,componentInfo.fullName,componentInfo.type,componentInfo.displayName,componentInfo.properties,componentInfo.events,componentInfo.slots)}};ruleDef.prototype._checkDisplayNames=function(context,fullName,componentType,displayName,properties,events,slots){const ruleOptions=context.rulePack.getRuleOptions();let limits;let elimits;let plimits;let slimits;switch(componentType){case'composite':elimits=ruleOptions.limits.event;plimits=ruleOptions.limits.property;slimits=ruleOptions.limits.slot;case'vbcs-pattern':limits=ruleOptions.limits.component;break;case'vbcs-template':limits=ruleOptions.limits.template;break;}if(limits&&displayName){if(displayName.length>limits.length){this._lengthError(context,fullName,componentType,limits.length)}if(displayName.split(' ').length>limits.words){this._wordCountError(context,fullName,componentType,limits.words)}}if(plimits&&properties){this.checkByAttributeType(context,fullName,componentType,plimits,properties,'properties','property')}if(elimits&&events){this.checkByAttributeType(context,fullName,componentType,elimits,events,'events','event')}if(slimits&&slots){this.checkByAttributeType(context,fullName,componentType,slimits,slots,'slots','slot')}};ruleDef.prototype._lengthError=function(context,component,type,limit,scope){issue=new context.Issue(`displayName property for Component ${component}${scope?' ('+scope+')':''} exceeds the defined length limit of ${limit} for a ${type}`);issue.setMsgKey(context.ruleName+'_1');context.reporter.addIssue(issue,context)};ruleDef.prototype._wordCountError=function(context,component,type,limit,scope){issue=new context.Issue(`displayName property for Component ${component}${scope?' ('+scope+')':''} exceeds the defined word count of ${limit} for a ${type}`);issue.setMsgKey(context.ruleName+'_2');context.reporter.addIssue(issue,context)};ruleDef.prototype.checkByAttributeType=function(context,fullName,componentType,limits,meta,attributeType,typeName){Object.keys(meta).forEach(cName=>{const cDN=meta[cName].displayName;if(cDN){if(cDN.length>limits.length){this._lengthError(context,fullName,componentType+' '+typeName,limits.length,attributeType+'=>'+cName)}if(cDN.split(' ').length>limits.words){this._wordCountError(context,fullName,componentType+' '+typeName,limits.words,attributeType+'=>'+cName)}}})};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const Utils=require('../jetwc-lib/component-audit-utils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-dynamic-slot-context'};ruleDef.prototype.getShortDescription=function(){return'Check properties have valid dynamicSlotDef values'};ruleDef.prototype.getDescription=function(){return'Ensures that any property that defines itself as a dynamic slot discriminant using the dynamicSlotDef attribute is using a valid context defined within the dynamicSlots set for the component'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'){if(meta.properties){Object.keys(meta.properties).forEach(propName=>{let issueNoticed=false;const prop=meta.properties[propName];if(prop.hasOwnProperty('dynamicSlotDef')){if(meta.dynamicSlots){if(!meta.dynamicSlots.hasOwnProperty(prop.dynamicSlotDef)){issueNoticed=true}}else{issueNoticed=true}}if(issueNoticed){const issue=new context.Issue(`Component ${fullName} property ${propName} references an invalid dynamic-slot`,'0097');context.reporter.addIssue(issue,context,'major')}})}}}};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const Utils=require('../jetwc-lib/jetwcutils-componentAuditUtils');const ruleDef=function(){};ruleDef.prototype.getName=function(){return'jetwc-dynamic-slot-context'};ruleDef.prototype.getShortDescription=function(){return'Check properties have valid dynamicSlotDef values'};ruleDef.prototype.getDescription=function(){return'Ensures that any property that defines itself as a dynamic slot discriminant using the dynamicSlotDef attribute is using a valid context defined within the dynamicSlots set for the component'};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==='composite'){if(meta.properties){Object.keys(meta.properties).forEach(propName=>{let issueNoticed=false;const prop=meta.properties[propName];if(prop.hasOwnProperty('dynamicSlotDef')){if(meta.dynamicSlots){if(!meta.dynamicSlots.hasOwnProperty(prop.dynamicSlotDef)){issueNoticed=true}}else{issueNoticed=true}}if(issueNoticed){const issue=new context.Issue(`Component ${fullName} property ${propName} references an invalid dynamic-slot`);context.reporter.addIssue(issue,context)}})}}}};module.exports=ruleDef;
@@ -1 +1,6 @@
1
- const path=require("path");const Utils=require("../jetwc-lib/component-audit-utils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwc-dynamic-slots-naming"};ruleDef.prototype.getShortDescription=function(){return"Verify dynamic slots are named correctly"};ruleDef.prototype.getDescription=function(){return"This rule checks that any dynamic slot contexts have the correct naming convention"};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==="composite"){if(meta.dynamicSlots){Object.keys(meta.dynamicSlots).forEach(ctxName=>{if(!ctxName.endsWith("Context")){const issue=new context.Issue(`Component ${fullName} dynamicSlot ${ctxName} is not named according to the standards with a Context suffix`,"0098");context.reporter.addIssue(issue,context,"minor")}})}}}};module.exports=ruleDef;
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const path=require("path");const Utils=require("../jetwc-lib/jetwcutils-componentAuditUtils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwc-dynamic-slots-naming"};ruleDef.prototype.getShortDescription=function(){return"Verify dynamic slots are named correctly"};ruleDef.prototype.getDescription=function(){return"This rule checks that any dynamic slot contexts have the correct naming convention"};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);if(componentType==="composite"){if(meta.dynamicSlots){Object.keys(meta.dynamicSlots).forEach(ctxName=>{if(!ctxName.endsWith("Context")){const issue=new context.Issue(`Component ${fullName} dynamicSlot ${ctxName} is not named according to the standards with a Context suffix`);context.reporter.addIssue(issue,context)}})}}}};module.exports=ruleDef;