@oracle/oraclejet-audit 11.0.0 → 12.0.1

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 (363) hide show
  1. package/LICENSE.md +1 -1
  2. package/jaf-amd.js +6 -6
  3. package/jaf.js +2 -2
  4. package/jafapi.js +2 -2
  5. package/lib/AST.js +1 -1
  6. package/lib/AST_Ts.js +2 -2
  7. package/lib/AstJson.js +2 -2
  8. package/lib/AstMd.js +6 -0
  9. package/lib/AstNodeTypes.js +2 -2
  10. package/lib/Comments.js +1 -1
  11. package/lib/ComponentSvcs.js +1 -1
  12. package/lib/Components.js +2 -2
  13. package/lib/Config.js +2 -2
  14. package/lib/ConfigLib.js +2 -2
  15. package/lib/CssLib.js +1 -1
  16. package/lib/CssUtils.js +1 -1
  17. package/lib/DomUtils.js +2 -2
  18. package/lib/FileIndex.js +1 -1
  19. package/lib/FileSet.js +1 -1
  20. package/lib/FsUtils.js +2 -2
  21. package/lib/Histo.js +2 -2
  22. package/lib/HtmlTree.js +2 -2
  23. package/lib/HtmlUtils.js +1 -1
  24. package/lib/Issue.js +2 -2
  25. package/lib/JafEvents.js +1 -1
  26. package/lib/JafLib.js +2 -2
  27. package/lib/Json.js +2 -2
  28. package/lib/JsonLoader.js +2 -2
  29. package/lib/Md.js +6 -0
  30. package/lib/MetaLib.js +2 -2
  31. package/lib/NetUtils.js +1 -1
  32. package/lib/NodeTypes.js +1 -1
  33. package/lib/Parser.js +2 -2
  34. package/lib/RegTypes.js +2 -2
  35. package/lib/Registry.js +2 -2
  36. package/lib/Reporter.js +2 -2
  37. package/lib/RuleContext.js +1 -1
  38. package/lib/RulePack.js +1 -1
  39. package/lib/RuleSet.js +2 -2
  40. package/lib/Rules.js +2 -2
  41. package/lib/Scope.js +2 -2
  42. package/lib/SemVer.js +1 -1
  43. package/lib/Server.js +1 -1
  44. package/lib/SevLib.js +1 -1
  45. package/lib/Severity.js +1 -1
  46. package/lib/Stats.js +1 -1
  47. package/lib/Ts.js +2 -2
  48. package/lib/Utils.js +2 -2
  49. package/lib/Watch.js +1 -1
  50. package/lib/Writer.js +1 -1
  51. package/lib/ZipUtils.js +1 -1
  52. package/lib/api.js +2 -2
  53. package/lib/builtinpacks.js +6 -0
  54. package/lib/cliStats.js +2 -2
  55. package/lib/clone.js +2 -2
  56. package/lib/cmdline.js +2 -2
  57. package/lib/colors.js +2 -2
  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 +1 -1
  62. package/lib/extends.js +2 -2
  63. package/lib/filetypes.js +2 -2
  64. package/lib/grouplist.js +6 -0
  65. package/lib/groups.js +2 -2
  66. package/lib/help.js +2 -2
  67. package/lib/jetver.js +2 -2
  68. package/lib/macros.js +1 -1
  69. package/lib/manual.js +6 -0
  70. package/lib/metaLoader.js +1 -1
  71. package/lib/metahist.js +1 -1
  72. package/lib/msgidLoader.js +1 -1
  73. package/lib/ns.js +2 -2
  74. package/lib/nslist.js +1 -1
  75. package/lib/outFormat.js +1 -1
  76. package/lib/outfile.js +1 -1
  77. package/lib/ruleLoader.js +1 -1
  78. package/lib/scaffold.js +2 -2
  79. package/lib/scaffoldRule.js +2 -2
  80. package/lib/schema.js +2 -2
  81. package/lib/scopewalker.js +2 -2
  82. package/lib/spinner.js +2 -2
  83. package/lib/spinnernoop.js +1 -1
  84. package/lib/tabs.js +1 -1
  85. package/libext/expparser.js +1 -1
  86. package/meta/11.1.0/jetauditmeta.js +9 -0
  87. package/meta/12.0.0/jetauditmeta.js +9 -0
  88. package/meta/metaverlist.json +1 -1
  89. package/package.json +72 -68
  90. package/rulepacks/csp/csp-html-script-unsafe-inline.js +1 -1
  91. package/rulepacks/csp/csp-html-style-unsafe-inline.js +1 -1
  92. package/rulepacks/csp/csp-html-unsafe-expr.js +1 -1
  93. package/rulepacks/csp/csp-js-script-unsafe-eval.js +1 -1
  94. package/rulepacks/csp/csp-js-style-unsafe-inline.js +1 -1
  95. package/rulepacks/csp/csp-ts-script-unsafe-eval.js +1 -1
  96. package/rulepacks/csp/csp-ts-style-unsafe-inline.js +1 -1
  97. package/rulepacks/csp/msgid.json +1 -1
  98. package/rulepacks/csp/rules.json +1 -1
  99. package/rulepacks/jetwc/jetwc-absolute-jetversion.js +2 -2
  100. package/rulepacks/jetwc/jetwc-aria-redefinition.js +2 -2
  101. package/rulepacks/jetwc/jetwc-bootstrap.js +2 -2
  102. package/rulepacks/jetwc/jetwc-compjson-bp-ar.js +2 -2
  103. package/rulepacks/jetwc/jetwc-compjson-bp-obj.js +2 -2
  104. package/rulepacks/jetwc/jetwc-component-dependencies.js +2 -2
  105. package/rulepacks/jetwc/jetwc-component-displayname.js +2 -2
  106. package/rulepacks/jetwc/jetwc-component-foldername.js +2 -2
  107. package/rulepacks/jetwc/jetwc-component-location.js +2 -2
  108. package/rulepacks/jetwc/jetwc-component-type.js +2 -2
  109. package/rulepacks/jetwc/jetwc-css-oj-complete.js +6 -0
  110. package/rulepacks/jetwc/jetwc-data-property-prefix.js +2 -2
  111. package/rulepacks/jetwc/jetwc-deprecated-lifecycle.js +2 -2
  112. package/rulepacks/jetwc/jetwc-disabled-property.js +2 -2
  113. package/rulepacks/jetwc/jetwc-displayname.js +2 -2
  114. package/rulepacks/jetwc/jetwc-dynamic-slot-context.js +2 -2
  115. package/rulepacks/jetwc/jetwc-dynamic-slots-naming.js +2 -2
  116. package/rulepacks/jetwc/jetwc-event-displayname.js +2 -2
  117. package/rulepacks/jetwc/jetwc-events.js +2 -2
  118. package/rulepacks/jetwc/jetwc-jet-version.js +2 -2
  119. package/rulepacks/jetwc/jetwc-loader-file.js +2 -2
  120. package/rulepacks/jetwc/jetwc-markdown-link.js +6 -0
  121. package/rulepacks/jetwc/jetwc-method-displayname.js +2 -2
  122. package/rulepacks/jetwc/jetwc-methods.js +2 -2
  123. package/rulepacks/jetwc/jetwc-namespace.js +2 -2
  124. package/rulepacks/jetwc/jetwc-nested-defaults.js +2 -2
  125. package/rulepacks/jetwc/jetwc-nls-languages.js +2 -2
  126. package/rulepacks/jetwc/jetwc-nls-root.js +2 -2
  127. package/rulepacks/jetwc/jetwc-oj-register.js +2 -2
  128. package/rulepacks/jetwc/jetwc-ojcss.js +2 -2
  129. package/rulepacks/jetwc/jetwc-pack-children.js +2 -2
  130. package/rulepacks/jetwc/jetwc-packable-components.js +2 -2
  131. package/rulepacks/jetwc/jetwc-prerelease-dependencies.js +2 -2
  132. package/rulepacks/jetwc/jetwc-prerelease-pattern.js +2 -2
  133. package/rulepacks/jetwc/jetwc-prerelease-version.js +2 -2
  134. package/rulepacks/jetwc/jetwc-property-changed.js +2 -2
  135. package/rulepacks/jetwc/jetwc-property-displayname.js +2 -2
  136. package/rulepacks/jetwc/jetwc-property-nesting.js +2 -2
  137. package/rulepacks/jetwc/jetwc-public-modules.js +2 -2
  138. package/rulepacks/jetwc/jetwc-register-css.js +2 -2
  139. package/rulepacks/jetwc/jetwc-register-with-promises.js +2 -2
  140. package/rulepacks/jetwc/jetwc-require-paths.js +2 -2
  141. package/rulepacks/jetwc/jetwc-required-subproperty.js +2 -2
  142. package/rulepacks/jetwc/jetwc-reserved-property.js +2 -2
  143. package/rulepacks/jetwc/jetwc-schema.js +2 -2
  144. package/rulepacks/jetwc/jetwc-semantic-version.js +2 -2
  145. package/rulepacks/jetwc/jetwc-slot-displayname.js +2 -2
  146. package/rulepacks/jetwc/jetwc-slots.js +2 -2
  147. package/rulepacks/jetwc/jetwc-standard-files.js +2 -2
  148. package/rulepacks/jetwc/jetwc-subproperty-writeback.js +2 -2
  149. package/rulepacks/jetwc/jetwc-template-slots.js +2 -2
  150. package/rulepacks/jetwc/jetwc-unused-events.js +2 -2
  151. package/rulepacks/jetwc/jetwc-unused-slots.js +2 -2
  152. package/rulepacks/jetwc/jetwc-vb-category.js +2 -2
  153. package/rulepacks/jetwc/jetwc-vb-icon.js +2 -2
  154. package/rulepacks/jetwc/jetwc-vcomponent-jetversion.js +6 -0
  155. package/rulepacks/jetwc/jetwc-vcomponent-loader.js +6 -0
  156. package/rulepacks/jetwc/jetwc-vcomponent-version.js +6 -0
  157. package/rulepacks/jetwc/jetwc-version-openrange.js +2 -2
  158. package/rulepacks/jetwc/jetwc-writeback-required.js +2 -2
  159. package/rulepacks/jetwc/msgid.json +2 -2
  160. package/rulepacks/jetwc/rules.json +2 -2
  161. package/rulepacks/jetwc-lib/jetwcutils-auditComponentCacheManager.js +6 -0
  162. package/rulepacks/jetwc-lib/jetwcutils-commonListenerImpls.js +6 -0
  163. package/rulepacks/jetwc-lib/jetwcutils-componentAuditUtils.js +6 -0
  164. package/rulepacks/jetwc-lib/jetwcutils-componentFinder.js +6 -0
  165. package/rulepacks/jetwc-lib/jetwcutils-preCompiler.js +6 -0
  166. package/rulepacks/jetwc-lib/jetwcutils-tsxUtils.js +6 -0
  167. package/rulepacks/jetwco/jetwco-bootstrap.js +2 -2
  168. package/rulepacks/jetwco/jetwco-cacc-auditConstraints.js +6 -0
  169. package/rulepacks/jetwco/jetwco-cacc-dependencies.js +6 -0
  170. package/rulepacks/jetwco/jetwco-cacc-dynamicSlots.js +6 -0
  171. package/rulepacks/jetwco/jetwco-cacc-eventBubbles.js +6 -0
  172. package/rulepacks/jetwco/jetwco-cacc-eventCancelable.js +6 -0
  173. package/rulepacks/jetwco/jetwco-cacc-eventPayload.js +6 -0
  174. package/rulepacks/jetwco/jetwco-cacc-events.js +6 -0
  175. package/rulepacks/jetwco/jetwco-cacc-helpers.js +6 -0
  176. package/rulepacks/jetwco/jetwco-cacc-jetVer.js +6 -0
  177. package/rulepacks/jetwco/jetwco-cacc-methodParamTypes.js +6 -0
  178. package/rulepacks/jetwco/jetwco-cacc-methodParams.js +6 -0
  179. package/rulepacks/jetwco/jetwco-cacc-methodReturnType.js +6 -0
  180. package/rulepacks/jetwco/jetwco-cacc-methods.js +6 -0
  181. package/rulepacks/jetwco/jetwco-cacc-packBundle.js +6 -0
  182. package/rulepacks/jetwco/jetwco-cacc-packBundleContent.js +6 -0
  183. package/rulepacks/jetwco/jetwco-cacc-packContent.js +6 -0
  184. package/rulepacks/jetwco/jetwco-cacc-properties.js +6 -0
  185. package/rulepacks/jetwco/jetwco-cacc-propertyDefault.js +6 -0
  186. package/rulepacks/jetwco/jetwco-cacc-propertyEnumeration.js +6 -0
  187. package/rulepacks/jetwco/jetwco-cacc-propertyReadOnly.js +6 -0
  188. package/rulepacks/jetwco/jetwco-cacc-propertyRequired.js +6 -0
  189. package/rulepacks/jetwco/jetwco-cacc-propertyType.js +6 -0
  190. package/rulepacks/jetwco/jetwco-cacc-propertyWriteback.js +6 -0
  191. package/rulepacks/jetwco/jetwco-cacc-publicModules.js +6 -0
  192. package/rulepacks/jetwco/jetwco-cacc-slotDataVariable.js +6 -0
  193. package/rulepacks/jetwco/jetwco-cacc-slotDataVariableType.js +6 -0
  194. package/rulepacks/jetwco/jetwco-cacc-slots.js +6 -0
  195. package/rulepacks/jetwco/jetwco-cacc-styleClasses.js +6 -0
  196. package/rulepacks/jetwco/jetwco-cacc-styleVariables.js +6 -0
  197. package/rulepacks/jetwco/jetwco-compjson-ns-reg.js +2 -2
  198. package/rulepacks/jetwco/jetwco-component-api-baseline-changes.js +2 -2
  199. package/rulepacks/jetwco/jetwco-component-api-changes.js +2 -2
  200. package/rulepacks/jetwco/jetwco-component-api-controlled-changes.js +6 -0
  201. package/rulepacks/jetwco/jetwco-component-cdn.js +2 -2
  202. package/rulepacks/jetwco/jetwco-description-standards.js +6 -0
  203. package/rulepacks/jetwco/jetwco-displayname-standards.js +6 -0
  204. package/rulepacks/jetwco/jetwco-exchange-version-check.js +2 -2
  205. package/rulepacks/jetwco/jetwco-license-info.js +2 -2
  206. package/rulepacks/jetwco/jetwco-prerelease-cdn.js +2 -2
  207. package/rulepacks/jetwco/jetwco-thirdparty-ba.js +2 -2
  208. package/rulepacks/jetwco/msgid.json +2 -2
  209. package/rulepacks/jetwco/rules.json +2 -2
  210. package/rulepacks/spoc/msgid.json +1 -1
  211. package/rulepacks/spoc/rules.json +1 -1
  212. package/rulepacks/spoc/spoc-dom-manip-inv-tag.js +1 -1
  213. package/rulepacks/spoc/spoc-dom-manip-tag-pos.js +1 -1
  214. package/rulepacks/spoc/spoc-dom-manip.js +1 -1
  215. package/rulepacks/wdt/msgid.json +6 -0
  216. package/rulepacks/wdt/rules.json +6 -0
  217. package/rulepacks/wdt/wd-driver-sleep.js +6 -0
  218. package/rulepacks/wdt/wd-xpath.js +6 -0
  219. package/rules/jaf/jaf-css-diagnose.js +1 -1
  220. package/rules/jaf/jaf-html-diagnose.js +1 -1
  221. package/rules/jaf/jaf-init-schema.js +1 -1
  222. package/rules/jaf/jaf-js-diagnose.js +1 -1
  223. package/rules/jaf/jaf-ts-diagnose.js +1 -1
  224. package/rules/jaf/jaf-ts-walk.js +6 -0
  225. package/rules/jaf/msgid.json +2 -2
  226. package/rules/jaf/rules.json +2 -2
  227. package/rules/jet/helpers/acc-aria-label.js +1 -1
  228. package/rules/jet/helpers/bp-checkPropType.js +1 -1
  229. package/rules/jet/helpers/cssHelper.js +1 -1
  230. package/rules/jet/helpers/extractStylesFromClass.js +1 -1
  231. package/rules/jet/helpers/has-slot-name.js +2 -2
  232. package/rules/jet/helpers/has-slot.js +1 -1
  233. package/rules/jet/helpers/json-prop-pos.js +1 -1
  234. package/rules/jet/helpers/json-propname-pos.js +1 -1
  235. package/rules/jet/helpers/style-selector.js +1 -1
  236. package/rules/jet/helpers/valid-attr.js +1 -1
  237. package/rules/jet/helpers/vartrack.js +1 -1
  238. package/rules/jet/jet-css-ojselector.js +1 -1
  239. package/rules/jet/msgid.json +2 -2
  240. package/rules/jet/oj-acc-aria-labelledby.js +1 -1
  241. package/rules/jet/oj-acc-aria-prop.js +2 -2
  242. package/rules/jet/oj-acc-avatar-aria-role.js +2 -2
  243. package/rules/jet/oj-acc-combobox-aria-label.js +2 -2
  244. package/rules/jet/oj-acc-film-strip-aria-label.js +2 -2
  245. package/rules/jet/oj-acc-input-aria-label.js +2 -2
  246. package/rules/jet/oj-acc-select-aria-label.js +2 -2
  247. package/rules/jet/oj-cca-compjson-bp-ar.js +1 -1
  248. package/rules/jet/oj-cca-compjson-bp-dsplyname.js +1 -1
  249. package/rules/jet/oj-cca-compjson-bp-jetver.js +1 -1
  250. package/rules/jet/oj-cca-compjson-bp-obj.js +1 -1
  251. package/rules/jet/oj-cca-compjson-ns-reg.js +1 -1
  252. package/rules/jet/oj-css-bp-border-color.js +1 -1
  253. package/rules/jet/oj-css-bp-dir-flow.js +1 -1
  254. package/rules/jet/oj-css-bp-float.js +1 -1
  255. package/rules/jet/oj-css-bp-textalign.js +1 -1
  256. package/rules/jet/oj-css-style-abs-units.js +2 -2
  257. package/rules/jet/oj-css-style-bp-color.js +1 -1
  258. package/rules/jet/oj-css-style-bp-display.js +1 -1
  259. package/rules/jet/oj-css-style-bp-font-family.js +1 -1
  260. package/rules/jet/oj-css-style-bp-font.js +1 -1
  261. package/rules/jet/oj-css-style-deprecated.js +1 -1
  262. package/rules/jet/oj-css-style-override.js +2 -2
  263. package/rules/jet/oj-css-var-override.js +1 -1
  264. package/rules/jet/oj-form-maxcols.js +2 -2
  265. package/rules/jet/oj-html-5-attr-obs.js +1 -1
  266. package/rules/jet/oj-html-5-tag-obs.js +1 -1
  267. package/rules/jet/oj-html-alta-deprecated.js +6 -0
  268. package/rules/jet/oj-html-attr-$unique.js +1 -1
  269. package/rules/jet/oj-html-attr-2def.js +1 -1
  270. package/rules/jet/oj-html-attr-json.js +1 -1
  271. package/rules/jet/oj-html-attr-prefix-expr.js +1 -1
  272. package/rules/jet/oj-html-attr-prefix-ro.js +1 -1
  273. package/rules/jet/oj-html-attr-req.js +1 -1
  274. package/rules/jet/oj-html-bindforeach-data.js +2 -2
  275. package/rules/jet/oj-html-bindif-test.js +2 -2
  276. package/rules/jet/oj-html-binding-attr.js +2 -2
  277. package/rules/jet/oj-html-cca-count.js +1 -1
  278. package/rules/jet/oj-html-cca-tagname.js +2 -2
  279. package/rules/jet/oj-html-cdn.js +1 -1
  280. package/rules/jet/oj-html-combo-converter.js +1 -1
  281. package/rules/jet/oj-html-cspexpr.js +1 -1
  282. package/rules/jet/oj-html-databind-all.js +1 -1
  283. package/rules/jet/oj-html-dlg-title.js +2 -2
  284. package/rules/jet/oj-html-file-pick-accept.js +2 -2
  285. package/rules/jet/oj-html-form-bindif.js +1 -1
  286. package/rules/jet/oj-html-form-layout-maxcols.js +2 -2
  287. package/rules/jet/oj-html-form-noflex.js +1 -1
  288. package/rules/jet/oj-html-input-isodate.js +2 -2
  289. package/rules/jet/oj-html-invalid-doctype.js +2 -2
  290. package/rules/jet/oj-html-jq-databind.js +2 -2
  291. package/rules/jet/oj-html-ko-comment.js +1 -1
  292. package/rules/jet/oj-html-ko-databind.js +2 -2
  293. package/rules/jet/oj-html-label-for-prefix.js +1 -1
  294. package/rules/jet/oj-html-missing-doctype.js +1 -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 +1 -1
  299. package/rules/jet/oj-html-ojattr-520.js +1 -1
  300. package/rules/jet/oj-html-ojattr-deprecated.js +2 -2
  301. package/rules/jet/oj-html-ojattr-enum-deprecated.js +2 -2
  302. package/rules/jet/oj-html-ojattr-evt-syntax.js +2 -2
  303. package/rules/jet/oj-html-ojattr-value.js +1 -1
  304. package/rules/jet/oj-html-ojattr.js +2 -2
  305. package/rules/jet/oj-html-ojevent.js +2 -2
  306. package/rules/jet/oj-html-ojslot.js +2 -2
  307. package/rules/jet/oj-html-ojstyle.js +1 -1
  308. package/rules/jet/oj-html-ojtag-datacmd.js +2 -2
  309. package/rules/jet/oj-html-ojtag-datactx.js +1 -1
  310. package/rules/jet/oj-html-ojtag-deprecated.js +2 -2
  311. package/rules/jet/oj-html-ojtag-globattr-noprefix.js +2 -2
  312. package/rules/jet/oj-html-ojtag-id.js +1 -1
  313. package/rules/jet/oj-html-ojtag-nonglobattr-prefix.js +2 -2
  314. package/rules/jet/oj-html-ojtag-ns.js +1 -1
  315. package/rules/jet/oj-html-picker-attrs.js +2 -2
  316. package/rules/jet/oj-html-redwood-cssnovars.js +1 -1
  317. package/rules/jet/oj-html-redwood-cssvars.js +1 -1
  318. package/rules/jet/oj-html-self-close.js +1 -1
  319. package/rules/jet/oj-html-slot-item-minmax.js +1 -1
  320. package/rules/jet/oj-html-slot-name.js +2 -2
  321. package/rules/jet/oj-html-slot-pref-content.js +2 -2
  322. package/rules/jet/oj-html-style-abs-units.js +1 -1
  323. package/rules/jet/oj-html-style-bp-color.js +1 -1
  324. package/rules/jet/oj-html-style-bp-display.js +1 -1
  325. package/rules/jet/oj-html-style-bp-font-family.js +1 -1
  326. package/rules/jet/oj-html-style-bp-font.js +1 -1
  327. package/rules/jet/oj-html-style-deprecated.js +2 -2
  328. package/rules/jet/oj-html-style.js +1 -1
  329. package/rules/jet/oj-html-stylesel.js +1 -1
  330. package/rules/jet/oj-html-tag-attr-noprefix.js +2 -2
  331. package/rules/jet/oj-html-template-index.js +2 -2
  332. package/rules/jet/oj-html-unsup-theme.js +1 -1
  333. package/rules/jet/oj-html-wctag-$props.js +1 -1
  334. package/rules/jet/oj-html-wctag-arialabelledby.js +1 -1
  335. package/rules/jet/oj-html-wctag-for.js +1 -1
  336. package/rules/jet/oj-html-wctag-id.js +2 -2
  337. package/rules/jet/oj-html-wctag-nested.js +6 -0
  338. package/rules/jet/oj-html-wctag-packprivate.js +1 -1
  339. package/rules/jet/oj-js-comp-attr-deprecated.js +2 -2
  340. package/rules/jet/oj-js-comp-meth-deprecated.js +2 -2
  341. package/rules/jet/oj-js-no-ext-final.js +1 -1
  342. package/rules/jet/oj-js-noconsole.js +1 -1
  343. package/rules/jet/oj-js-ojcomp-deprecated.js +2 -2
  344. package/rules/jet/oj-js-ojcomp-exist.js +1 -1
  345. package/rules/jet/oj-js-ojcomp-new.js +1 -1
  346. package/rules/jet/oj-js-poly-promise.js +1 -1
  347. package/rules/jet/oj-js-var-undef.js +1 -1
  348. package/rules/jet/oj-json-syntax.js +1 -1
  349. package/rules/jet/oj-ts-comp-attr-deprecated.js +2 -2
  350. package/rules/jet/oj-ts-comp-meth-deprecated.js +2 -2
  351. package/rules/jet/oj-ts-no-ext-final.js +1 -1
  352. package/rules/jet/oj-ts-noconsole.js +1 -1
  353. package/rules/jet/oj-ts-ojcomp-deprecated.js +2 -2
  354. package/rules/jet/oj-ts-ojcomp-exist.js +1 -1
  355. package/rules/jet/oj-ts-ojcomp-new.js +1 -1
  356. package/rules/jet/oj-ts-poly-promise.js +1 -1
  357. package/rules/jet/rules.json +2 -2
  358. package/schema/component-schema.json +14 -1
  359. package/src/JafCore.js +2 -2
  360. package/types/index.d.ts +122 -82
  361. package/lib/imanual.js +0 -6
  362. package/lib/xmanual.js +0 -6
  363. package/rulepacks/jetwc-lib/component-audit-utils.js +0 -6
@@ -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 RULENAME="oj-html-notag-style";const DESCRIPTION="If a 'notag' version of a JET theme such as 'oj-redwood-notag-min-css' is applied, then it is recommended "+"that global HTML elements such as <h1>, <p>, or <ul> have the appropriate JET notag style class assigned "+"(such as 'oj-header', 'oj-p', or 'oj-ul'), to ensure that those tags remain consistent with the styling of "+"the underlying theme.";const SHORT_DESCRIPTION="If a 'notag' version of a JET theme such as 'oj-redwood-notag-min-css' is applied, it is "+"recommended that global elements have the appropriate style class assigned.";const TAGS={"body":"oj-body","h1":"oj-header","h2":"oj-header","h3":"oj-header","h4":"oj-header","h5":"oj-header","h6":"oj-header","hr":"oj-hr","a":"oj-link","ol":"oj-ol","ul":"oj-ul","p":"oj-p"};class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{globtag:this._onElem,file:this._onFile}}_onElem(ruleCtx,tag){var attrs,clazzes,style;if(!(style=TAGS[tag])){return}if(!this._hasNotagStyleSheet){return}if(attrs=ruleCtx.tagNode.attribs){if(clazzes=attrs.class){if(!_isStyle(clazzes,style)){_emitIssue(ruleCtx,tag,style,0);return}}}if(!attrs||!clazzes){_emitIssue(ruleCtx,tag,style,1)}}_onFile(ruleCtx){this._hasNotagStyleSheet=_isNoTagStyleSheet(ruleCtx)}};function _emitIssue(ruleCtx,tag,style,id){var issue,msg;tag=`<${tag}>`;msg=id===0?`${tag} - 'class' attribute does not include style '${style}'`:`${tag} - 'class' attribute with style '${style}' required`;issue=new ruleCtx.Issue(msg);if(id>0)issue.setMsgKey(RULENAME+"_"+id);ruleCtx.reporter.addIssue(issue,ruleCtx)};function _isStyle(clazzes,style){var styles,entry,ret=false;styles=clazzes.split(" ");for(entry of styles){if(entry&&entry.trim()===style){ret=true;break}}return ret};function _isNoTagStyleSheet(ruleCtx){var links,link,attribs,url,ret=false;if(links=ruleCtx.utils.DomUtils.getLinks()){for(link of links){if(attribs=link.attribs){if(attribs.rel==="stylesheet"){if(url=attribs.src||attribs.href){if(url.toLowerCase().indexOf("-notag")>=0){ret=true;break}}}}}}return ret};module.exports=Rule;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-ojattr-deprecated";const OJ_EVENT_PREFIX="on-oj-";const ON_EVENT_PREFIX="on-";const CHANGED="-changed";const DATABIND="data-bind";function getName(){return RULE_NAME};function getShortDescription(){return"Deprecated web component attributes should not be used"};function getDescription(){return"Deprecated web component attributes, or event attributes referring to a deprecated attribute, should not be used. Refer to the API doc for potential removal date."};function register(){return{"webcomp":_onWComp}};function _onWComp(ruleCtx,tag){var attrs,attr;if(ruleCtx.tagNode.attribs){attrs=ruleCtx.tagNode.attribs;for(attr in attrs){if(ruleCtx.utils.DomUtils.isCommonAttr(attr)||ruleCtx.utils.DomUtils.isCommonEventAttr(attr)||attr.startsWith(OJ_EVENT_PREFIX)||attr===DATABIND){continue}_checkAttr(ruleCtx,tag,attr)}}};function _checkAttr(ruleCtx,tag,attr){var isEvent,dep,since,issue,help,attrPos,metaLib;metaLib=ruleCtx.utils.metaLib;if(attr.startsWith(ON_EVENT_PREFIX)){if(attr.endsWith(CHANGED)){dep=metaLib.isTagEventDeprecated(tag,attr);isEvent=true}}else{dep=metaLib.isTagAttrDeprecated(tag,attr)}if(!dep){return}if(typeof dep==="object"){since=dep.since?" (since "+dep.since+")":"";help=dep.description?" "+dep.description:"";if(isEvent){issue=new ruleCtx.Issue(`'${attr}' refers to deprecated${since} <${tag}> attribute '${_getAttrFromEvent(attr)}'. ${help}`)}else{issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' is deprecated${since}!${help}`)}}else{if(isEvent){issue=new ruleCtx.Issue(`'${attr}' refers to deprecated <${tag}> attribute '${_getAttrFromEvent(attr)}'. ${dep}`)}else{issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' is deprecated! ${dep}`)}}attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);if(isEvent){issue.setMsgKey(RULE_NAME+"_1")}ruleCtx.reporter.addIssue(issue,ruleCtx)};function _getAttrFromEvent(attr){var x1,x2;if((x1=attr.indexOf("-"))<0){return attr}attr=attr.substring(x1+1);if((x2=attr.indexOf("-"))>=0){attr=attr.substring(0,x2)}return attr};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-ojattr-deprecated";const OJ_EVENT_PREFIX="on-oj-";const ON_EVENT_PREFIX="on-";const CHANGED="-changed";const DATABIND="data-bind";const STATUS_PROP_TYPE="propertyType";const STATUS_PROP_VALUE="propertyValue";const OBJECT="object";const STRING="string";const ARRAY_DOT_STRING="array.<string>";const ARRAY_STRING="array<string>";const OR="|";function getName(){return RULE_NAME};function getShortDescription(){return"Deprecated web component attributes should not be used"};function getDescription(){return"Deprecated web component attributes, or event attributes referring to a deprecated attribute, should not be used. Refer to the API doc for potential removal date."};function register(){return{"webcomp":_onWComp}};function _onWComp(ruleCtx,tag){var attrs,attr,attrName;if(ruleCtx.tagNode.attribs){attrs=ruleCtx.tagNode.attribs;for(attr in attrs){attrName=attr.charAt(0)!==":"?attr:attr.substring(1);if(ruleCtx.utils.DomUtils.isCommonAttr(attrName)||ruleCtx.utils.DomUtils.isCommonEventAttr(attrName)||attr.startsWith(OJ_EVENT_PREFIX)||attr===DATABIND){continue}_checkAttr(ruleCtx,tag,attrName,attrs[attr])}}};function _checkAttr(ruleCtx,tag,attr,attrVal){var isEvent,deps,status,metaLib;var propType,attrValType;var emitted=false;metaLib=ruleCtx.utils.metaLib;if(attr.startsWith(ON_EVENT_PREFIX)){if(attr.endsWith(CHANGED)){deps=metaLib.isTagEventDeprecated(tag,attr);isEvent=true}}else{deps=metaLib.isTagAttrDeprecated(tag,attr)}propType=metaLib.getTagAttrType(tag,attr);if(!deps&&!isEvent&&propType){if(!_isObjectType(propType)){return}_checkObjectProps(ruleCtx,tag,attr,attrVal);return}if(!deps){return}attrValType=_getValueType(attrVal);for(status of deps){if(status.target===STATUS_PROP_TYPE||status.target===STATUS_PROP_VALUE){if(attrValType==="expr"||attrValType==="Object"){continue}if(status.value){if(status.target===STATUS_PROP_VALUE){emitted=_doPropValue(ruleCtx,attrValType,tag,attr,attrVal,status,isEvent)}else{emitted=_doPropType(ruleCtx,propType,attrValType,tag,attr,attrVal,status,isEvent)}}else{_emitIssue(ruleCtx,tag,attr,attrVal,status,isEvent?"event":"attr");emitted=true}}else if(!status.value){_emitIssue(ruleCtx,tag,attr,attrVal,status,isEvent?"event":"attr");emitted=true}if(emitted){break}}};function _doPropValue(ruleCtx,attrValType,tag,attr,attrVal,status,isEvent){var ret=false;if(attrValType==="string"||attrValType==="number"){if(ruleCtx.rulePack.isRuleEnabled("oj-html-ojattr-enum-deprecated")){return}if(status.value.includes(attrVal)){_emitIssue(ruleCtx,tag,attr,attrVal,status,isEvent?"event":"val");ret=true}}return ret};function _doPropType(ruleCtx,propType,attrValType,tag,attr,attrVal,status,isEvent){var val;let propTypes=propType.split(OR);propTypes.forEach((val,x)=>{propTypes[x]=val.trim().toLowerCase()});if(status.value.includes(attrValType)){if(_isStringArrayType(attrValType)){val=ARRAY_DOT_STRING}else if(_isStringType(attrValType)){val=STRING}if(val){_emitIssue(ruleCtx,tag,attr,val,status,isEvent?"event":"type");return true}}if(_isStringArrayType(attrValType)){let typeVals=_getStringValsFromType(status.value);let attrVals=_getStringValsFromAttr(attrVal);let emitted=false;for(val of attrVals){if(typeVals.includes(val)){_emitIssue(ruleCtx,tag,attr,val,status,isEvent?"event":"type");emitted=true}}return emitted}return false};function _emitIssue(ruleCtx,tag,attr,attrVal,status,scope,key){var issue,attrPos;issue=_makeIssue(ruleCtx,tag,attr,attrVal,status,scope,key);attrPos=scope==="attrprop"||scope==="attrpropval"?ruleCtx.utils.DomUtils.getAttrValuePosition(ruleCtx.data,ruleCtx.tagNode,attr):ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)};function _makeIssue(ruleCtx,tag,attr,attrVal,status,scope,key){var issue,msgKey,since,descript;since=status.since?" (since "+status.since+")":"";descript=status.description?" "+status.description:"";if(scope==="event"){issue=new ruleCtx.Issue(`'${attr}' refers to deprecated${since} <${tag}> attribute '${_getAttrFromEvent(attr)}'.${descript}`);msgKey="_1"}else if(scope==="val"){issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' value '${attrVal}' is deprecated${since}!${descript}`);msgKey="_2"}else if(scope==="type"){issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' value type '${attrVal}' is deprecated${since}!${descript}`);msgKey="_3"}else if(scope==="attr"){issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' is deprecated${since}!${descript}`)}else if(scope==="attrprop"){issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' property '${key}' is deprecated${since}!${descript}`)}else if(scope==="attrpropval"){issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' property '${key}' value '${attrVal}' is deprecated${since}!${descript}`)}if(msgKey){issue.setMsgKey(RULE_NAME+msgKey)}return issue};function _checkObjectProps(ruleCtx,tag,attr,attrVal){var obj,key,deps,dep,metaLib,propType,propVal;if(attrVal.charAt(0)!=="{")return false;try{attrVal=attrVal.replace(/\'/g,"\"");obj=JSON.parse(attrVal);metaLib=ruleCtx.utils.metaLib;for(key in obj){let prop=attr+"."+key;if(deps=metaLib.isTagAttrDeprecated(tag,prop)){propType=metaLib.getTagAttrType(tag,prop);for(dep of deps){if(!dep.target||!dep.value){_emitIssue(ruleCtx,tag,attr,null,dep,"attrprop",key);return true}else if(dep.target===STATUS_PROP_VALUE&&dep.value){if(_isStringType(propType)){propVal=obj[key];if(dep.value.includes(propVal)){_emitIssue(ruleCtx,tag,attr,propVal,dep,"attrpropval",key);return true}}}}}}}catch(e){}return false};function _getStringValsFromType(ar){var val,ret=[];for(val of ar){if(!val.startsWith("Array<")){if(val.startsWith("'")&&val.endsWith("'")){val=val.substring(1,val.length-1)}ret.push(val)}else{let s=val.substring(6,val.length-1);let elems=s.split(OR);elems.forEach(val=>{val=val.trim();if(val.charAt(0)==="'"){val=val.substring(1,val.length-1)}ret.push(val.trim())})}}return ret};function _getStringValsFromAttr(s){var ret=[];if(s.startsWith("[")){s=s.substring(1,s.length-1);let elems=s.split(",");elems.forEach(val=>{if(val.charAt(0)==="'"){val=val.substring(1,val.length-1)}ret.push(val.trim())})}return ret};function _getValueType(v){var ret;if(v.startsWith("{{")||v.startsWith("[[")){ret="expr"}else{let s=v.charAt(0);if(s==="{"){ret="Object"}else if(s==="["){ret="Array"}else if(!isNaN(parseInt(v))){ret="number"}s=v.toLowerCase();if(s==="true"||s==="false"){ret="boolean"}else if(s==="null"){ret="null"}else if(!ret){ret="string"}}if(ret==="Array"){ret="Array<string>"}return ret};function _isStringArrayType(s){s=s.toLowerCase();return s===ARRAY_STRING||s===ARRAY_DOT_STRING};function _isStringType(s){return s.toLowerCase()===STRING};function _isObjectType(s){if(!s){var jj=42}return s.toLowerCase()===OBJECT};function _getAttrFromEvent(attr){var x1,x2;if((x1=attr.indexOf("-"))<0){return attr}attr=attr.substring(x1+1);if((x2=attr.indexOf("-"))>=0){attr=attr.substring(0,x2)}return attr};module.exports={getName,getDescription,getShortDescription,register};
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-ojattr-enum-deprecated";function getName(){return RULE_NAME};function getShortDescription(){return"Deprecated enumerated attribute values should not be used."};function getDescription(){return"Web component attributes that are assigned a deprecated enumerated value should not be used."};function register(){return{"webcomp":_onWc}};function _onWc(ruleCtx,tagName){var attribs,attrName,enumValue,issue,metaLib,o,since,help;metaLib=ruleCtx.utils.metaLib;attribs=ruleCtx.node.attribs;if(!attribs){return}for(attrName in attribs){issue=null;attrName=attrName.charAt(0)!==":"?attrName:attrName.substring(1);if(!(enumValue=attribs[attrName])){if(!(enumValue=attribs[":"+attrName])){return}}if(_isExpr(enumValue)){return}o=metaLib.isTagAttrEnumValueDeprecated(tagName,attrName,enumValue);if(o){help=o.description?" "+o.description.trim():"";since=o.since?" (since "+o.since+")":"";issue=new ruleCtx.Issue(`<${tagName}> attribute '${attrName}' enumerated value '${enumValue}' is deprecated${since}.${help}`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _isExpr(s){var start=s.substring(0,2);return start==="[["||start==="{{";_}module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-ojattr-enum-deprecated";function getName(){return RULE_NAME};function getShortDescription(){return"Deprecated enumerated attribute values should not be used."};function getDescription(){return"Web component attributes that are assigned a deprecated enumerated value should not be used."};function register(){return{"webcomp":_onWc}};function _onWc(ruleCtx,tagName){var attribs,attrName,enumValue,issue,metaLib,o,since,help;metaLib=ruleCtx.utils.metaLib;attribs=ruleCtx.node.attribs;if(!attribs){return}for(attrName in attribs){issue=null;attrName=attrName.charAt(0)!==":"?attrName:attrName.substring(1);if(!(enumValue=attribs[attrName])){if(!(enumValue=attribs[":"+attrName])){return}}if(_isExpr(enumValue)){return}o=metaLib.isTagAttrEnumValueDeprecated(tagName,attrName,enumValue);if(o){help=o.description?" "+o.description.trim():"";since=o.since?" (since "+o.since+")":"";issue=new ruleCtx.Issue(`<${tagName}> attribute '${attrName}' enumerated value '${enumValue}' is deprecated${since}.${help}`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _isExpr(s){var start=s.substring(0,2);return start==="[["||start==="{{"}module.exports={getName,getDescription,getShortDescription,register};
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-ojattr-evt-syntax";function getName(){return RULE_NAME};function getShortDescription(){return"Web component event listener attributes should not use {{...}} notation"};function getDescription(){return"A web component event listener attribute cannot use '{{ . . . }}' notation because writeback is inapplicable. Use '[[. . .]]' notation."+"<p>For example, change:<br>"+" <oj-accordion on-oj-before-collapse='{{listener}}'></oj-accordion><br>"+"to:<br>"+" <oj-accordion on-oj-before-collapse='[[listener]]'></oj-accordion><br>"};function register(){return{"event":_handleEvent}};function _handleEvent(ruleCtx,evtName,evtValue){var issue;if(evtValue.val.startsWith("{{")){issue=new ruleCtx.Issue("Event attribute '"+evtName+"' cannot use writeback notation - replace with [[...]]");ruleCtx.reporter.addIssue(issue,ruleCtx)}};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-ojattr-evt-syntax";function getName(){return RULE_NAME};function getShortDescription(){return"Web component event listener attributes should not use {{...}} notation"};function getDescription(){return"A web component event listener attribute cannot use '{{ . . . }}' notation because writeback is inapplicable. Use '[[. . .]]' notation."+"<p>For example, change:<br>"+" <oj-accordion on-oj-before-collapse='{{listener}}'></oj-accordion><br>"+"to:<br>"+" <oj-accordion on-oj-before-collapse='[[listener]]'></oj-accordion><br>"};function register(){return{"event":_handleEvent}};function _handleEvent(ruleCtx,evtName,evtValue){if(evtValue.val.startsWith("{{")){let issue=new ruleCtx.Issue("Event attribute '"+evtName+"' cannot use writeback notation - replace with [[...]]");ruleCtx.reporter.addIssue(issue,ruleCtx)}};module.exports={getName,getDescription,getShortDescription,register};
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const isValidAttr=require("./helpers/valid-attr");const RULE_NAME="oj-html-ojattr";const OJ_EVENT_PREFIX="on-oj-";const EVENT_PREFIX="on-";const SLOT="slot";const DATABIND="data-bind";const DATACMD="data-oj-command";const DATACONTEXT="data-oj-context";function getName(){return RULE_NAME};function getShortDescription(){return"JET component attribute must be known"};function getDescription(){return"JET component attribute must be a defined attribute for the component"};function register(){return{"webcomp":_onWComp}};function _onWComp(ruleCtx,tag){var attrs,attr;if(ruleCtx.tagNode.attribs){attrs=ruleCtx.tagNode.attribs;for(attr in attrs){_checkAttr(ruleCtx,tag,attr)}}}function _checkAttr(ruleCtx,tag,attr){var issue,origAttr,attrPos,utils;utils=ruleCtx.utils;origAttr=attr;attr=attr.charAt(0)===":"?attr.substr(1):attr;if(attr==="\""){return}if(!isValidAttr(attr)){issue=new ruleCtx.Issue(`<${tag}> - invalid ${origAttr.charAt(0)===":"?"colon-prefixed":""} attribute '${origAttr}'`);attrPos=utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,origAttr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);issue.setMsgKey(RULE_NAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx);return}utils=ruleCtx.utils;if(utils.DomUtils.isCommonAttr(attr)||utils.DomUtils.isCommonEventAttr(attr)||attr===SLOT||attr===DATABIND||attr===DATACMD||attr===DATACONTEXT||attr.startsWith(OJ_EVENT_PREFIX)||attr.startsWith(EVENT_PREFIX)){return}if(!utils.metaLib.isTagAttr(tag,attr)){if(!utils.metaLib.isTagEvent(tag,attr)){issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' is unknown`);attrPos=utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,origAttr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}};module.exports={getName,getDescription,getShortDescription,register};
6
+ const isValidAttr=require("./helpers/valid-attr");const RULE_NAME="oj-html-ojattr";const OJ_EVENT_PREFIX="on-oj-";const EVENT_PREFIX="on-";const SLOT="slot";const DATABIND="data-bind";const DATACMD="data-oj-command";const DATACONTEXT="data-oj-context";function getName(){return RULE_NAME};function getShortDescription(){return"JET component attribute must be defined"};function getDescription(){return"JET component attribute must be a defined attribute for the component"};function register(){return{"webcomp":_onWComp}};function _onWComp(ruleCtx,tag){var attrs,attr;if(ruleCtx.tagNode.attribs){attrs=ruleCtx.tagNode.attribs;for(attr in attrs){_checkAttr(ruleCtx,tag,attr)}}}function _checkAttr(ruleCtx,tag,attr){var issue,origAttr,attrPos,utils;utils=ruleCtx.utils;origAttr=attr;attr=attr.charAt(0)===":"?attr.substr(1):attr;if(attr==="\""){return}if(!isValidAttr(attr)){issue=new ruleCtx.Issue(`<${tag}> - invalid ${origAttr.charAt(0)===":"?"colon-prefixed":""} attribute '${origAttr}'`);attrPos=utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,origAttr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);issue.setMsgKey(RULE_NAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx);return}utils=ruleCtx.utils;if(utils.DomUtils.isCommonAttr(attr)||utils.DomUtils.isCommonEventAttr(attr)||attr===SLOT||attr===DATABIND||attr===DATACMD||attr===DATACONTEXT||attr.startsWith(OJ_EVENT_PREFIX)||attr.startsWith(EVENT_PREFIX)){return}if(!utils.metaLib.isTagAttr(tag,attr)){if(!utils.metaLib.isTagEvent(tag,attr)){issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' is unknown`);attrPos=utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,origAttr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}};module.exports={getName,getDescription,getShortDescription,register};
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-ojevent";function getName(){return RULE_NAME};function getShortDescription(){return"Web component event attribute must be valid"};function getDescription(){return"Web component event attribute (e.g. \"on-oj-action\") must be a defined event for the component."};function register(){return{"event":_handleAttr}};function _handleAttr(ruleCtx,attrName){var tagName,issue,metaLib;metaLib=ruleCtx.utils.metaLib;tagName=ruleCtx.tag;if(metaLib.isWCTag(tagName)){if(!metaLib.isTagEvent(tagName,attrName)){if(!_specialCase(tagName,attrName)){issue=new ruleCtx.Issue("<"+tagName+"> event '"+attrName+"' is unknown");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _specialCase(tagName,attrName){if(tagName==="oj-messages"&&attrName==="on-oj-close"){return true}return false};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-ojevent";function getName(){return RULE_NAME};function getShortDescription(){return"Web component event attribute must be valid"};function getDescription(){return"Web component event attribute (e.g. \"on-oj-action\") must be a defined event for the component."};function register(){return{"event":_onEvent}};function _onEvent(ruleCtx,attrName){var tagName,issue,metaLib;metaLib=ruleCtx.utils.metaLib;tagName=ruleCtx.tag;if(!metaLib.isTagEvent(tagName,attrName)){if(metaLib.isWCTag(tagName)){if(!_specialCase(tagName,attrName,metaLib)){issue=new ruleCtx.Issue("<"+tagName+"> event '"+attrName+"' is unknown");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _specialCase(tagName,attrName,metaLib){if(tagName==="oj-messages"&&attrName==="on-oj-close"){return true}};module.exports={getName,getDescription,getShortDescription,register};
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-ojslot";function getName(){return RULE_NAME};function getShortDescription(){return"<oj-bind-slot> should be used instead of deprecated <oj-slot>"};function getDescription(){return"<i><oj-slot></i> has been <b>deprecated</b> since it is a binding-only element, and not a full custom "+"element with properties and methods that can be accessed. Replace with <i><oj-bind-slot></i>."};function register(){return{"ojtag":function(ruleCtx,tagName){if(tagName==="oj-slot"){var issue=new ruleCtx.Issue("<oj-slot> is deprecated. Use <oj-bind-slot>.");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-ojslot";function getName(){return RULE_NAME};function getShortDescription(){return"<oj-bind-slot> should be used instead of deprecated <oj-slot>"};function getDescription(){return"<i><oj-slot></i> has been <b>deprecated</b> since it is a binding-only element, and not a full custom "+"element with properties and methods that can be accessed. Replace with <i><oj-bind-slot></i>."};function register(){return{"<oj-slot>":function(ruleCtx){var issue=new ruleCtx.Issue("<oj-slot> is deprecated. Use <oj-bind-slot>.");ruleCtx.reporter.addIssue(issue,ruleCtx)}}};module.exports={getName,getDescription,getShortDescription,register};
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-ojtag-datacmd";const DATA_OJ_CMD="data-oj-command";const OJ_MENU="oj-menu";const OJ_OPTION="oj-option";const OJ_PREFIX="oj-";function getName(){return RULE_NAME};function getShortDescription(){return"JET web component property 'data-oj-command' can only be used if defined for the component"};function getDescription(){return"Attribute 'data-oj-command' should not be used on JET web component elements if the component does not have a list of "+"values defined for it - refer to the JET API documentation for the component."};function register(){return{"attr":_handleAttr}};function _handleAttr(ruleCtx,attrName){var node;if(attrName!==DATA_OJ_CMD){return}if(ruleCtx.tag!==OJ_OPTION){_emitIssue(ruleCtx,ruleCtx.tag,1);return}if(!ruleCtx.utils.DomUtils.isChildOfElem(OJ_MENU,ruleCtx.tagNode)){_emitIssue(ruleCtx,ruleCtx.tag,2);return}node=_findParentComponent(ruleCtx.tagNode);if(!node){_emitIssue(ruleCtx,ruleCtx.tag,3);return}if(!ruleCtx.utils.metaLib.isTagAttr(node.name,DATA_OJ_CMD)){_emitIssue(ruleCtx,node.name,0);return}};function _emitIssue(ruleCtx,tagName,msgNum){var issue,attrPos;if(msgNum===0){issue=new ruleCtx.Issue("Attribute 'data-oj-command' has no defined values for <"+tagName+">")}else if(msgNum===1){issue=new ruleCtx.Issue("Attribute 'data-oj-command' must appear on <oj-option> not <"+tagName+">")}else if(msgNum===2){issue=new ruleCtx.Issue("Attribute 'data-oj-command' - containing <oj-option> is not a child of <oj-menu>")}else if(msgNum===3){issue=new ruleCtx.Issue("Attribute 'data-oj-command' - unable to locate containing component of the associated <oj-menu>")}if(msgNum){issue.setMsgKey(RULE_NAME+"_"+msgNum)}attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,DATA_OJ_CMD);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)};function _findParentComponent(node){var name,ret=false;while(node&&node.parent){name=node.parent.name;if(name.startsWith(OJ_PREFIX)){if(name!=="oj-bind-if"&&name!=="oj-bind-for-each"&&name!==OJ_MENU){ret=node.parent;break}}node=node.parent}return ret};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-ojtag-datacmd";const DATA_OJ_CMD="data-oj-command";const OJ_MENU="oj-menu";const OJ_OPTION="oj-option";const OJ_PREFIX="oj-";const OJ_DEFER="oj-defer";function getName(){return RULE_NAME};function getShortDescription(){return"JET web component property 'data-oj-command' can only be used if defined for the component"};function getDescription(){return"Attribute 'data-oj-command' should not be used on JET web component elements if the component does not have a list of "+"values defined for it - refer to the JET API documentation for the component."};function register(){return{"<data-oj-command=>":_onAttr}};function _onAttr(ruleCtx){var node;if(ruleCtx.tag!==OJ_OPTION){_emitIssue(ruleCtx,ruleCtx.tag,1);return}if(!ruleCtx.utils.DomUtils.isChildOfElem(OJ_MENU,ruleCtx.tagNode)){_emitIssue(ruleCtx,ruleCtx.tag,2);return}node=_findParentComponent(ruleCtx.tagNode);if(!node){_emitIssue(ruleCtx,ruleCtx.tag,3);return}if(!ruleCtx.utils.metaLib.isTagAttr(node.name,DATA_OJ_CMD)){_emitIssue(ruleCtx,node.name,0);return}};function _emitIssue(ruleCtx,tagName,msgNum){var issue,attrPos;if(msgNum===0){issue=new ruleCtx.Issue("Attribute 'data-oj-command' has no defined values for <"+tagName+">")}else if(msgNum===1){issue=new ruleCtx.Issue("Attribute 'data-oj-command' must appear on <oj-option> not <"+tagName+">")}else if(msgNum===2){issue=new ruleCtx.Issue("Attribute 'data-oj-command' - containing <oj-option> is not a child of <oj-menu>")}else if(msgNum===3){issue=new ruleCtx.Issue("Attribute 'data-oj-command' - unable to locate containing component of the associated <oj-menu>")}if(msgNum){issue.setMsgKey(RULE_NAME+"_"+msgNum)}attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,DATA_OJ_CMD);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)};function _findParentComponent(node){var name,ret=false;while(node&&node.parent){name=node.parent.name;if(name.startsWith(OJ_PREFIX)){if(name!=="oj-bind-if"&&name!=="oj-bind-for-each"&&name!==OJ_MENU&&name!==OJ_DEFER){ret=node.parent;break}}node=node.parent}return ret};module.exports={getName,getDescription,getShortDescription,register};
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-ojtag-deprecated";const SHORT="Deprecated custom components should not be used";const LONG="Deprecated custom components should not be used. Refer to the diagnostic issued for a suggested replacement.";class Rule{getName(){return RULE_NAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(){return{"webcomp":this._onWC}}_onWC(ruleCtx,tag){var issue,metaLib,dep,depText,depSince;if(tag==="oj-slot"){return}metaLib=ruleCtx.utils.metaLib;dep=metaLib.isTagDeprecated(tag);if(dep){if(typeof dep==="object"){depText=dep.description?" "+dep.description:"";depSince=dep.since?" (since "+dep.since+")":null}else{depText=" "+dep;depSince=""}issue=new ruleCtx.Issue(`<${tag}> is deprecated${depSince}.${depText}`);if(!ruleCtx.ojTag){issue.setMsgKey(RULE_NAME+"_1")}ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;
6
+ const RULE_NAME="oj-html-ojtag-deprecated";const SHORT="Deprecated custom components should not be used";const LONG="Deprecated custom components should not be used. Refer to the diagnostic issued for a suggested replacement.";class Rule{getName(){return RULE_NAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(){return{"webcomp":this._onWC}}_onWC(ruleCtx,tag){var issue,metaLib,status,descript,since,depText,depSince;if(tag==="oj-slot"){return}metaLib=ruleCtx.utils.metaLib;if(status=metaLib.isTagDeprecated(tag)){descript=status.description?" "+status.description:"";since=status.since?" (since "+status.since+")":null;issue=new ruleCtx.Issue(`<${tag}> is deprecated${since}.${descript}`);if(!ruleCtx.ojTag){issue.setMsgKey(RULE_NAME+"_1")}ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-ojtag-globattr-noprefix";function getName(){return RULE_NAME};function getShortDescription(){return"JET web component element with global attribute with an attribute expression and no ':' prefix is invalid"};function getDescription(){return"On elements that are JET web components, any use of a global attribute "+"not prefixed with <b>':'</b> and with an expression such as <b>attr=\"[[...]]\"</b> or <b>attr=\"{{...}}\"</b>, is invalid."};function register(){return{"ojtag":_handleTag}};function _handleTag(ruleCtx,tagName){var attribs,attrib,attrValue,issue,DomUtils,attrPos;attribs=ruleCtx.node.attribs;if(!attribs){return}DomUtils=ruleCtx.utils.DomUtils;for(attrib in attribs){if(DomUtils.isCommonAttr(attrib)){if(attrib.startsWith("data-")){if(ruleCtx.utils.metaLib.isTagAttr(tagName,attrib)){continue}}if(attrib.charAt(0)!==":"){attrValue=attribs[attrib];if(attrValue.startsWith("[[")||attrValue.startsWith("{{")){issue=new ruleCtx.Issue("Use of attribute expression with an unprefixed global attribute '"+attrib+"' is invalid for <"+tagName+">");attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-ojtag-globattr-noprefix";function getName(){return RULE_NAME};function getShortDescription(){return"On a web component, use of a global attribute with an expression requires that the attribute be prefixed with ':'"};function getDescription(){return"On web component elements, any use of a global attribute "+"not prefixed with <b>':'</b> and with an expression such as <b>attr=\"[[...]]\"</b> or <b>attr=\"{{...}}\"</b>, is invalid."};function register(){return{"ojtag":_handleTag}};function _handleTag(ruleCtx,tagName){var attribs,attrib,attrValue,issue,DomUtils,attrPos;attribs=ruleCtx.node.attribs;if(!attribs){return}DomUtils=ruleCtx.utils.DomUtils;for(attrib in attribs){if(DomUtils.isCommonAttr(attrib)){if(attrib.startsWith("data-")){if(ruleCtx.utils.metaLib.isTagAttr(tagName,attrib)){continue}}if(attrib.charAt(0)!==":"){attrValue=attribs[attrib];if(attrValue.startsWith("[[")||attrValue.startsWith("{{")){issue=new ruleCtx.Issue(`Expression-bound global attribute '${attrib}' without ':' prefix found on <${tagName}> - use ':${attrib}'`);attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}};module.exports={getName,getDescription,getShortDescription,register};
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-ojtag-nonglobattr-prefix";function getName(){return RULE_NAME};function getShortDescription(){return"JET component element with non-global attribute with an attribute expression and no ':' prefix is not recommended"};function getDescription(){return"On elements that are JET components/composites, any use of a non-global attribute "+"prefixed with ':' and with an attribute expression such as attr=\"[[...]]\" or attr=\"{{...}}\", is not recommended."};function register(){return{"ojtag":_handleTag}};function _handleTag(ruleCtx,tagName){var attribs,attrib,attrValue,DomUtils,attrPos,issue;attribs=ruleCtx.node.attribs;if(!attribs){return}DomUtils=ruleCtx.utils.DomUtils;for(attrib in attribs){if(tagName==="oj-label"&&(attrib==="for"||attrib===":for")){continue}if(!DomUtils.isCommonAttr(attrib)){if(attrib.charAt(0)===":"){attrValue=attribs[attrib];if(attrValue.startsWith("[[")||attrValue.startsWith("{{")){issue=new ruleCtx.Issue("Use of attribute expression with non-global prefixed attribute '"+attrib+"' is invalid for <"+tagName+">");attrPos=DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-ojtag-nonglobattr-prefix";function getName(){return RULE_NAME};function getShortDescription(){return"Web component elements with a non-global attribute with a ':' prefix and an attribute expression, is not recommended"};function getDescription(){return"On web component elements, any use of a non-global attribute "+"prefixed with ':' and with an attribute expression such as attr=\"[[...]]\" or attr=\"{{...}}\", is not recommended."};function register(){return{"ojtag":_handleTag}};function _handleTag(ruleCtx,tagName){var attribs,attrib,attrValue,DomUtils,attrPos,issue;attribs=ruleCtx.node.attribs;if(!attribs){return}DomUtils=ruleCtx.utils.DomUtils;for(attrib in attribs){if(tagName==="oj-label"&&(attrib==="for"||attrib===":for")){continue}if(!DomUtils.isCommonAttr(attrib)){if(attrib.charAt(0)===":"){attrValue=attribs[attrib];if(attrValue.startsWith("[[")||attrValue.startsWith("{{")){issue=new ruleCtx.Issue(`Expression-bound non-global attribute '${attrib}' with ':' prefix found on <${tagName}> - use '${attrib.substring(1)}'`);attrPos=DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}};module.exports={getName,getDescription,getShortDescription,register};
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULENAME="oj-html-picker-attrs";const DESCRIPTION="Attribute 'picker-attributes.style' violates the recommended Content Security Policy (CSP) which disallows inline styles, and is therefore ignored in JET 11.0.";const SHORT_DESCRIPTION="Attribute 'picker-attributes.style' is a CSP violation(no inline styles), and is ignored.";const MSG="Attribute 'picker-attributes.style' is ignored in JET 11.0.0, and is a CSP violation - use 'picker-attributes.class'";const TAGS=new Set(["oj-input-date","oj-input-date-time","oj-input-time","oj-date-picker","oj-date-time-picker","oj-select-many","oj-combobox-many","oj-combobox-one"]);const PICKER_ATTRIB="picker-attributes";const STYLE="style";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{ojtag:this._onOJTag}}_onOJTag(ruleCtx,tag){var attribs;if(!TAGS.has(tag)){return}if(attribs=ruleCtx.tagNode.attribs){if(attribs.hasOwnProperty(PICKER_ATTRIB)){let o=attribs[PICKER_ATTRIB];if(!_isExpr(o)&&o.charAt(0)==="{"){try{let o=JSON.parse(attribs[PICKER_ATTRIB]);if(o&&o.hasOwnProperty(STYLE)){let issue=new ruleCtx.Issue(MSG);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,PICKER_ATTRIB);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}catch(e){}}}}}}function _isExpr(s){s=s.substring(0,2);return s==="[["||s==="{{"}module.exports=Rule;
6
+ const RULENAME="oj-html-picker-attrs";const DESCRIPTION="Attribute 'picker-attributes.style' violates the recommended Content Security Policy (CSP) which disallows inline styles, and is therefore ignored in JET 11.0.";const SHORT_DESCRIPTION="Attribute 'picker-attributes.style' is a CSP violation(no inline styles), and is ignored.";const MSG="Attribute 'picker-attributes.style' is ignored in JET 11.0.0, and is a CSP violation - use 'picker-attributes.class'";const PICKER_ATTRIB="picker-attributes";const STYLE="style";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-input-date>":this._onTag,"<oj-input-date-time>":this._onTag,"<oj-input-time>":this._onTag,"<oj-date-picker>":this._onTag,"<oj-date-time-picker>":this._onTag,"<oj-select-many>":this._onTag,"<oj-combobox-many>":this._onTag,"<oj-combobox-one>":this._onTag}}_onTag(ruleCtx){var attribs;if(attribs=ruleCtx.tagNode.attribs){if(attribs.hasOwnProperty(PICKER_ATTRIB)){let o=attribs[PICKER_ATTRIB];if(!_isExpr(o)&&o.charAt(0)==="{"){try{let o=JSON.parse(attribs[PICKER_ATTRIB]);if(o&&o.hasOwnProperty(STYLE)){let issue=new ruleCtx.Issue(MSG);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,PICKER_ATTRIB);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}catch(e){}}}}}}function _isExpr(s){s=s.substring(0,2);return s==="[["||s==="{{"}module.exports=Rule;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const getParentNodeForSlot=require("./helpers/has-slot-name");const RULE_NAME="oj-html-slot-name";const DESCRIPT="The element specifies a slot attribute value that is not defined by the slot owning component.";const SHORT=DESCRIPT;const SLOT="slot";const TEMPLATE="template";function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(){return{"elem":this._onElem}};Rule.prototype._onElem=function(ruleCtx,tag){var slotVal;if(ruleCtx.tagNode.attribs&&(slotVal=ruleCtx.tagNode.attribs.slot)&&tag!==TEMPLATE){this._onSlot(ruleCtx,slotVal)}};Rule.prototype._onSlot=function(ruleCtx,slotVal){var issue,node;node=getParentNodeForSlot(ruleCtx,slotVal);if(!node){issue=new ruleCtx.Issue(`unresolved slot '${slotVal}' on <${ruleCtx.tag}>`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,SLOT);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx);return}};module.exports=Rule;
6
+ const getParentNodeForSlot=require("./helpers/has-slot-name");const RULE_NAME="oj-html-slot-name";const DESCRIPT="The element specifies a slot attribute value that is not defined by the slot owning component.";const SHORT=DESCRIPT;const SLOT="slot";const TEMPLATE="template";function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(){return{"<slot=>":this._onSlot}};Rule.prototype._onSlot=function(ruleCtx,slot,slotVal){if(slotVal&&!_isExpr(slotVal)&&ruleCtx.tagNode.name!==TEMPLATE){this._slotAttr(ruleCtx,slotVal)}};Rule.prototype._slotAttr=function(ruleCtx,slotVal){var issue,node;node=getParentNodeForSlot(ruleCtx,slotVal);if(!node){issue=new ruleCtx.Issue(`unresolved slot '${slotVal}' on <${ruleCtx.tag}>`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,SLOT);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx);return}};function _isExpr(s){return s.startsWith("[[")||s.startsWith("{{")};module.exports=Rule;
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const getParentNodeForSlot=require('./helpers/has-slot-name');const RULE_NAME='oj-html-slot-pref-content';const DESCRIPT='When component metadata defines \'preferredContent\' for a slot, child elements placed into that slot should '+'implement one or more of the requested interfaces and document that through their \'implements\' metadata. '+'This rule applies to components that are directly allocated to a slot, or which are direct children '+'of a template allocated to that slot.';const SHORT=DESCRIPT;const TEMPLATE='template';const OJ_SWITCHER='oj-switcher';function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(){return{'elem':this._onElem}};Rule.prototype._onElem=function(ruleCtx){var slotVal;if(ruleCtx.tagNode.attribs&&(slotVal=ruleCtx.tagNode.attribs.slot)){this._onSlot(ruleCtx,slotVal)}};Rule.prototype._onSlot=function(ruleCtx,slotVal){var issue,node;if(!(node=getParentNodeForSlot(ruleCtx,slotVal))){return}if(node.name!==OJ_SWITCHER){let sc=ruleCtx.utils.metaLib.getPreferredSlotContent(node.name,slotVal);if(sc&&sc.interfaces){let ar;if(ruleCtx.tag===TEMPLATE){if(!(ar=_getChildTags(ruleCtx.tagNode.children))){return}}else{ar=[ruleCtx.tagNode]}for(let i=0;i<ar.length;i++){if(!sc.components.includes(ar[i].name)){var ifc=_list(sc.interfaces,'or');var comp=_list(sc.components,'or',true);var multi=sc.interfaces.length>1;if(multi){issue=new ruleCtx.Issue(`Slot '${slotVal}' for <${node.name}> should contain components implementing interfaces ${ifc} (e.g. ${comp})`)}else{issue=new ruleCtx.Issue(`Slot '${slotVal}' for <${node.name}> should contain a component implementing interface ${ifc} (e.g. ${comp})`)}issue.setPosition(null,null,ar[i].startIndex,ar[i].startIndex+ar[i].name.length);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}};function _getChildTags(childs){var a;if(childs){for(let i=0;i<childs.length;i++){if(childs[i].type==='tag'){if(!a){a=[]}a.push(childs[i])}}}return a};function _list(a,orand,isComp){var s='';for(let i=0;i<a.length;i++){if(i){if(i===a.length-1){s+=(isComp?'>':'\'')+' '+orand+' '}else{s+=(isComp?'<':'\'')+' '}}s+=(isComp?'<':'\'')+a[i]}return s?s+=isComp?'>':'\'':s}module.exports=Rule;
6
+ const getParentNodeForSlot=require('./helpers/has-slot-name');const RULE_NAME='oj-html-slot-pref-content';const DESCRIPT='When component metadata defines \'preferredContent\' for a slot, child elements placed into that slot should '+'implement one or more of the requested interfaces and document that through their \'implements\' metadata. '+'This rule applies to components that are directly allocated to a slot, or which are direct children '+'of a template allocated to that slot.';const SHORT=DESCRIPT;const TEMPLATE='template';const OJ_SWITCHER='oj-switcher';const TAG='tag';function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){this._metaLib=regCtx.utils.metaLib;this._hasJetWCInterfaces=this._metaLib.hasJetWCInterfaces();return{'elem':this._onElem}};Rule.prototype._onElem=function(ruleCtx){var slotName;if(ruleCtx.tagNode.attribs&&(slotName=ruleCtx.tagNode.attribs.slot)){this._onSlot(ruleCtx,slotName)}};Rule.prototype._onSlot=function(ruleCtx,slotName){var issue,pnode,xnode,tag,sc,ar;if(!(pnode=getParentNodeForSlot(ruleCtx,slotName))){return}if(pnode.name===OJ_SWITCHER||!this._metaLib.isWCTag(pnode.name)){return}if(ruleCtx.utils.DomUtils.isCommonElem(ruleCtx.tagNode.name)||ruleCtx.tagNode.name===TEMPLATE){xnode=pnode}else{xnode=ruleCtx.tagNode}if(this._metaLib.isJetTag(xnode.name)&&!this._hasJetWCInterfaces){return}sc=this._metaLib.getPreferredSlotContent(xnode.name,slotName);if(!(sc&&sc.interfaces)){return}if(ar=_getChildTags(ruleCtx.tagNode.children)){ar.forEach(child=>{if(child.name!==TEMPLATE){tag=child.name;if(!tag.startsWith('oj-bind')&&tag!=='oj-defer'){if(!(sc.components&&sc.components.includes(tag))){var ifc=_list(sc.interfaces,'or');var comp=sc.components?`( e.g. ${_list(sc.components,'or',true)})`:'';var multi=sc.interfaces.length>1;issue=new ruleCtx.Issue(`Slot '${slotName}' in <${pnode.name}> should contain ${multi?'components':'a component'} implementing interface${multi?'s':''} ${ifc}${comp}`);issue.setPosition(null,null,child.startIndex,child.startIndex+tag.length);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}})}};function _getChildTags(childs){var a;if(childs){for(let i=0;i<childs.length;i++){if(childs[i].type===TAG){if(!a){a=[]}a.push(childs[i])}}}return a};function _list(a,orand,isComp){var s='';for(let i=0;i<a.length;i++){if(i){if(i===a.length-1){s+=(isComp?'>':'\'')+' '+orand+' '}else{s+=(isComp?'<':'\'')+' '}}s+=(isComp?'<':'\'')+a[i]}return s?s+=isComp?'>':'\'':s}module.exports=Rule;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const getStyles=require("./helpers/extractStylesFromClass");const RULE_NAME="oj-html-style-deprecated";const SHORT="Deprecated 'class' attributes with 'oj-' prefix should not be used.";const LONG="Deprecated 'class' attribute styles prefixed with 'oj-' should not be used. Refer to the diagnostic for a suggested replacement.";function Rule(){this._checkList=null;this._isAccept=false};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return LONG};Rule.prototype.register=function(regCtx){if(!this._checkAcceptReject(regCtx)){return false}return{"class":this._onClass}};Rule.prototype._onClass=function(ruleCtx,attrName,attrValue){var i,dataBindChecked=false,classes,style,dep,component,comps,metaLib,DomUtils,issue;metaLib=ruleCtx.utils.metaLib;DomUtils=ruleCtx.utils.DomUtils;classes=getStyles(attrValue);for(i=0;i<classes.length;i++){style=classes[i];if(!dataBindChecked){component=DomUtils.getDataBindComponent(ruleCtx);dataBindChecked=true}if(component){comps=metaLib.getClassesFromStyle(style);if(comps&&comps.length&&comps.indexOf(component)>=0){continue}}if(this._OkStyle(style)){dep=metaLib.isStyleDeprecated(style);if(dep){if(dep.description&&!dep.description.endsWith(".")){dep.description=dep.description+"."}issue=new ruleCtx.Issue("Deprecated style class '"+style+"'"+(dep.since?" (since "+dep.since+").":"")+(dep.description?" "+dep.description:""));ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};Rule.prototype._OkStyle=function(style){if(this._checkList){for(let i=0;i<this._checkList.length;i++){if(this._checkList[i].test(style)){return this._isAccept}}return!this._isAccept}return true};Rule.prototype._checkAcceptReject=function(regCtx){var accept=regCtx.ruleOpts["accept"];var reject=regCtx.ruleOpts["reject"];if(accept||reject){if(accept&&reject){regCtx.utils.msgLib.error("Rule "+RULE_NAME+": options 'accept' and 'reject' are mutually exclusive");return false}if(accept){this._checkList=accept;this._isAccept=true}else{this._checkList=reject}if(!Array.isArray(this._checkList)){regCtx.utils.msgLib.error("Rule "+RULE_NAME+": option '"+(accept?"accept":"reject")+"' is not an array");return false}for(let i=0;i<this._checkList.length;i++){if(typeof this._checkList[i]==="string"){this._checkList[i]=new RegExp(this._checkList[i].trim())}}}return true};module.exports=Rule;
6
+ const getStyles=require("./helpers/extractStylesFromClass");const StyleSelector=require("./helpers/style-selector");const RULE_NAME="oj-html-style-deprecated";const SHORT="Deprecated 'class' attributes with 'oj-' prefix should not be used.";const LONG="Deprecated 'class' attribute styles prefixed with 'oj-' should not be used. Refer to the diagnostic for a suggested replacement.";function Rule(){this._checkList=null;this._isAccept=false};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return LONG};Rule.prototype.register=function(regCtx){if(!this._checkAcceptReject(regCtx)){return false}this._metaLib=regCtx.utils.metaLib;StyleSelector.setAssertMsg(regCtx.utils.msgLib.assert);return{"class":this._onClass}};Rule.prototype._onClass=function(ruleCtx,attrName,attrValue){var i,dataBindChecked=false,classes,style,deps,dep,component,comps;if(!this._domUtils){this._domUtils=ruleCtx.utils.DomUtils}classes=getStyles(attrValue);for(i=0;i<classes.length;i++){style=classes[i];if(!dataBindChecked){component=this._domUtils.getDataBindComponent(ruleCtx);dataBindChecked=true}if(component){comps=this._metaLib.getClassesFromStyle(style);if(comps&&comps.length&&comps.indexOf(component)>=0){continue}}if(!this._OkStyle(style)){continue}if(!(deps=this._metaLib.isStyleDeprecatedEx(style))){continue}let sType=this._metaLib.getStyleOrigin(style);if(!sType){continue}for(let j=0;j<deps.length;j++){dep=deps[j];if(dep.styleselector){if(!this._handleStyleSelector(ruleCtx,style,sType,dep.styleselector)){continue}}this._emitIssue(ruleCtx,dep.dep,style)}}};Rule.prototype._handleStyleSelector=function(ruleCtx,style,sType,ss){var ss,tags,tagName,i;tagName=ruleCtx.tag;if(sType==="c"){return StyleSelector.match(ruleCtx,ss)}if(sType==="j"||sType==="b"){if(ss){if(StyleSelector.match(ruleCtx,ss)){return true}}else{tags=this._metaLib.getNonSSStyleElems(style,true);if(tags){for(i=0;i<tags.length;i++){if(tags[i]===tagName){return true}}}}}if(sType==="j"){return false}if(ss=this._metaLib.getStyleSelector(style,false)){if(StyleSelector.match(ruleCtx,ss)){return true}}return ss?false:true};Rule.prototype._emitIssue=function(ruleCtx,dep,style){if(dep.description&&!dep.description.endsWith(".")){dep.description=dep.description+"."}var issue=new ruleCtx.Issue("Deprecated style class '"+style+"'"+(dep.since?" (since "+dep.since+").":"")+(dep.description?" "+dep.description:""));ruleCtx.reporter.addIssue(issue,ruleCtx)};Rule.prototype._OkStyle=function(style){if(this._checkList){for(let i=0;i<this._checkList.length;i++){if(this._checkList[i].test(style)){return this._isAccept}}return!this._isAccept}return true};Rule.prototype._checkAcceptReject=function(regCtx){var accept=regCtx.ruleOpts["accept"];var reject=regCtx.ruleOpts["reject"];if(accept||reject){if(accept&&reject){regCtx.utils.msgLib.error("Rule "+RULE_NAME+": options 'accept' and 'reject' are mutually exclusive");return false}if(accept){this._checkList=accept;this._isAccept=true}else{this._checkList=reject}if(!Array.isArray(this._checkList)){regCtx.utils.msgLib.error("Rule "+RULE_NAME+": option '"+(accept?"accept":"reject")+"' is not an array");return false}for(let i=0;i<this._checkList.length;i++){if(typeof this._checkList[i]==="string"){this._checkList[i]=new RegExp(this._checkList[i].trim())}}}return true};module.exports=Rule;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-tag-attr-noprefix";function getName(){return RULE_NAME};function getShortDescription(){return"Global HTML elements with an attribute expression with no ':' prefix are invalid"};function getDescription(){return"On a common HTML element (i.e. is not a custom element), any use of an attribute "+"not prefixed with ':' and with an expression (e.g. attr=\"[[...]]\" or attr=\"{{...}}\"), is invalid."};function register(){return{"tag":_handleTag}};function _handleTag(context,tagName){var attribs,attrib,attrValue,issue,attrPos;if(!context.utils.DomUtils.isCommonElem(tagName)){return}attribs=context.node.attribs;if(!attribs){return}for(attrib in attribs){if(attrib==="data-oj-context"||attrib==="data-oj-command"){continue}if(attrib.charAt(0)!==":"&&!attrib.startsWith("on-")){attrValue=attribs[attrib];if(attrValue.startsWith("[[")||attrValue.startsWith("{{")){issue=new context.Issue("Use of attribute expression with unprefixed attribute '"+attrib+"' is invalid for <"+tagName+">");attrPos=context.utils.DomUtils.getAttrPosition(context.data,context.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);context.reporter.addIssue(issue,context)}}}};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-tag-attr-noprefix";function getName(){return RULE_NAME};function getShortDescription(){return"Global HTML elements with an attribute expression with no ':' prefix are invalid"};function getDescription(){return"On a common HTML element (i.e. is not a custom element), any use of an attribute "+"not prefixed with ':' and with an expression (e.g. attr=\"[[...]]\" or attr=\"{{...}}\"), is invalid."};function register(){return{"globtag":_onTag}};function _onTag(context,tagName){var attribs,attrib,attrValue;if(!(attribs=context.node.attribs));for(attrib in attribs){if(attrib==="data-oj-context"||attrib==="data-oj-command"){continue}if(attrib.charAt(0)!==":"&&!attrib.startsWith("on-")){attrValue=attribs[attrib];if(attrValue.startsWith("[[")||attrValue.startsWith("{{")){let issue=new context.Issue(`Expression-bound attribute without ':' prefix '${attrib}' found on global elem <${tagName}> - use ':${attrib}'`);let attrPos=context.utils.DomUtils.getAttrPosition(context.data,context.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);context.reporter.addIssue(issue,context)}}}};module.exports={getName,getDescription,getShortDescription,register};
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULENAME="oj-html-template-index";const DESCRIPTION="Due to a bug in JET 9.x <oj-list-view>, the value of ItemTemplateContext.index starts at 1 instead "+"of 0, depending on whether skeletons (when a fetch from a DataProvider "+"takes more than 50ms) are displayed or not. In JET 10.0.0, the index value always starts at 0 as intended. ";"Review use of the index value to ensure correct usage.";const SHORT_DESCRIPTION="Due to a bug in JET 9.x <oj-list-view>, the value of ItemTemplateContext.index starts at 1 instead "+"of 0, depending on whether skeletons are displayed or not.";const TEMPLATE="template";const OJ_LIST_VIEW="oj-list-view";const DATA_OJ_AS="data-oj-as";const $CURINDEX="$current.index";const DOT_INDEX=".index";const TAG="tag";const RO_EXPR="[[";const RW_EXPR="{{";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._utils=regCtx.utils.utils;return{tag:this._onTag}}_onTag(ruleCtx,tag){if(tag===TEMPLATE&&this._childOfListView(ruleCtx)){let val;if(val=ruleCtx.utils.DomUtils.getAttribValue(ruleCtx.node,DATA_OJ_AS)){this._processTemplateAttribs(ruleCtx,val)}}}_processTemplateAttribs(ruleCtx,find){var node;var find=find+DOT_INDEX;node=ruleCtx.node;this._processDescendants(ruleCtx,node,find)}_processDescendants(ruleCtx,node,find){var nodes,n,attrs,attr,val;nodes=node.children;if(!nodes){return}for(n in nodes){n=nodes[n];if(!n.type||n.type!==TAG){continue}attrs=n.attribs;if(attrs&&this._utils.hasAnyProps(attrs)){for(attr in attrs){val=attrs[attr];if(_isExpr(val)){if(val.includes(find)||val.includes($CURINDEX)){let issue=new ruleCtx.Issue(`Behavior change to ItemTemplateContext.index : <${n.name} ${attr}= >`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,n,attr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}if(n.children){this._processDescendants(ruleCtx,n,find)}}}_childOfListView(ruleCtx){let stack=ruleCtx.elemStack;for(let i=stack.length-1;i>=0;i--){if(stack[i].name===OJ_LIST_VIEW){return true}}return false}}function _isExpr(s){return s.startsWith(RO_EXPR)||s.startsWith(RW_EXPR)};module.exports=Rule;
6
+ const RULENAME="oj-html-template-index";const DESCRIPTION="Due to a bug in JET 9.x <oj-list-view>, the value of ItemTemplateContext.index starts at 1 instead "+"of 0, depending on whether skeletons (when a fetch from a DataProvider "+"takes more than 50ms) are displayed or not. In JET 10.0.0, the index value always starts at 0 as intended. ";"Review use of the index value to ensure correct usage.";const SHORT_DESCRIPTION="Due to a bug in JET 9.x <oj-list-view>, the value of ItemTemplateContext.index starts at 1 instead "+"of 0, depending on whether skeletons are displayed or not.";const OJ_LIST_VIEW="oj-list-view";const DATA_OJ_AS="data-oj-as";const $CURINDEX="$current.index";const DOT_INDEX=".index";const TAG="tag";const RO_EXPR="[[";const RW_EXPR="{{";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._utils=regCtx.utils.utils;return{"<template>":this._onTemplate}}_onTemplate(ruleCtx){if(this._childOfListView(ruleCtx)){let val;if(val=ruleCtx.utils.DomUtils.getAttribValue(ruleCtx.node,DATA_OJ_AS)){this._processTemplateAttribs(ruleCtx,val)}}}_processTemplateAttribs(ruleCtx,find){var node;var find=find+DOT_INDEX;node=ruleCtx.node;this._processDescendants(ruleCtx,node,find)}_processDescendants(ruleCtx,node,find){var nodes,n,attrs,attr,val;nodes=node.children;if(!nodes){return}for(n in nodes){n=nodes[n];if(!n.type||n.type!==TAG){continue}attrs=n.attribs;if(attrs&&this._utils.hasAnyProps(attrs)){for(attr in attrs){val=attrs[attr];if(_isExpr(val)){if(val.includes(find)||val.includes($CURINDEX)){let issue=new ruleCtx.Issue(`Behavior change to ItemTemplateContext.index : <${n.name} ${attr}= >`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,n,attr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}if(n.children){this._processDescendants(ruleCtx,n,find)}}}_childOfListView(ruleCtx){let stack=ruleCtx.elemStack;for(let i=stack.length-1;i>=0;i--){if(stack[i].name===OJ_LIST_VIEW){return true}}return false}}function _isExpr(s){return s.startsWith(RO_EXPR)||s.startsWith(RW_EXPR)};module.exports=Rule;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
@@ -1,6 +1,6 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-wctag-id";const SHORT_DESCRIPT="Custom components should not used a hard-coded 'id' attribute and should be set to an expression";const LONG_DESCRIPT="Hard-coded element IDs should not be used within custom components and should be set to an expression. Element IDs must be unique for each instance of the component. See context.uniqueId in the custom element documentation for information on how to derive unique IDs for elements."+"<p>If a CCA implements hard-coded IDs for HTML elements in the CCA view, e.g.<p>"+"<oj-input id=\"foo\"><p>"+"then this is guaranteed to cause issues as soon as more than one instance of "+"the component is used on the page (plus there is a significant risk of "+"collision with other IDs in the page as a whole.";const ID="id";const COLON_ID=":id";class Rule{getName(){return RULE_NAME}getDescription(){return LONG_DESCRIPT}getShortDescription(){return SHORT_DESCRIPT}register(){return{"webcomp":this._onTag}}_onTag(ruleCtx,tag){var attribs,attr,idAttr,isId,isColonId,isExpr,isLit,isValidId,av,val,msg,mid;if(!ruleCtx.ojTag||!ruleCtx.filepath.includes("jet-composites")||!ruleCtx.tagNode.attribs){return}if(ruleCtx.utils.metaLib.isBindingTag(tag)){return}attribs=ruleCtx.tagNode.attribs;isId=attribs.hasOwnProperty(ID);isColonId=attribs.hasOwnProperty(COLON_ID);if(!isId&&!isColonId){return}idAttr=isId?ID:COLON_ID;av=attribs[idAttr];isExpr=_isAttrExpr(av);val=isExpr?_stripExprDelims(av):av;isLit=_isLiteral(val);if(isId){msg=`<${tag}> 'id' should be prefixed as ':id'${isExpr?"":" and set to an expression"}`;mid=0}else if(!isExpr){msg=`<${tag}> ':id' should be set to an expression`;mid=1}if(msg){_emitIssue(ruleCtx,msg,idAttr,mid)}if(isExpr&&isLit){msg=`<${tag}> '${idAttr}' attribute expression returns a constant - convert to a calculated expression`;_emitIssue(ruleCtx,msg,idAttr,2)}}};function _emitIssue(ruleCtx,msg,idAttr,mid){var issue,attrPos;issue=new ruleCtx.Issue(msg);attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,idAttr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);if(mid){issue.setMsgKey(RULE_NAME+"_"+mid)}ruleCtx.reporter.addIssue(issue,ruleCtx)}function _isAttrExpr(s){var rc=false;if(typeof s==="string"){s=s.trim();rc=s.startsWith("[[")||s.startsWith("{{")}return rc};function _stripExprDelims(s){return s.substring(2,s.length-2).trim()}function _isLiteral(s){return s.charAt(0)==="'"&&s.charAt(s.length-1)==="'"};function _isValidId(s){return!/\s/.test(s)};module.exports=Rule;
6
+ const RULE_NAME="oj-html-wctag-id";const SHORT_DESCRIPT="Custom components should not used a hard-coded 'id' attribute and should be set to an expression";const LONG_DESCRIPT="Hard-coded element IDs should not be used within custom components and should be set to an expression. Element IDs must be unique for each instance of the component. See context.uniqueId in the custom element documentation for information on how to derive unique IDs for elements."+"<p>If a CCA implements hard-coded IDs for HTML elements in the CCA view, e.g.<p>"+"<oj-input id=\"foo\"><p>"+"then this is guaranteed to cause issues as soon as more than one instance of "+"the component is used on the page (plus there is a significant risk of "+"collision with other IDs in the page as a whole.";const ID="id";const COLON_ID=":id";class Rule{getName(){return RULE_NAME}getDescription(){return LONG_DESCRIPT}getShortDescription(){return SHORT_DESCRIPT}register(){return{"webcomp":this._onTag}}_onTag(ruleCtx,tag){var attribs,idAttr,isId,isColonId,isExpr,isLit,av,val,msg,mid;if(!ruleCtx.ojTag||!ruleCtx.filepath.includes("jet-composites")||!ruleCtx.tagNode.attribs){return}if(ruleCtx.utils.metaLib.isBindingTag(tag)){return}attribs=ruleCtx.tagNode.attribs;isId=attribs.hasOwnProperty(ID);isColonId=attribs.hasOwnProperty(COLON_ID);if(!isId&&!isColonId){return}idAttr=isId?ID:COLON_ID;av=attribs[idAttr];isExpr=_isAttrExpr(av);val=isExpr?_stripExprDelims(av):av;isLit=_isLiteral(val);if(isId){msg=`<${tag}> 'id' should be prefixed as ':id'${isExpr?"":" and set to an expression"}`;mid=0}else if(!isExpr){msg=`<${tag}> ':id' should be set to an expression`;mid=1}if(msg){_emitIssue(ruleCtx,msg,idAttr,mid)}if(isExpr&&isLit){msg=`<${tag}> '${idAttr}' attribute expression returns a constant - convert to a calculated expression`;_emitIssue(ruleCtx,msg,idAttr,2)}}};function _emitIssue(ruleCtx,msg,idAttr,mid){var issue,attrPos;issue=new ruleCtx.Issue(msg);attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,idAttr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);if(mid){issue.setMsgKey(RULE_NAME+"_"+mid)}ruleCtx.reporter.addIssue(issue,ruleCtx)}function _isAttrExpr(s){var rc=false;if(typeof s==="string"){s=s.trim();rc=s.startsWith("[[")||s.startsWith("{{")}return rc};function _stripExprDelims(s){return s.substring(2,s.length-2).trim()}function _isLiteral(s){return s.charAt(0)==="'"&&s.charAt(s.length-1)==="'"};module.exports=Rule;
@@ -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 RULENAME="oj-html-wctag-nested";const DESCRIPTION="The following JET components cannot be nested: <oj-data-grid>, <oj-list-view>, <oj-table>, <oj-tree-view>, <oj-stream-list>, and <oj-waterfall-layout>";const SHORT_DESCRIPTION="Cannot nest <oj-data-grid>, <oj-list-view>, <oj-table>, <oj-tree-view>, <oj-stream-list>, and <oj-waterfall-layout>";const COMP_LIST=["oj-list-view","oj-table","oj-stream-list","oj-waterfall-layout","oj-tree-view","oj-data-grid"];const TAG="tag";const BODY="body";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{webcomp:this._onWC}}_onWC(ruleCtx,tag){var ar,node,issue,i;if(ruleCtx.ojTag&&COMP_LIST.includes(tag)){ar=ruleCtx.elemStack;for(i=ar.length-2;i>=0;i--){node=ar[i];if(node.type===TAG){if(node.name===tag){issue=new ruleCtx.Issue(`Nesting of <${tag}> is not supported`);ruleCtx.reporter.addIssue(issue,ruleCtx);break}else if(node.name===BODY){break}}}}}};module.exports=Rule;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */