@oracle/oraclejet-audit 10.1.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (759) hide show
  1. package/LICENSE.md +1 -1
  2. package/jaf-amd.js +12 -4
  3. package/jaf.js +6 -1
  4. package/jafapi.js +6 -1
  5. package/lib/AST.js +6 -1
  6. package/lib/AST_Ts.js +6 -1
  7. package/lib/AstJson.js +6 -1
  8. package/lib/AstMd.js +6 -0
  9. package/lib/AstNodeTypes.js +6 -1
  10. package/lib/Comments.js +6 -1
  11. package/lib/ComponentSvcs.js +5 -0
  12. package/lib/Components.js +6 -1
  13. package/lib/Config.js +6 -1
  14. package/lib/ConfigLib.js +6 -1
  15. package/lib/CssLib.js +5 -0
  16. package/lib/CssUtils.js +5 -0
  17. package/lib/DomUtils.js +6 -1
  18. package/lib/FileIndex.js +5 -0
  19. package/lib/FileSet.js +5 -0
  20. package/lib/FsUtils.js +6 -1
  21. package/lib/Histo.js +6 -0
  22. package/lib/HtmlTree.js +6 -1
  23. package/lib/HtmlUtils.js +5 -0
  24. package/lib/Issue.js +6 -1
  25. package/lib/JafEvents.js +5 -0
  26. package/lib/JafLib.js +6 -1
  27. package/lib/Json.js +6 -0
  28. package/lib/JsonLoader.js +6 -1
  29. package/lib/Md.js +6 -0
  30. package/lib/MetaLib.js +6 -1
  31. package/lib/NetUtils.js +5 -0
  32. package/lib/NodeTypes.js +5 -0
  33. package/lib/Parser.js +6 -1
  34. package/lib/RegTypes.js +6 -1
  35. package/lib/Registry.js +6 -1
  36. package/lib/Reporter.js +6 -1
  37. package/lib/RuleContext.js +5 -0
  38. package/lib/RulePack.js +5 -0
  39. package/lib/RuleSet.js +6 -1
  40. package/lib/Rules.js +6 -1
  41. package/lib/Scope.js +6 -1
  42. package/lib/SemVer.js +5 -0
  43. package/lib/Server.js +5 -0
  44. package/lib/SevLib.js +5 -0
  45. package/lib/Severity.js +6 -1
  46. package/lib/Stats.js +6 -0
  47. package/lib/Ts.js +6 -1
  48. package/lib/Utils.js +6 -1
  49. package/lib/Watch.js +5 -0
  50. package/lib/Writer.js +5 -0
  51. package/lib/ZipUtils.js +5 -0
  52. package/lib/api.js +6 -0
  53. package/lib/builtinpacks.js +6 -0
  54. package/lib/cliStats.js +6 -0
  55. package/lib/clone.js +6 -1
  56. package/lib/cmdline.js +6 -1
  57. package/lib/colors.js +6 -1
  58. package/lib/defaults.js +6 -0
  59. package/lib/deflist.js +6 -0
  60. package/lib/dislist.js +6 -0
  61. package/lib/exportRules.js +6 -0
  62. package/lib/extends.js +6 -0
  63. package/lib/filetypes.js +6 -0
  64. package/lib/grouplist.js +6 -0
  65. package/lib/groups.js +6 -0
  66. package/lib/help.js +6 -1
  67. package/lib/jetver.js +6 -1
  68. package/lib/macros.js +6 -0
  69. package/lib/manual.js +6 -1
  70. package/lib/metaLoader.js +5 -0
  71. package/lib/metahist.js +5 -0
  72. package/lib/msgidLoader.js +6 -1
  73. package/lib/ns.js +6 -1
  74. package/lib/nslist.js +5 -0
  75. package/lib/outFormat.js +6 -0
  76. package/lib/outfile.js +5 -0
  77. package/lib/ruleLoader.js +5 -0
  78. package/lib/scaffold.js +6 -1
  79. package/lib/scaffoldRule.js +6 -1
  80. package/lib/schema.js +6 -1
  81. package/lib/scopewalker.js +6 -0
  82. package/lib/spinner.js +6 -1
  83. package/lib/spinnernoop.js +5 -0
  84. package/lib/tabs.js +5 -0
  85. package/libext/expparser.js +6 -1
  86. package/meta/11.0.0/jetauditmeta.js +9 -0
  87. package/meta/11.1.0/jetauditmeta.js +9 -0
  88. package/meta/12.0.0/jetauditmeta.js +9 -0
  89. package/meta/metaverlist.json +1 -1
  90. package/package.json +72 -69
  91. package/rulepacks/csp/csp-html-script-unsafe-inline.js +5 -0
  92. package/rulepacks/csp/csp-html-style-unsafe-inline.js +5 -0
  93. package/rulepacks/csp/csp-html-unsafe-expr.js +5 -0
  94. package/rulepacks/csp/csp-js-script-unsafe-eval.js +6 -1
  95. package/rulepacks/csp/csp-js-style-unsafe-inline.js +5 -0
  96. package/rulepacks/csp/csp-ts-script-unsafe-eval.js +6 -0
  97. package/rulepacks/csp/csp-ts-style-unsafe-inline.js +6 -0
  98. package/rulepacks/csp/msgid.json +6 -1
  99. package/rulepacks/csp/rules.json +6 -1
  100. package/rulepacks/jetwc/jetwc-absolute-jetversion.js +6 -1
  101. package/rulepacks/jetwc/jetwc-aria-redefinition.js +6 -1
  102. package/rulepacks/jetwc/jetwc-bootstrap.js +6 -1
  103. package/rulepacks/jetwc/jetwc-compjson-bp-ar.js +6 -1
  104. package/rulepacks/jetwc/jetwc-compjson-bp-obj.js +6 -1
  105. package/rulepacks/jetwc/jetwc-component-dependencies.js +6 -1
  106. package/rulepacks/jetwc/jetwc-component-displayname.js +6 -1
  107. package/rulepacks/jetwc/jetwc-component-foldername.js +6 -1
  108. package/rulepacks/jetwc/jetwc-component-location.js +6 -1
  109. package/rulepacks/jetwc/jetwc-component-type.js +6 -1
  110. package/rulepacks/jetwc/jetwc-css-oj-complete.js +6 -0
  111. package/rulepacks/jetwc/jetwc-data-property-prefix.js +6 -1
  112. package/rulepacks/jetwc/jetwc-deprecated-lifecycle.js +6 -1
  113. package/rulepacks/jetwc/jetwc-disabled-property.js +6 -1
  114. package/rulepacks/jetwc/jetwc-displayname.js +6 -1
  115. package/rulepacks/jetwc/jetwc-dynamic-slot-context.js +6 -1
  116. package/rulepacks/jetwc/jetwc-dynamic-slots-naming.js +6 -1
  117. package/rulepacks/jetwc/jetwc-event-displayname.js +6 -1
  118. package/rulepacks/jetwc/jetwc-events.js +6 -1
  119. package/rulepacks/jetwc/jetwc-jet-version.js +6 -1
  120. package/rulepacks/jetwc/jetwc-loader-file.js +6 -1
  121. package/rulepacks/jetwc/jetwc-markdown-link.js +6 -0
  122. package/rulepacks/jetwc/jetwc-method-displayname.js +6 -1
  123. package/rulepacks/jetwc/jetwc-methods.js +6 -1
  124. package/rulepacks/jetwc/jetwc-namespace.js +6 -1
  125. package/rulepacks/jetwc/jetwc-nested-defaults.js +6 -1
  126. package/rulepacks/jetwc/jetwc-nls-languages.js +6 -1
  127. package/rulepacks/jetwc/jetwc-nls-root.js +6 -1
  128. package/rulepacks/jetwc/jetwc-oj-register.js +6 -1
  129. package/rulepacks/jetwc/jetwc-ojcss.js +6 -1
  130. package/rulepacks/jetwc/jetwc-pack-children.js +6 -1
  131. package/rulepacks/jetwc/jetwc-packable-components.js +6 -1
  132. package/rulepacks/jetwc/jetwc-prerelease-dependencies.js +6 -1
  133. package/rulepacks/jetwc/jetwc-prerelease-pattern.js +6 -1
  134. package/rulepacks/jetwc/jetwc-prerelease-version.js +6 -1
  135. package/rulepacks/jetwc/jetwc-property-changed.js +6 -1
  136. package/rulepacks/jetwc/jetwc-property-displayname.js +6 -1
  137. package/rulepacks/jetwc/jetwc-property-nesting.js +6 -1
  138. package/rulepacks/jetwc/jetwc-public-modules.js +6 -1
  139. package/rulepacks/jetwc/jetwc-register-css.js +6 -1
  140. package/rulepacks/jetwc/jetwc-register-with-promises.js +6 -1
  141. package/rulepacks/jetwc/jetwc-require-paths.js +6 -1
  142. package/rulepacks/jetwc/jetwc-required-subproperty.js +6 -0
  143. package/rulepacks/jetwc/jetwc-reserved-property.js +6 -1
  144. package/rulepacks/jetwc/jetwc-schema.js +6 -1
  145. package/rulepacks/jetwc/jetwc-semantic-version.js +6 -1
  146. package/rulepacks/jetwc/jetwc-slot-displayname.js +6 -1
  147. package/rulepacks/jetwc/jetwc-slots.js +6 -1
  148. package/rulepacks/jetwc/jetwc-standard-files.js +6 -1
  149. package/rulepacks/jetwc/jetwc-subproperty-writeback.js +6 -0
  150. package/rulepacks/jetwc/jetwc-template-slots.js +6 -1
  151. package/rulepacks/jetwc/jetwc-unused-events.js +6 -1
  152. package/rulepacks/jetwc/jetwc-unused-slots.js +6 -1
  153. package/rulepacks/jetwc/jetwc-vb-category.js +6 -1
  154. package/rulepacks/jetwc/jetwc-vb-icon.js +6 -1
  155. package/rulepacks/jetwc/jetwc-vcomponent-jetversion.js +6 -0
  156. package/rulepacks/jetwc/jetwc-vcomponent-loader.js +6 -0
  157. package/rulepacks/jetwc/jetwc-vcomponent-version.js +6 -0
  158. package/rulepacks/jetwc/jetwc-version-openrange.js +6 -1
  159. package/rulepacks/jetwc/jetwc-writeback-required.js +6 -1
  160. package/rulepacks/jetwc/msgid.json +6 -0
  161. package/rulepacks/jetwc/rules.json +6 -1
  162. package/rulepacks/jetwc-lib/jetwcutils-auditComponentCacheManager.js +6 -0
  163. package/rulepacks/jetwc-lib/jetwcutils-commonListenerImpls.js +6 -0
  164. package/rulepacks/jetwc-lib/jetwcutils-componentAuditUtils.js +6 -0
  165. package/rulepacks/jetwc-lib/jetwcutils-componentFinder.js +6 -0
  166. package/rulepacks/jetwc-lib/jetwcutils-preCompiler.js +6 -0
  167. package/rulepacks/jetwc-lib/jetwcutils-tsxUtils.js +6 -0
  168. package/rulepacks/jetwco/jetwco-bootstrap.js +6 -1
  169. package/rulepacks/jetwco/jetwco-cacc-auditConstraints.js +6 -0
  170. package/rulepacks/jetwco/jetwco-cacc-dependencies.js +6 -0
  171. package/rulepacks/jetwco/jetwco-cacc-dynamicSlots.js +6 -0
  172. package/rulepacks/jetwco/jetwco-cacc-eventBubbles.js +6 -0
  173. package/rulepacks/jetwco/jetwco-cacc-eventCancelable.js +6 -0
  174. package/rulepacks/jetwco/jetwco-cacc-eventPayload.js +6 -0
  175. package/rulepacks/jetwco/jetwco-cacc-events.js +6 -0
  176. package/rulepacks/jetwco/jetwco-cacc-helpers.js +6 -0
  177. package/rulepacks/jetwco/jetwco-cacc-jetVer.js +6 -0
  178. package/rulepacks/jetwco/jetwco-cacc-methodParamTypes.js +6 -0
  179. package/rulepacks/jetwco/jetwco-cacc-methodParams.js +6 -0
  180. package/rulepacks/jetwco/jetwco-cacc-methodReturnType.js +6 -0
  181. package/rulepacks/jetwco/jetwco-cacc-methods.js +6 -0
  182. package/rulepacks/jetwco/jetwco-cacc-packBundle.js +6 -0
  183. package/rulepacks/jetwco/jetwco-cacc-packBundleContent.js +6 -0
  184. package/rulepacks/jetwco/jetwco-cacc-packContent.js +6 -0
  185. package/rulepacks/jetwco/jetwco-cacc-properties.js +6 -0
  186. package/rulepacks/jetwco/jetwco-cacc-propertyDefault.js +6 -0
  187. package/rulepacks/jetwco/jetwco-cacc-propertyEnumeration.js +6 -0
  188. package/rulepacks/jetwco/jetwco-cacc-propertyReadOnly.js +6 -0
  189. package/rulepacks/jetwco/jetwco-cacc-propertyRequired.js +6 -0
  190. package/rulepacks/jetwco/jetwco-cacc-propertyType.js +6 -0
  191. package/rulepacks/jetwco/jetwco-cacc-propertyWriteback.js +6 -0
  192. package/rulepacks/jetwco/jetwco-cacc-publicModules.js +6 -0
  193. package/rulepacks/jetwco/jetwco-cacc-slotDataVariable.js +6 -0
  194. package/rulepacks/jetwco/jetwco-cacc-slotDataVariableType.js +6 -0
  195. package/rulepacks/jetwco/jetwco-cacc-slots.js +6 -0
  196. package/rulepacks/jetwco/jetwco-cacc-styleClasses.js +6 -0
  197. package/rulepacks/jetwco/jetwco-cacc-styleVariables.js +6 -0
  198. package/rulepacks/jetwco/jetwco-compjson-ns-reg.js +6 -1
  199. package/rulepacks/jetwco/jetwco-component-api-baseline-changes.js +6 -0
  200. package/rulepacks/jetwco/jetwco-component-api-changes.js +6 -1
  201. package/rulepacks/jetwco/jetwco-component-api-controlled-changes.js +6 -0
  202. package/rulepacks/jetwco/jetwco-component-cdn.js +6 -1
  203. package/rulepacks/jetwco/jetwco-description-standards.js +6 -0
  204. package/rulepacks/jetwco/jetwco-displayname-standards.js +6 -0
  205. package/rulepacks/jetwco/jetwco-exchange-version-check.js +6 -1
  206. package/rulepacks/jetwco/jetwco-license-info.js +6 -1
  207. package/rulepacks/jetwco/jetwco-prerelease-cdn.js +6 -1
  208. package/rulepacks/jetwco/jetwco-thirdparty-ba.js +6 -1
  209. package/rulepacks/jetwco/msgid.json +6 -0
  210. package/rulepacks/jetwco/rules.json +6 -1
  211. package/rulepacks/spoc/msgid.json +5 -0
  212. package/rulepacks/spoc/rules.json +5 -0
  213. package/rulepacks/spoc/spoc-dom-manip-inv-tag.js +5 -0
  214. package/rulepacks/spoc/spoc-dom-manip-tag-pos.js +5 -0
  215. package/rulepacks/spoc/spoc-dom-manip.js +5 -0
  216. package/{tests/rules/oj-js-diagnose/js_FAIL_1.js → rulepacks/wdt/msgid.json} +3 -9
  217. package/rulepacks/wdt/rules.json +6 -0
  218. package/rulepacks/wdt/wd-driver-sleep.js +6 -0
  219. package/rulepacks/wdt/wd-xpath.js +6 -0
  220. package/rules/jaf/jaf-css-diagnose.js +5 -0
  221. package/rules/jaf/jaf-html-diagnose.js +5 -0
  222. package/rules/jaf/jaf-init-schema.js +5 -0
  223. package/rules/jaf/jaf-js-diagnose.js +5 -0
  224. package/rules/jaf/jaf-ts-diagnose.js +6 -0
  225. package/rules/jaf/msgid.json +6 -1
  226. package/rules/jaf/rules.json +6 -1
  227. package/rules/jet/helpers/acc-aria-label.js +6 -1
  228. package/rules/jet/helpers/bp-checkPropType.js +5 -0
  229. package/rules/jet/helpers/cssHelper.js +6 -1
  230. package/rules/jet/helpers/extractStylesFromClass.js +6 -1
  231. package/rules/jet/helpers/has-slot-name.js +6 -1
  232. package/rules/jet/helpers/has-slot.js +5 -0
  233. package/rules/jet/helpers/json-prop-pos.js +5 -0
  234. package/rules/jet/helpers/json-propname-pos.js +5 -0
  235. package/rules/jet/helpers/style-selector.js +6 -1
  236. package/rules/jet/helpers/valid-attr.js +5 -0
  237. package/rules/jet/helpers/vartrack.js +5 -0
  238. package/rules/jet/jet-css-ojselector.js +5 -0
  239. package/rules/jet/msgid.json +6 -1
  240. package/rules/jet/oj-acc-aria-labelledby.js +5 -0
  241. package/rules/jet/oj-acc-aria-prop.js +6 -1
  242. package/rules/jet/oj-acc-avatar-aria-role.js +6 -1
  243. package/rules/jet/oj-acc-combobox-aria-label.js +6 -1
  244. package/rules/jet/oj-acc-film-strip-aria-label.js +6 -1
  245. package/rules/jet/oj-acc-input-aria-label.js +6 -1
  246. package/rules/jet/oj-acc-select-aria-label.js +6 -1
  247. package/rules/jet/oj-cca-compjson-bp-ar.js +5 -0
  248. package/rules/jet/oj-cca-compjson-bp-dsplyname.js +5 -0
  249. package/rules/jet/oj-cca-compjson-bp-jetver.js +5 -0
  250. package/rules/jet/oj-cca-compjson-bp-obj.js +5 -0
  251. package/rules/jet/oj-cca-compjson-ns-reg.js +5 -0
  252. package/rules/jet/oj-css-bp-border-color.js +5 -0
  253. package/rules/jet/oj-css-bp-dir-flow.js +6 -1
  254. package/rules/jet/oj-css-bp-float.js +5 -0
  255. package/rules/jet/oj-css-bp-textalign.js +5 -0
  256. package/rules/jet/oj-css-style-abs-units.js +6 -1
  257. package/rules/jet/oj-css-style-bp-color.js +5 -0
  258. package/rules/jet/oj-css-style-bp-display.js +6 -1
  259. package/rules/jet/oj-css-style-bp-font-family.js +6 -1
  260. package/rules/jet/oj-css-style-bp-font.js +5 -0
  261. package/rules/jet/oj-css-style-deprecated.js +6 -1
  262. package/rules/jet/oj-css-style-override.js +6 -1
  263. package/rules/jet/oj-css-var-override.js +5 -0
  264. package/rules/jet/oj-form-maxcols.js +6 -1
  265. package/rules/jet/oj-html-5-attr-obs.js +5 -0
  266. package/rules/jet/oj-html-5-tag-obs.js +5 -0
  267. package/rules/jet/oj-html-alta-deprecated.js +6 -0
  268. package/rules/jet/oj-html-attr-$unique.js +5 -0
  269. package/rules/jet/oj-html-attr-2def.js +5 -0
  270. package/rules/jet/oj-html-attr-json.js +6 -1
  271. package/rules/jet/oj-html-attr-prefix-expr.js +6 -1
  272. package/rules/jet/oj-html-attr-prefix-ro.js +5 -0
  273. package/rules/jet/oj-html-attr-req.js +5 -0
  274. package/rules/jet/oj-html-bindforeach-data.js +6 -1
  275. package/rules/jet/oj-html-bindif-test.js +6 -1
  276. package/rules/jet/oj-html-binding-attr.js +6 -1
  277. package/rules/jet/oj-html-cca-count.js +5 -0
  278. package/rules/jet/oj-html-cca-tagname.js +6 -1
  279. package/rules/jet/oj-html-cdn.js +5 -0
  280. package/rules/jet/oj-html-combo-converter.js +5 -0
  281. package/rules/jet/oj-html-cspexpr.js +6 -1
  282. package/rules/jet/oj-html-databind-all.js +5 -0
  283. package/rules/jet/oj-html-dlg-title.js +6 -1
  284. package/rules/jet/oj-html-file-pick-accept.js +6 -1
  285. package/rules/jet/oj-html-form-bindif.js +6 -1
  286. package/rules/jet/oj-html-form-layout-maxcols.js +6 -1
  287. package/rules/jet/oj-html-form-noflex.js +5 -0
  288. package/rules/jet/oj-html-input-isodate.js +6 -0
  289. package/rules/jet/oj-html-invalid-doctype.js +6 -1
  290. package/rules/jet/oj-html-jq-databind.js +6 -1
  291. package/rules/jet/oj-html-ko-comment.js +5 -0
  292. package/rules/jet/oj-html-ko-databind.js +6 -1
  293. package/rules/jet/oj-html-label-for-prefix.js +5 -0
  294. package/rules/jet/oj-html-missing-doctype.js +6 -1
  295. package/rules/jet/oj-html-msgs-cat-text.js +6 -0
  296. package/rules/jet/oj-html-no-style-tag.js +6 -0
  297. package/rules/jet/oj-html-notag-style.js +6 -0
  298. package/rules/jet/oj-html-oj-lib.js +5 -0
  299. package/rules/jet/oj-html-ojattr-520.js +6 -1
  300. package/rules/jet/oj-html-ojattr-deprecated.js +6 -1
  301. package/rules/jet/oj-html-ojattr-enum-deprecated.js +6 -1
  302. package/rules/jet/oj-html-ojattr-evt-syntax.js +6 -1
  303. package/rules/jet/oj-html-ojattr-value.js +6 -1
  304. package/rules/jet/oj-html-ojattr.js +6 -1
  305. package/rules/jet/oj-html-ojevent.js +6 -1
  306. package/rules/jet/oj-html-ojslot.js +6 -1
  307. package/rules/jet/oj-html-ojstyle.js +5 -0
  308. package/rules/jet/oj-html-ojtag-datacmd.js +6 -1
  309. package/rules/jet/oj-html-ojtag-datactx.js +5 -0
  310. package/rules/jet/oj-html-ojtag-deprecated.js +6 -1
  311. package/rules/jet/oj-html-ojtag-globattr-noprefix.js +6 -1
  312. package/rules/jet/oj-html-ojtag-id.js +5 -0
  313. package/rules/jet/oj-html-ojtag-nonglobattr-prefix.js +6 -1
  314. package/rules/jet/oj-html-ojtag-ns.js +5 -0
  315. package/rules/jet/oj-html-picker-attrs.js +6 -0
  316. package/rules/jet/oj-html-redwood-cssnovars.js +6 -0
  317. package/rules/jet/oj-html-redwood-cssvars.js +6 -0
  318. package/rules/jet/oj-html-self-close.js +5 -0
  319. package/rules/jet/oj-html-slot-item-minmax.js +6 -0
  320. package/rules/jet/oj-html-slot-name.js +6 -1
  321. package/rules/jet/oj-html-slot-pref-content.js +6 -0
  322. package/rules/jet/oj-html-style-abs-units.js +5 -0
  323. package/rules/jet/oj-html-style-bp-color.js +5 -0
  324. package/rules/jet/oj-html-style-bp-display.js +6 -1
  325. package/rules/jet/oj-html-style-bp-font-family.js +5 -0
  326. package/rules/jet/oj-html-style-bp-font.js +5 -0
  327. package/rules/jet/oj-html-style-deprecated.js +6 -1
  328. package/rules/jet/oj-html-style.js +6 -1
  329. package/rules/jet/oj-html-stylesel.js +6 -1
  330. package/rules/jet/oj-html-tag-attr-noprefix.js +6 -1
  331. package/rules/jet/oj-html-template-index.js +6 -1
  332. package/rules/jet/oj-html-unsup-theme.js +6 -1
  333. package/rules/jet/oj-html-wctag-$props.js +6 -1
  334. package/rules/jet/oj-html-wctag-arialabelledby.js +5 -0
  335. package/rules/jet/oj-html-wctag-for.js +5 -0
  336. package/rules/jet/oj-html-wctag-id.js +6 -1
  337. package/rules/jet/oj-html-wctag-nested.js +6 -0
  338. package/rules/jet/oj-html-wctag-packprivate.js +6 -0
  339. package/rules/jet/oj-js-comp-attr-deprecated.js +6 -1
  340. package/rules/jet/oj-js-comp-meth-deprecated.js +6 -1
  341. package/rules/jet/oj-js-no-ext-final.js +5 -0
  342. package/rules/jet/oj-js-noconsole.js +5 -0
  343. package/rules/jet/oj-js-ojcomp-deprecated.js +6 -1
  344. package/rules/jet/oj-js-ojcomp-exist.js +5 -0
  345. package/rules/jet/oj-js-ojcomp-new.js +5 -0
  346. package/rules/jet/oj-js-poly-promise.js +6 -1
  347. package/rules/jet/oj-js-var-undef.js +5 -0
  348. package/rules/jet/oj-json-syntax.js +5 -0
  349. package/rules/jet/oj-ts-comp-attr-deprecated.js +6 -1
  350. package/rules/jet/oj-ts-comp-meth-deprecated.js +6 -1
  351. package/rules/jet/oj-ts-no-ext-final.js +6 -0
  352. package/rules/jet/oj-ts-noconsole.js +6 -1
  353. package/rules/jet/oj-ts-ojcomp-deprecated.js +6 -1
  354. package/rules/jet/oj-ts-ojcomp-exist.js +6 -1
  355. package/rules/jet/oj-ts-ojcomp-new.js +6 -1
  356. package/rules/jet/oj-ts-poly-promise.js +6 -1
  357. package/rules/jet/rules.json +6 -1
  358. package/schema/component-schema.json +125 -2
  359. package/src/JafCore.js +6 -1
  360. package/types/index.d.ts +175 -37
  361. package/lib/stats.js +0 -1
  362. package/rulepacks/jetwc-lib/component-audit-utils.js +0 -1
  363. package/rules/exch/helpers/json-prop-pos.js +0 -1
  364. package/rules/exch/msgid.json +0 -1
  365. package/rules/exch/oj-cca-comp-zip-content-composite.js +0 -1
  366. package/rules/exch/oj-cca-comp-zip-content-pack.js +0 -1
  367. package/rules/exch/oj-cca-comp-zip-expand.js +0 -1
  368. package/rules/exch/oj-cca-compjson-evnames.js +0 -1
  369. package/rules/exch/oj-cca-compjson-file.js +0 -1
  370. package/rules/exch/oj-cca-compjson-prefix.js +0 -1
  371. package/rules/exch/oj-cca-compjson-prop-compdeps.js +0 -1
  372. package/rules/exch/oj-cca-compjson-prop-deps.js +0 -1
  373. package/rules/exch/oj-cca-compjson-prop-jetver.js +0 -1
  374. package/rules/exch/oj-cca-compjson-prop-obs.js +0 -1
  375. package/rules/exch/oj-cca-compjson-prop-type.js +0 -1
  376. package/rules/exch/oj-cca-compjson-prop-types.js +0 -1
  377. package/rules/exch/oj-cca-compjson-prop-undef.js +0 -1
  378. package/rules/exch/oj-cca-compjson-prop-version.js +0 -1
  379. package/rules/exch/oj-cca-compjson-schema.js +0 -1
  380. package/rules/exch/oj-cca-zip-compjson.js +0 -1
  381. package/rules/exch/rules.json +0 -1
  382. package/rules/jet/oj-css-bp-bgcolor.js +0 -1
  383. package/tests/components/attr-req-test/component.json +0 -1
  384. package/tests/components/demo-analog-clock/component.json +0 -1
  385. package/tests/components/demo-analog-clock/demo-analog-clock-viewModel.js +0 -1
  386. package/tests/components/demo-analog-clock/extension/demo/js/viewModels/demo.js +0 -1
  387. package/tests/components/demo-analog-clock/loader.js +0 -1
  388. package/tests/components/demo-card/component.json +0 -1
  389. package/tests/components/demo-chart-orientation-control/component.json +0 -1
  390. package/tests/components/demo-chart-stack-control/component.json +0 -1
  391. package/tests/components/made-up/component.json +0 -1
  392. package/tests/components/oj-made-up/component.json +0 -1
  393. package/tests/components/sp-activity-item/component.json +0 -1
  394. package/tests/config/config_base.json +0 -1
  395. package/tests/golden/10.0.0/golden_base.json +0 -1
  396. package/tests/golden/8.1.0/golden_base.json +0 -1
  397. package/tests/golden/9.0.0/golden_base.json +0 -1
  398. package/tests/rulepacks/hooks/hook-rpext.js +0 -1
  399. package/tests/rulepacks/hooks/hook-start-close-rulepack.js +0 -1
  400. package/tests/rulepacks/hooks/rule-rpext.js +0 -1
  401. package/tests/rulepacks/hooks/rules.json +0 -1
  402. package/tests/rulepacks/tags/proc_directive.js +0 -1
  403. package/tests/rulepacks/tags/rules.json +0 -1
  404. package/tests/rulepacks/tags/tag-count-setup.js +0 -1
  405. package/tests/rulepacks/tags/tag-count.js +0 -1
  406. package/tests/rules/bugs/JET-4770_PASS_1.html +0 -9
  407. package/tests/rules/comments/com_FAIL_1.js +0 -57
  408. package/tests/rules/comments/com_FAIL_2.js +0 -96
  409. package/tests/rules/comments/com_PASS_1.js +0 -42
  410. package/tests/rules/comments/com_PASS_2.js +0 -63
  411. package/tests/rules/comments/com_PASS_3.js +0 -40
  412. package/tests/rules/comments/com_PASS_4.js +0 -36
  413. package/tests/rules/comments/com_PASS_5.js +0 -19
  414. package/tests/rules/csp/html-script-unsafe-inline/FAIL_1.html +0 -11
  415. package/tests/rules/csp/html-script-unsafe-inline/FAIL_2.html +0 -8
  416. package/tests/rules/csp/html-script-unsafe-inline/PASS_1.html +0 -8
  417. package/tests/rules/csp/html-script-unsafe-inline/PASS_2.html +0 -8
  418. package/tests/rules/csp/html-script-unsafe-inline/PASS_3.html +0 -8
  419. package/tests/rules/csp/html-style-unsafe-inline/FAIL_1.html +0 -11
  420. package/tests/rules/csp/html-style-unsafe-inline/PASS_1.html +0 -11
  421. package/tests/rules/csp/html-unsafe-expr/FAIL_1.html +0 -14
  422. package/tests/rules/csp/html-unsafe-expr/PASS_1.html +0 -23
  423. package/tests/rules/csp/js-script-unsafe-eval/FAIL_1.js +0 -17
  424. package/tests/rules/csp/js-script-unsafe-eval/FAIL_2.js +0 -40
  425. package/tests/rules/csp/js-script-unsafe-eval/FAIL_3.js +0 -22
  426. package/tests/rules/csp/js-script-unsafe-eval/PASS_1.js +0 -20
  427. package/tests/rules/csp/js-script-unsafe-eval/PASS_2.js +0 -44
  428. package/tests/rules/csp/js-script-unsafe-eval/PASS_3.js +0 -16
  429. package/tests/rules/csp/js-style-unsafe-inline/FAIL_1.js +0 -25
  430. package/tests/rules/csp/js-style-unsafe-inline/PASS.js +0 -22
  431. package/tests/rules/demo/noself_FAIL_1.js +0 -101
  432. package/tests/rules/import/import_FAIL_1.js +0 -11
  433. package/tests/rules/import/import_PASS_1.js +0 -10
  434. package/tests/rules/jet-composites/demo-buttonset-enum/component.json +0 -57
  435. package/tests/rules/jet-composites/demo-buttonset-enum/loader.js +0 -19
  436. package/tests/rules/jet-composites/demo-buttonset-enum/view.html +0 -48
  437. package/tests/rules/jet-composites/demo-card/component.json +0 -28
  438. package/tests/rules/jet-composites/demo-card/loader.js +0 -16
  439. package/tests/rules/jet-composites/demo-card/view.html +0 -30
  440. package/tests/rules/jet-composites/demo-card/viewModel.js +0 -46
  441. package/tests/rules/jet-composites/demo-card/view_PASS_1.html +0 -21
  442. package/tests/rules/jet-composites/demo-contact-form/component.json +0 -23
  443. package/tests/rules/jet-composites/demo-contact-form/loader.js +0 -16
  444. package/tests/rules/jet-composites/demo-contact-form/view.html +0 -9
  445. package/tests/rules/jet-composites/demo-grocery-list/component.json +0 -18
  446. package/tests/rules/jet-composites/demo-grocery-list/loader.js +0 -19
  447. package/tests/rules/jet-composites/demo-grocery-list/view.html +0 -22
  448. package/tests/rules/jet-composites/demo-grocery-list/viewModel.js +0 -48
  449. package/tests/rules/jet-composites/dummy-component-1/component.json +0 -82
  450. package/tests/rules/jet-composites/dummy-component-2/component.json +0 -72
  451. package/tests/rules/jet-composites/foo-my-cca/component.json +0 -14
  452. package/tests/rules/jet-composites/foo-unsup-theme/component.json +0 -29
  453. package/tests/rules/jet-composites/header/component.json +0 -12
  454. package/tests/rules/jet-composites/oj-cgbu-omc/attribute-selection/component.json +0 -154
  455. package/tests/rules/jet-composites/oj-cgbu-omc/component.json +0 -11
  456. package/tests/rules/jet-composites/oj-cgbu-omc/reference/component.json +0 -185
  457. package/tests/rules/jet-composites/oj-cgbu-omc/wctag_props_FAIL_1.html +0 -34
  458. package/tests/rules/jet-composites/oj-enum-depr/component.json +0 -69
  459. package/tests/rules/jet-composites/oj-html-wctag-id/id_FAIL_1.html +0 -10
  460. package/tests/rules/jet-composites/oj-html-wctag-id/id_PASS_1.html +0 -6
  461. package/tests/rules/misc/oj.js +0 -12
  462. package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_FAIL_1.html +0 -23
  463. package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_FAIL_2.html +0 -22
  464. package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_1.html +0 -23
  465. package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_2.html +0 -22
  466. package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_3.html +0 -22
  467. package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_4.html +0 -22
  468. package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_5.html +0 -22
  469. package/tests/rules/oj-acc-aria-prop/aria_prop_FAIL_1.html +0 -22
  470. package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_FAIL_1.html +0 -20
  471. package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_1.html +0 -23
  472. package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_2.html +0 -24
  473. package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_3.html +0 -21
  474. package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_4.html +0 -22
  475. package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_5.html +0 -22
  476. package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_FAIL_1.html +0 -20
  477. package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_FAIL_2.html +0 -21
  478. package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_PASS_1.html +0 -20
  479. package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_FAIL_1.html +0 -21
  480. package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_FAIL_2.html +0 -22
  481. package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_PASS_1.html +0 -22
  482. package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_FAIL_1.html +0 -18
  483. package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_FAIL_2.html +0 -18
  484. package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_1.html +0 -18
  485. package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_2.html +0 -19
  486. package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_3.html +0 -22
  487. package/tests/rules/oj-acc-input-aria-label/oj_input_date_FAIL_1.html +0 -21
  488. package/tests/rules/oj-acc-input-aria-label/oj_input_date_FAIL_2.html +0 -22
  489. package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_1.html +0 -16
  490. package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_2.html +0 -17
  491. package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_3.html +0 -26
  492. package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_FAIL_1.html +0 -19
  493. package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_FAIL_2.html +0 -20
  494. package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_PASS_1.html +0 -19
  495. package/tests/rules/oj-acc-input-aria-label/oj_input_number_FAIL_1.html +0 -17
  496. package/tests/rules/oj-acc-input-aria-label/oj_input_number_FAIL_2.html +0 -18
  497. package/tests/rules/oj-acc-input-aria-label/oj_input_number_PASS_1.html +0 -17
  498. package/tests/rules/oj-acc-input-aria-label/oj_input_password_FAIL_1.html +0 -17
  499. package/tests/rules/oj-acc-input-aria-label/oj_input_password_FAIL_2.html +0 -17
  500. package/tests/rules/oj-acc-input-aria-label/oj_input_password_PASS_1.html +0 -17
  501. package/tests/rules/oj-acc-input-aria-label/oj_input_text_3_PASS_1.html +0 -20
  502. package/tests/rules/oj-acc-input-aria-label/oj_input_text_FAIL_1.html +0 -20
  503. package/tests/rules/oj-acc-input-aria-label/oj_input_text_FAIL_2.html +0 -21
  504. package/tests/rules/oj-acc-input-aria-label/oj_input_text_PASS_2.html +0 -62
  505. package/tests/rules/oj-acc-input-aria-label/oj_input_text_nolabel_PASS_2.html +0 -17
  506. package/tests/rules/oj-acc-input-aria-label/oj_input_time_FAIL_1.html +0 -19
  507. package/tests/rules/oj-acc-input-aria-label/oj_input_time_FAIL_2.html +0 -20
  508. package/tests/rules/oj-acc-input-aria-label/oj_input_time_PASS_1.html +0 -19
  509. package/tests/rules/oj-acc-select-aria-label/aria_selectmany_FAIL_1.html +0 -19
  510. package/tests/rules/oj-acc-select-aria-label/aria_selectmany_FAIL_2.html +0 -20
  511. package/tests/rules/oj-acc-select-aria-label/aria_selectmany_PASS_1.html +0 -19
  512. package/tests/rules/oj-acc-select-aria-label/aria_selectone_FAIL_1.html +0 -20
  513. package/tests/rules/oj-acc-select-aria-label/aria_selectone_FAIL_2.html +0 -21
  514. package/tests/rules/oj-cca-comp-zip/zip_FAIL_1.zip +0 -1
  515. package/tests/rules/oj-cca-comp-zip/zip_FAIL_2.zip +0 -0
  516. package/tests/rules/oj-cca-comp-zip/zip_FAIL_3.zip +0 -0
  517. package/tests/rules/oj-cca-comp-zip/zip_FAIL_4.zip +0 -0
  518. package/tests/rules/oj-cca-comp-zip/zip_FAIL_5.zip +0 -0
  519. package/tests/rules/oj-cca-comp-zip/zip_FAIL_6.zip +0 -0
  520. package/tests/rules/oj-cca-comp-zip/zip_FAIL_7.zip +0 -0
  521. package/tests/rules/oj-cca-comp-zip/zip_FAIL_8.zip +0 -0
  522. package/tests/rules/oj-cca-comp-zip/zip_PASS_1.zip +0 -0
  523. package/tests/rules/oj-cca-ns-reg/oj-cca-ns-FAIL_1/component.json +0 -19
  524. package/tests/rules/oj-cca-ns-reg/oj-cca-ns-PASS_1/component.json +0 -19
  525. package/tests/rules/oj-cgbu-omc_tests/html_ojevent_FAIL_1.html +0 -15
  526. package/tests/rules/oj-cgbu-omc_tests/html_ojevent_PASS_1.html +0 -17
  527. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_1/component.json +0 -16
  528. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_10/component.json +0 -103
  529. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_11/component.json +0 -24
  530. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_12/component.json +0 -17
  531. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_13/component.json +0 -17
  532. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_14/component.json +0 -40
  533. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_15/component.json +0 -24
  534. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_16/component.json +0 -44
  535. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_17/component.json +0 -8
  536. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_18/component.json +0 -8
  537. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_19/component.json +0 -8
  538. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_2/component.json +0 -15
  539. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_20/component.json +0 -18
  540. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_21/component.json +0 -16
  541. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_22/component.json +0 -19
  542. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_3/component.json +0 -15
  543. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_4/component.json +0 -16
  544. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_5/component.json +0 -16
  545. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_6/component.json +0 -18
  546. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_7/component.json +0 -15
  547. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_8/component.json +0 -15
  548. package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_9/component.json +0 -52
  549. package/tests/rules/oj-compjson-syntax/ojcomp-PASS_1/component.json +0 -17
  550. package/tests/rules/oj-compjson-syntax/ojcomp-PASS_2/component.json +0 -88
  551. package/tests/rules/oj-compjson-syntax/ojcomp-PASS_3/component.json +0 -19
  552. package/tests/rules/oj-css-bp-dir-flow/dirflow_FAIL_1.html +0 -22
  553. package/tests/rules/oj-css-bp-dir-flow/dirflow_FAIL_2.html +0 -22
  554. package/tests/rules/oj-css-diagnose/css_FAIL_1.html +0 -14
  555. package/tests/rules/oj-css-diagnose/css_PASS_1.html +0 -14
  556. package/tests/rules/oj-css-var-override/varovr_FAIL_1.html +0 -8
  557. package/tests/rules/oj-html-5-attr-depr/attrdepr_FAIL_1.html +0 -16
  558. package/tests/rules/oj-html-5-attr-depr/attrdepr_PASS_1.html +0 -16
  559. package/tests/rules/oj-html-5-tag-depr/tagdepr_FAIL_1.html +0 -9
  560. package/tests/rules/oj-html-attr/attr_FAIL_1.html +0 -27
  561. package/tests/rules/oj-html-attr-$unique/attr_$unique1_FAIL_1.html +0 -19
  562. package/tests/rules/oj-html-attr-$unique/attr_$unique_FAIL_2.html +0 -25
  563. package/tests/rules/oj-html-attr-2def/attr2def_FAIL_1.html +0 -10
  564. package/tests/rules/oj-html-attr-2def/attr2def_PASS_1.html +0 -10
  565. package/tests/rules/oj-html-attr-json/attr-json_FAIL_1.html +0 -20
  566. package/tests/rules/oj-html-attr-json/attr-json_FAIL_2.html +0 -20
  567. package/tests/rules/oj-html-attr-json/attr-json_FAIL_3.html +0 -20
  568. package/tests/rules/oj-html-attr-json/attr-json_PASS_1.html +0 -20
  569. package/tests/rules/oj-html-attr-json/attr-json_PASS_2.html +0 -20
  570. package/tests/rules/oj-html-attr-json/attr-json_PASS_3.html +0 -8
  571. package/tests/rules/oj-html-attr-prefix-expr/attrprefixexpr_FAIL_1.html +0 -10
  572. package/tests/rules/oj-html-attr-prefix-expr/attrprefixexpr_PASS_1.html +0 -10
  573. package/tests/rules/oj-html-attr-prefix-ro/attrprefixro_FAIL_1.html +0 -10
  574. package/tests/rules/oj-html-attr-prefix-ro/attrprefixro_PASS_1.html +0 -10
  575. package/tests/rules/oj-html-attr-req/attrreq_FAIL_1.html +0 -17
  576. package/tests/rules/oj-html-attr-req/attrreq_FAIL_2.html +0 -13
  577. package/tests/rules/oj-html-attr-req/attrreq_FAIL_3.html +0 -8
  578. package/tests/rules/oj-html-attr-req/attrreq_FAIL_4.html +0 -13
  579. package/tests/rules/oj-html-attr-req/attrreq_FAIL_5.html +0 -17
  580. package/tests/rules/oj-html-attr-req/attrreq_PASS_1.html +0 -24
  581. package/tests/rules/oj-html-attr-req/attrreq_PASS_2.html +0 -24
  582. package/tests/rules/oj-html-attr-req/attrreq_PASS_3.html +0 -10
  583. package/tests/rules/oj-html-attr-req/attrreq_PASS_4.html +0 -11
  584. package/tests/rules/oj-html-bindforeach-data/bindforeach_data_FAIL_1.html +0 -19
  585. package/tests/rules/oj-html-bindforeach-data/bindforeach_data_PASS_1.html +0 -10
  586. package/tests/rules/oj-html-bindif-test/bindif_test_FAIL_1.html +0 -22
  587. package/tests/rules/oj-html-bindif-test/bindif_test_PASS_1.html +0 -11
  588. package/tests/rules/oj-html-binding-attr/binding-foreach_FAIL_2.html +0 -28
  589. package/tests/rules/oj-html-binding-attr/binding-if_FAIL_1.html +0 -23
  590. package/tests/rules/oj-html-binding-attr/binding-if_PASS_1.html +0 -23
  591. package/tests/rules/oj-html-cca-count/cca-count_FAIL_1.html +0 -119
  592. package/tests/rules/oj-html-cca-tagname/ccatag_FAIL_1.html +0 -7
  593. package/tests/rules/oj-html-cca-tagname/ccatag_PASS_1.html +0 -7
  594. package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_1.html +0 -8
  595. package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_2.html +0 -8
  596. package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_3.html +0 -8
  597. package/tests/rules/oj-html-cca-tagname/tag_ns_PASS_1.html +0 -10
  598. package/tests/rules/oj-html-cdn/html_cdn_FAIL_1.html +0 -18
  599. package/tests/rules/oj-html-cspexpr/cspexpr_FAIL_1.html +0 -14
  600. package/tests/rules/oj-html-cspexpr/cspexpr_FAIL_2.html +0 -10
  601. package/tests/rules/oj-html-cspexpr/cspexpr_PASS_1.html +0 -23
  602. package/tests/rules/oj-html-cspexpr/cspexpr_PASS_2.html +0 -10
  603. package/tests/rules/oj-html-cspexpr/cspexpr_PASS_3.html +0 -13
  604. package/tests/rules/oj-html-dlg-title/dlgtitle_FAIL_1.html +0 -12
  605. package/tests/rules/oj-html-dlg-title/dlgtitle_PASS_1.html +0 -12
  606. package/tests/rules/oj-html-form-noflex/noflex_FAIL_1.html +0 -10
  607. package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_1.html +0 -20
  608. package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_2.html +0 -13
  609. package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_3.html +0 -16
  610. package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_4.html +0 -13
  611. package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_1.html +0 -6
  612. package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_2.html +0 -7
  613. package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_3.html +0 -7
  614. package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_1.html +0 -37
  615. package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_2.html +0 -34
  616. package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_3.html +0 -27
  617. package/tests/rules/oj-html-jq-databind/jq-databind_PASS_1.html +0 -30
  618. package/tests/rules/oj-html-ko-comment/ko-comment_FAIL_1.html +0 -47
  619. package/tests/rules/oj-html-ko-comment/ko-comment_FAIL_2.html +0 -36
  620. package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_1.html +0 -24
  621. package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_2.html +0 -36
  622. package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_3.html +0 -29
  623. package/tests/rules/oj-html-label-for-prefix/for_FAIL_1.html +0 -8
  624. package/tests/rules/oj-html-label-for-prefix/for_PASS_1.html +0 -8
  625. package/tests/rules/oj-html-missing-doctype/doctype_missing_FAIL_1.html +0 -12
  626. package/tests/rules/oj-html-missing-doctype/doctype_missing_FAIL_2.html +0 -11
  627. package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_1.html +0 -14
  628. package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_2.html +0 -5
  629. package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_3.html +0 -12
  630. package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_5.html +0 -6
  631. package/tests/rules/oj-html-nonvoid-close/close_FAIL_1.html +0 -28
  632. package/tests/rules/oj-html-nonvoid-close/close_FAIL_2.html +0 -14
  633. package/tests/rules/oj-html-nonvoid-close/close_FAIL_3.html +0 -13
  634. package/tests/rules/oj-html-nonvoid-close/close_FAIL_5.html +0 -28
  635. package/tests/rules/oj-html-nonvoid-close/close_FAIL_6.html +0 -28
  636. package/tests/rules/oj-html-nonvoid-close/close_PASS_1.html +0 -7
  637. package/tests/rules/oj-html-oj-lib/oj_lib_FAIL_1.html +0 -15
  638. package/tests/rules/oj-html-ojattr/ojattr_PASS_1.html +0 -8
  639. package/tests/rules/oj-html-ojattr/ojattr_PASS_2.html +0 -10
  640. package/tests/rules/oj-html-ojattr/ojattr_PASS_3.html +0 -7
  641. package/tests/rules/oj-html-ojattr/ojattr_PASS_4.html +0 -7
  642. package/tests/rules/oj-html-ojattr-deprecated/ojattr-dep_FAIL1.html +0 -156
  643. package/tests/rules/oj-html-ojattr-enum-deprecated/enum_FAIL_1.html +0 -19
  644. package/tests/rules/oj-html-ojattr-enum-deprecated/enum_FAIL_2.html +0 -20
  645. package/tests/rules/oj-html-ojattr-enum-deprecated/enum_PASS_1.html +0 -25
  646. package/tests/rules/oj-html-ojattr-evt-syntax/evt-attr-syntax_FAIL_1.html +0 -6
  647. package/tests/rules/oj-html-ojattr-evt-syntax/evt-attr-syntax_PASS_1.html +0 -6
  648. package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_1.html +0 -26
  649. package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_2.html +0 -26
  650. package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_3.html +0 -8
  651. package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_4.html +0 -8
  652. package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_5.html +0 -8
  653. package/tests/rules/oj-html-ojattr-value/attr-value_PASS_1.html +0 -26
  654. package/tests/rules/oj-html-ojattr-value/attr-value_PASS_2.html +0 -8
  655. package/tests/rules/oj-html-ojattr-value/attr-value_PASS_3.html +0 -7
  656. package/tests/rules/oj-html-ojattr-value/attr-value_PASS_6.html +0 -7
  657. package/tests/rules/oj-html-ojattr-value/attr-value_PASS_7.html +0 -10
  658. package/tests/rules/oj-html-ojattr-value/attr_value_PASS_4.html +0 -7
  659. package/tests/rules/oj-html-ojattr-value/attr_value_PASS_5.html +0 -9
  660. package/tests/rules/oj-html-ojslot/ojslot_FAIL_1.html +0 -11
  661. package/tests/rules/oj-html-ojslot/ojslot_PASS_1.html +0 -12
  662. package/tests/rules/oj-html-ojstyle/style_FAIL_1.html +0 -103
  663. package/tests/rules/oj-html-ojstyle/style_PASS_2.html +0 -7
  664. package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_1.html +0 -10
  665. package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_2.html +0 -18
  666. package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_3.html +0 -10
  667. package/tests/rules/oj-html-ojtag-datacmd/datacmd_PASS_1.html +0 -28
  668. package/tests/rules/oj-html-ojtag-datacmd/datacmd_PASS_2.html +0 -15
  669. package/tests/rules/oj-html-ojtag-datactx/datactx_FAIL_1.html +0 -14
  670. package/tests/rules/oj-html-ojtag-datactx/datactx_PASS_1.html +0 -14
  671. package/tests/rules/oj-html-ojtag-globattr-noprefix/globattr-noprefix_FAIL_1.html +0 -36
  672. package/tests/rules/oj-html-ojtag-nonglobattr-prefix/nonglobattr-prefix_FAIL_1.html +0 -26
  673. package/tests/rules/oj-html-slot-name/slot_name.FAIL_1.html +0 -24
  674. package/tests/rules/oj-html-slot-name/slot_name.FAIL_2.html +0 -46
  675. package/tests/rules/oj-html-slot-name/slot_name.FAIL_3.html +0 -10
  676. package/tests/rules/oj-html-slot-name/slot_name.PASS_1.html +0 -24
  677. package/tests/rules/oj-html-slot-name/slot_name.PASS_2.html +0 -39
  678. package/tests/rules/oj-html-slot-name/slot_name.PASS_3.html +0 -10
  679. package/tests/rules/oj-html-slot-name/slot_name_PASS_4.html +0 -16
  680. package/tests/rules/oj-html-slot-name/slot_name_PASS_5.html +0 -11
  681. package/tests/rules/oj-html-slot-name/slot_name_PASS_6.html +0 -14
  682. package/tests/rules/oj-html-slot-name/slot_name_PASS_7.html +0 -10
  683. package/tests/rules/oj-html-style/style_FAIL_1.html +0 -7
  684. package/tests/rules/oj-html-style/style_PASS_1.html +0 -12
  685. package/tests/rules/oj-html-style/style_PASS_2.html +0 -7
  686. package/tests/rules/oj-html-style-bp-color/color-FAIL_1.html +0 -17
  687. package/tests/rules/oj-html-style-bp-color/color-FAIL_2.html +0 -15
  688. package/tests/rules/oj-html-style-bp-color/color-FAIL_3.html +0 -7
  689. package/tests/rules/oj-html-style-bp-color/color-PASS_1.html +0 -7
  690. package/tests/rules/oj-html-style-bp-font-family/fam_FAIL_1.html +0 -23
  691. package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_FAIL_1.html +0 -15
  692. package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_FAIL_2.html +0 -9
  693. package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_PASS_1.html +0 -9
  694. package/tests/rules/oj-html-unsup-theme/unsup_FAIL_1.html +0 -8
  695. package/tests/rules/oj-html-wctag-for/for_FAIL_1.html +0 -8
  696. package/tests/rules/oj-html-wctag-for/for_PASS_1.html +0 -8
  697. package/tests/rules/oj-js-comp-attr-deprecated/attr-del_FAIL_1.js +0 -20
  698. package/tests/rules/oj-js-comp-attr-deprecated/attr-dep_FAIL_1.js +0 -20
  699. package/tests/rules/oj-js-comp-meth-deprecated/meth-del_FAIL_1.js +0 -20
  700. package/tests/rules/oj-js-comp-meth-deprecated/meth-dep_FAIL_1.js +0 -20
  701. package/tests/rules/oj-js-define-promise/def-prom_FAIL_1.js +0 -16
  702. package/tests/rules/oj-js-define-promise/def-prom_FAIL_2.js +0 -16
  703. package/tests/rules/oj-js-diagnose/es6_PASS_1.js +0 -24
  704. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_1.js +0 -30
  705. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_2.js +0 -23
  706. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_3.js +0 -22
  707. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_4.js +0 -20
  708. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_5.js +0 -24
  709. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_6.js +0 -30
  710. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_7.js +0 -15
  711. package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_8.js +0 -16
  712. package/tests/rules/oj-js-no-ext-final/noextfinal_PASS_1.js +0 -17
  713. package/tests/rules/oj-js-no-ext-final/noextfinal_PASS_2.js +0 -17
  714. package/tests/rules/oj-js-noconsole/nocons_FAIL_1.js +0 -11
  715. package/tests/rules/oj-js-ojcomp-deprecated/jscomp_FAIL_1.js +0 -27
  716. package/tests/rules/oj-json-syntax/json_FAIL_1.json +0 -8
  717. package/tests/rules/oj-json-syntax/json_FAIL_2.json +0 -12
  718. package/tests/rules/oj-json-syntax/json_PASS_1.json +0 -25
  719. package/tests/rules/oj-json-syntax/json_PASS_2.json +0 -12
  720. package/tests/rules/oj-json-syntax/json_PASS_3.json +0 -14
  721. package/tests/rules/ojcompjson/attrreq_FAIL_1/component.json +0 -69
  722. package/tests/rules/pack-compjson/audit-pack/component-1/component-1-view.html +0 -6
  723. package/tests/rules/pack-compjson/audit-pack/component-1/component-1-viewModel.js +0 -56
  724. package/tests/rules/pack-compjson/audit-pack/component-1/component.json +0 -13
  725. package/tests/rules/pack-compjson/audit-pack/component-1/loader.js +0 -20
  726. package/tests/rules/pack-compjson/audit-pack/component-1/resources/nls/component-1-strings.js +0 -18
  727. package/tests/rules/pack-compjson/audit-pack/component-2/component-2-view.html +0 -5
  728. package/tests/rules/pack-compjson/audit-pack/component-2/component-2-viewModel.js +0 -56
  729. package/tests/rules/pack-compjson/audit-pack/component-2/component.json +0 -13
  730. package/tests/rules/pack-compjson/audit-pack/component-2/loader.js +0 -20
  731. package/tests/rules/pack-compjson/audit-pack/component-2/resources/nls/component-1-strings.js +0 -18
  732. package/tests/rules/pack-compjson/audit-pack/component.json +0 -12
  733. package/tests/rules/pack-compjson/audit-singleton-1/audit-singleton-1-view.html +0 -5
  734. package/tests/rules/pack-compjson/audit-singleton-1/audit-singleton-1-viewModel.js +0 -56
  735. package/tests/rules/pack-compjson/audit-singleton-1/component.json +0 -20
  736. package/tests/rules/pack-compjson/audit-singleton-1/loader.js +0 -20
  737. package/tests/rules/pack-compjson/audit-singleton-1/resources/nls/audit-singleton-1-strings.js +0 -18
  738. package/tests/rules/pack-compjson/audit-singleton-2/audit-singleton-2-view.html +0 -8
  739. package/tests/rules/pack-compjson/audit-singleton-2/audit-singleton-2-viewModel.js +0 -56
  740. package/tests/rules/pack-compjson/audit-singleton-2/component.json +0 -15
  741. package/tests/rules/pack-compjson/audit-singleton-2/loader.js +0 -20
  742. package/tests/rules/pack-compjson/audit-singleton-2/resources/nls/audit-singleton-2-strings.js +0 -18
  743. package/tests/rules/parse-html/proc_instr.html +0 -9
  744. package/tests/rules/spoc-dom-manip/dom-manip_FAIL_1.js +0 -113
  745. package/tests/rules/spoc-dom-manip/dom-manip_FAIL_2.js +0 -151
  746. package/tests/rules/spoc-dom-manip/dom-manip_PASS_1.js +0 -149
  747. package/tests/rules/spoc-dom-manip/dom-manip_PASS_2.js +0 -147
  748. package/tests/rules/spoc-dom-manip/dom-manip_PASS_3.js +0 -147
  749. package/tests/rules/spoc-dom-manip/dom-manip_PASS_4.js +0 -20
  750. package/tests/rules/spoc-dom-manip/dom-manip_PASS_5.js +0 -246
  751. package/tests/rules/tab-tests/tab-test_FAIL_1.html +0 -37
  752. package/tests/rules/tab-tests/tab-test_FAIL_2.html +0 -8
  753. package/tests/rules/webcomptests/jet-composites/oj-html-wctag-$props/prop_PASS_1.html +0 -8
  754. package/tests/rules/webcomptests/jet-composites/oj-html-wctag-$props/prop_PASS_2.html +0 -8
  755. package/tests/rules/webcomptests/jet-composites/oj-html-wctag-for/for_FAIL_1.html +0 -8
  756. package/tests/rules/webcomptests/jet-composites/oj-html-wctag-for/for_PASS_1.html +0 -8
  757. package/tests/src/JetTest.js +0 -1
  758. package/tests/src/server.js +0 -1
  759. package/tests/test.js +0 -1
@@ -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-input-isodate";const DESCRIPTION="Date/time strings used in the 'value', 'min, and 'max' attributes of web components "+"<oj-input-date>, oj-input-date-time>, <oj-input-time>, <oj-date-picker>, and <oj-date-time-picker>, "+"must be valid ISO-8061 strings, and have the same format type - zulu, offset, or local. ";const SHORT_DESCRIPTION="Date/time strings used in the 'value', 'min, and 'max' attributes of <oj-date-*> and <oj-input-date-*>, "+"must have the same format type - zulu, offset, or local. ";const ISO_DATE_REGEXP=/^[+-]?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(Z|[+-]\d{2}(?::?\d{2})?)?)?$|^T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(Z|[+-]\d{2}(?::?\d{2})?)?$/;class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-input-date>":this._onOjTag,"<oj-input-date-time>":this._onOjTag,"<oj-input-time>":this._onOjTag,"<oj-date-picker>":this._onOjTag,"<oj-date-time-picker>":this._onOjTag}}_onOjTag(ruleCtx){let min,max,value;this._isErr=this._isValExpr=this._isMinExpr=this._isMaxExpr=false;value=_getAttrib(ruleCtx,"value");min=_getAttrib(ruleCtx,"min");max=_getAttrib(ruleCtx,"max");this._isValid(ruleCtx,value,min,max)}_isValid(ruleCtx,value,min,max){if(value){this._isValExpr=_isExpr(value);if(!this._isValExpr&&!ISO_DATE_REGEXP.test(value)){this._emitIssue(ruleCtx,"value",value,1)}}if(min){this._isMinExpr=_isExpr(min);if(!this._isMinExpr&&!ISO_DATE_REGEXP.test(min)){this._emitIssue(ruleCtx,"min",min,2)}}if(max){this._isMaxExpr=_isExpr(max);if(!this._isMaxExpr&&!ISO_DATE_REGEXP.test(max)){this._emitIssue(ruleCtx,"max",max,3)}}if(this._isErr){return}this._checkZone(ruleCtx,value,min,max);if(!this._isErr){this._isMinGtMax(ruleCtx,min,max);this._isTimeOnlyValue(ruleCtx,value,min,max)}}_checkZone(ruleCtx,value,min,max){var fmtValue,fmtMin,fmtMax,fmtErr;if(value&&!this._isValExpr){fmtValue=this._getISOStrFormatType(value);if(fmtValue===null){fmtErr="value"}}if(min&&!this._isMinExpr){fmtMin=this._getISOStrFormatType(min);if(fmtMin===null){fmtErr="min"}}if(max&&!this._isMaxExpr){fmtMax=this._getISOStrFormatType(max);if(fmtMax===null){fmtErr="max"}}if(fmtErr){this._emitIssue(ruleCtx,fmtErr,null,9);return}if(value&&fmtValue){if(min&&fmtMin&&max&&fmtMax&&!(fmtValue===fmtMin&&fmtValue===fmtMax)){this._emitIssue(ruleCtx,fmtValue,null,5)}else{if(min&&fmtMin&&!(fmtValue===fmtMin)){this._emitIssue(ruleCtx,fmtValue,null,6)}if(max&&fmtMax&&!(fmtValue===fmtMax)){this._emitIssue(ruleCtx,fmtValue,null,7)}}}if(min&&fmtMin&&max&&fmtMax&&!(fmtMin===fmtMax)){this._emitIssue(ruleCtx,fmtValue,fmtMax,8)}}_isTimeOnlyValue(ruleCtx,value,min,max){if(value&&!this._isValExpr&&value.startsWith("T")){if(min&&!this._isMinExpr&&!min.startsWith("T")){this._emitIssue(ruleCtx,"min",null,10)}if(max&&!this._isMaxExpr&&!min.startsWith("T")){this._emitIssue(ruleCtx,"max",null,10)}}}_isMinGtMax(ruleCtx,min,max){if(min&&!this._isMinExpr&&max&&!this._isMaxExpr){if(_compareISODates(max,min)<=0){this._emitIssue(ruleCtx,null,null,4)}}}_getISOStrFormatType(isoStr){let format=null;var exe=ISO_DATE_REGEXP.exec(isoStr);if(exe){if(exe[1]===undefined&&exe[2]===undefined){format="local"}else{let timeZone=exe[1]!==undefined?exe[1]:exe[2];format=timeZone==="Z"?"zulu":"offset"}}return format}_emitIssue(ruleCtx,str,val,id){var issue,attrPos;switch(id){case 1:case 2:case 3:issue=new ruleCtx.Issue(`Attrib '${str}' : Invalid ISO-8601 time/date string`);attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,str);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);break;case 4:issue=new ruleCtx.Issue(`min' attribute value is greater than 'max'`);break;case 5:issue=new ruleCtx.Issue(`'min' and 'max' must be same ISO string format as 'value' (${str})`);break;case 6:issue=new ruleCtx.Issue(`'min' must be same ISO string format as 'value' (${str})`);break;case 7:issue=new ruleCtx.Issue(`'max' must be same ISO string format as 'value' (${str}))`);break;case 8:issue=new ruleCtx.Issue(`'min' and 'max' must be same ISO string format. 'min'= ${str}, 'max'=${val}`);break;case 9:issue=new ruleCtx.Issue(`Error determining ISO string format of '${str}'`);break;case 10:issue=new ruleCtx.Issue(`value' is a time-only string, but '${str}' includes a date`);break;}if(issue){this._isErr=true;if(id>1){issue.setMsgKey(RULENAME+"_"+(id-1))}ruleCtx.reporter.addIssue(issue,ruleCtx)}}}function _isExpr(s){return s.startsWith("[[")||s.startsWith("{{")};function _compareISODates(maxIso,minIso){const today=new Date;const month=today.getMonth()+1;let monthStr=_zeroPad(month.toString(),2);const day=today.getDate();let dayStr=_zeroPad(day.toString(),2);const todayIsoDate=today.getFullYear()+"-"+monthStr+"-"+dayStr;let isoString1=maxIso;let isoString2=minIso;const maxStartsWithT=maxIso.indexOf("T")===0;const minStartsWithT=minIso.indexOf("T")===0;const maxHasNoT=maxIso.indexOf("T")===-1;const minHasNoT=minIso.indexOf("T")===-1;const zeroTime="T00:00:00";if(maxStartsWithT){isoString1=todayIsoDate+isoString1}else if(maxHasNoT){isoString1+=zeroTime}if(minStartsWithT){isoString2=todayIsoDate+isoString2}else if(minHasNoT){isoString2+=zeroTime}const dateMax=new Date(isoString1);const dateMin=new Date(isoString2);return dateMax.getTime()-dateMin.getTime()};function _getAttrib(ruleCtx,attr){return _getNodeAttrib(ruleCtx,ruleCtx.node,attr)};function _getNodeAttrib(ruleCtx,node,attr){var du=ruleCtx.utils.DomUtils;return du.getAttribValue(node,attr)||du.getAttribValue(node,":"+attr)};function _zeroPad(s,n){s=s.trim(s);if(s.length<n){s="0".repeat(n-s.length)+s}return s};module.exports=Rule;
@@ -1 +1,6 @@
1
- const RULE_NAME="oj-html-invalid-doctype";function getName(){return RULE_NAME};function getShortDescription(){return"HTML page should specify 'html' in the <!DOCTYPE> declaration"};function getDescription(){return"JET requires HTML5 standards mode. To ensure that this mode is enabled in every browser, you should specify 'html' in the <!DOCTYPE> declaration"};function register(){return{"file":_handleFile}};function _handleFile(ruleCtx){var node,siblings,data,i;var DomUtils=ruleCtx.utils.DomUtils;var NodeType=ruleCtx.NodeTypes;node=ruleCtx.node;data=node.data;if(node.type===NodeType.DIRECTIVE){if(_isDocType(data)){if(DomUtils.isNonFragmentJetPage(ruleCtx)){_isDocTypeHtml(data,ruleCtx,node);return}}}siblings=DomUtils.getSiblings(node);for(i=0;i<siblings.length;i++){node=siblings[i];if(node.type===NodeType.DIRECTIVE){if(_isDocType(node.data)){if(DomUtils.isNonFragmentJetPage(ruleCtx)){_isDocTypeHtml(node.data,ruleCtx,node);return}}}if(node.type===NodeType.TAG||node.type===NodeType.SCRIPT){break}}};function _emitIssue(data,ruleCtx,node){var issue,pos;ruleCtx.clearPosition();issue=new ruleCtx.Issue("'<!DOCTYPE>' does not specify 'html'");pos=_applyfix(ruleCtx,node);issue.setPosition(null,null,pos,pos+7);ruleCtx.reporter.addIssue(issue,ruleCtx)};function _isDocTypeHtml(data,ruleCtx,node){if(_getNodeData(data)!=="html"){_emitIssue(data,ruleCtx,node)}};function _isDocType(s){s=s?s.substr(1).trim().toLowerCase():s;return s.startsWith("doctype")};function _getNodeData(s){if(s){s=s.replace(/!/g,"").substr(7).trim().toLowerCase()}return s};function _applyfix(ruleCtx,node){var x,i,d;x=node.startIndex;d=ruleCtx.rawData;x=ruleCtx.utils.utils.eatWhitespace(d,x);d=d.substring(x);for(i=0;i<d.length;i++){if(d.charAt(i)==="!"){return x+i}}return node.startIndex};module.exports={getName,getDescription,getShortDescription,register};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="oj-html-invalid-doctype";function getName(){return RULE_NAME};function getShortDescription(){return"HTML page should specify 'html' in the <!doctype> declaration"};function getDescription(){return"JET requires HTML5 standards mode. To ensure that this mode is enabled in every browser, you should specify 'html' in the <!doctype> declaration"};function register(){return{"file":_handleFile}};function _handleFile(ruleCtx){var node,siblings,i;var DomUtils=ruleCtx.utils.DomUtils;var NodeType=ruleCtx.NodeTypes;node=ruleCtx.node;if(node.type===NodeType.DIRECTIVE){if(_isGoodDirective(ruleCtx,node)){return}}siblings=DomUtils.getSiblings(node);for(i=0;i<siblings.length;i++){node=siblings[i];if(node.type===NodeType.DIRECTIVE){if(_isGoodDirective(ruleCtx,node)){return}}if(node.type===NodeType.TAG||node.type===NodeType.SCRIPT){break}}};function _isGoodDirective(ruleCtx,node){var ret=false;if(_isDocType(node.data)){if(ruleCtx.utils.DomUtils.isNonFragmentJetPage(ruleCtx)){_isDocTypeHtml(ruleCtx,node);ret=true}}return ret};function _emitIssue(ruleCtx,node,id){var issue,pos,msg;ruleCtx.clearPosition();switch(id){case 1:msg="<!doctype> does not specify 'html'";break;case 2:msg="Unexpected white space between ! and 'doctype'";break;}issue=new ruleCtx.Issue(msg);pos=_applyfix(ruleCtx,node);issue.setPosition(null,null,pos,pos+7);if(id===2){issue.setMsgKey(RULE_NAME+"_1")}ruleCtx.reporter.addIssue(issue,ruleCtx)};function _isDocTypeHtml(ruleCtx,node){var data=node.data.toLowerCase();if(!data.startsWith("!d")){_emitIssue(ruleCtx,node,2)}if(_getNodeData(data)!=="html"){_emitIssue(ruleCtx,node,1)}};function _isDocType(s){s=s?s.substr(1).trim().toLowerCase():s;return s.startsWith("doctype")};function _getNodeData(s){if(s){s=s.replace(/!/g,"").trim().substr(7).trim().toLowerCase()}return s};function _applyfix(ruleCtx,node){var x,i,d;x=node.startIndex;d=ruleCtx.rawData;x=ruleCtx.utils.utils.eatWhitespace(d,x);d=d.substring(x);for(i=0;i<d.length;i++){if(d.charAt(i)==="!"){return x+i}}return node.startIndex};module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
- const RULE_NAME="oj-html-jq-databind";const OJ_PREFIX="oj.";function getName(){return RULE_NAME};function getShortDescription(){return"Discontinue instantiation of JET JQUI components using 'data-bind'"};function getDescription(){return"Discontinue instantiation of JET JQUI components using '<i>data-bind</i>'. For example, in place of <i>oj.ojButton</i>, use JET custom component syntax <i><oj-button></i>."};function register(){return{"attr":_handleAttr}};function _handleAttr(ruleCtx,attrName,attrValue){var issue,componentName,suggestion,ojElem,fullClass,msg;if(attrName!=="data-bind"||attrValue.indexOf("ojComponent")<0){return}componentName=ruleCtx.utils.DomUtils.extractComponentFromDataBind(attrValue);fullClass=OJ_PREFIX+componentName;if(componentName){suggestion=ruleCtx.utils.metaLib.isClassDeprecated(fullClass)}if(componentName){ojElem=ruleCtx.utils.metaLib.getTagFromClass(fullClass);msg="JQUI data-bind instantiation of "+componentName+" found in <"+ruleCtx.tag+">";if(ojElem){if(ojElem==="oj-tree"){ojElem="oj-tree-view"}msg+=". Use <"+ojElem+">."}issue=new ruleCtx.Issue(msg);issue.setMsgKey(RULE_NAME+"_1")}else{issue=new ruleCtx.Issue("JQUI data-bind invocation of unknown JET component found in <"+ruleCtx.tag+">");issue.setMsgKey(RULE_NAME+"_2")}if(issue){ruleCtx.reporter.addIssue(issue,ruleCtx)}if(suggestion){issue=new ruleCtx.Issue("JQUI data-bind invocation for deprecated JET component '"+componentName+"'. "+suggestion);issue.setMsgKey(RULE_NAME+"_3");ruleCtx.reporter.addIssue(issue,ruleCtx)}};module.exports={getName,getDescription,getShortDescription,register};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="oj-html-jq-databind";const OJ_PREFIX="oj.";function getName(){return RULE_NAME};function getShortDescription(){return"Discontinue instantiation of JET JQUI components using 'data-bind'"};function getDescription(){return"Discontinue instantiation of JET JQUI components using '<i>data-bind</i>'. For example, in place of <i>oj.ojButton</i>, use JET custom component syntax <i><oj-button></i>."};function register(){return{"<data-bind=>":_onDataBind}};function _onDataBind(ruleCtx,attrName,attrValue){var issue,componentName,status,suggestion,since,ojElem,fullClass,msg;if(attrValue.indexOf("ojComponent")<0){return}componentName=ruleCtx.utils.DomUtils.extractComponentFromDataBind(attrValue);fullClass=OJ_PREFIX+componentName;if(componentName){if(status=ruleCtx.utils.metaLib.isClassDeprecated(fullClass)){suggestion=status[0].description;since=status[0].since;since=since?"(since"+since+") ":""}}if(componentName){ojElem=ruleCtx.utils.metaLib.getTagFromClass(fullClass);msg="JQUI data-bind instantiation of "+componentName+" found in <"+ruleCtx.tag+">";if(ojElem){if(ojElem==="oj-tree"){ojElem="oj-tree-view"}msg+=". Use <"+ojElem+">."}issue=new ruleCtx.Issue(msg);issue.setMsgKey(RULE_NAME+"_1")}else{issue=new ruleCtx.Issue(`JQUI data-bind invocation of unknown JET component found in <${ruleCtx.tag}>`);issue.setMsgKey(RULE_NAME+"_2")}if(issue){ruleCtx.reporter.addIssue(issue,ruleCtx)}if(suggestion){issue=new ruleCtx.Issue(`JQUI data-bind invocation for deprecated ${since}JET component '${componentName}'. ${suggestion}`);issue.setMsgKey(RULE_NAME+"_3");ruleCtx.reporter.addIssue(issue,ruleCtx)}};module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const RULE_NAME="oj-html-ko-comment";function getName(){return RULE_NAME};function getShortDescription(){return"Jet binding elements should be used in place of Knockout comment bindings"};function getDescription(){return"JET binding elements should be used in place of Knockout comment bindings wherever possible"};function register(){return{"comment":_handleComment}};function _handleComment(ruleCtx,comment){var issue,binding,i,suggest;if(comment.length===0){return}if(comment.toLowerCase().startsWith("ko ")){i=_eatWhite(comment,3);if(i>=0){comment=comment.substring(i);i=comment.indexOf(":");binding=i>0?comment.substring(0,i).trim():"";suggest=_getSuggested(binding);issue=new ruleCtx.Issue("Knockout comment binding \""+binding+":\" found"+(suggest?". Use of JET "+suggest+" recommended.":""));ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _getSuggested(binding){var suggest;binding=binding.toLowerCase();if(binding==="foreach"){suggest="<oj-bind-for-each>"}else if(binding==="if"||binding==="ifnot"){suggest="<oj-bind-if>"}else if(binding==="text"){suggest="<oj-bind-text>"}return suggest};function _eatWhite(str,startIndex){var i,len,ret=-1;startIndex=startIndex?startIndex:0;len=str?str.length:0;for(i=startIndex;i<len;i++){if(!_isWhite(str.charAt(i))){ret=i;break}}return ret};function _isWhite(c){return" \t\n\r\x0B".indexOf(c)>=0};module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
- const RULE_NAME="oj-html-ko-databind";function getName(){return RULE_NAME};function getShortDescription(){return"Jet binding elements should be used in place of Knockout 'data-bind' bindings"};function getDescription(){return"JET binding elements should be used in place of Knockout 'data-bind' bindings wherever possible."};function register(){return{"attr":function(ruleCtx,attrName,attrValue){if(attrName==="data-bind"){_handleDataBind(ruleCtx,attrValue)}}}};function _handleDataBind(ruleCtx,attrValue){var issue,aBindings,binding,i,x,suggest;attrValue=attrValue.trim();if(attrValue.length===0){return}attrValue=attrValue.toLowerCase();aBindings=attrValue.split(",");for(i=0;i<aBindings.length;i++){binding=aBindings[i].trim();x=binding.indexOf(":");if(x<0){continue}binding=binding.substring(0,x).trim();suggest=_getSuggested(binding);if(suggest){issue=new ruleCtx.Issue("Knockout data-bind \""+binding+":\" binding found. Use of JET "+suggest+" recommended.");ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _getSuggested(binding){var suggest;if(binding==="foreach"){suggest="<oj-bind-for-each>"}else if(binding==="if"||binding==="ifnot"){suggest="<oj-bind-if>"}else if(binding==="text"){suggest="<oj-bind-text>"}else if(binding==="css"){suggest=":class binding"}return suggest};module.exports={getName,getDescription,getShortDescription,register};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="oj-html-ko-databind";function getName(){return RULE_NAME};function getShortDescription(){return"Jet binding elements should be used in place of Knockout 'data-bind' bindings"};function getDescription(){return"JET binding elements should be used in place of Knockout 'data-bind' bindings wherever possible."};function register(){return{"<data-bind=>":_onDataBind}};function _onDataBind(ruleCtx,attrName,attrValue){var aBindings,binding,i,x,suggest;attrValue=attrValue.trim();if(attrValue.length===0){return}attrValue=attrValue.toLowerCase();aBindings=attrValue.split(",");for(i=0;i<aBindings.length;i++){binding=aBindings[i].trim();x=binding.indexOf(":");if(x<0){continue}binding=binding.substring(0,x).trim();suggest=_getSuggested(binding);if(suggest){let issue=new ruleCtx.Issue("Knockout data-bind \""+binding+":\" binding found. Use of JET "+suggest+" recommended.");ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _getSuggested(binding){var suggest;if(binding==="foreach"){suggest="<oj-bind-for-each>"}else if(binding==="if"||binding==="ifnot"){suggest="<oj-bind-if>"}else if(binding==="text"){suggest="<oj-bind-text>"}else if(binding==="css"){suggest=":class binding"}return suggest};module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const RULE_NAME="oj-html-label-for-prefix";const SHORT_DESCRIPT="<oj-label> 'for' attributes should not be prefixed with a ':'";const LONG_DESCRIPT="The <oj-label> 'for' attribute should not be prefixed with a ':'. The 'for' attribute is an explicit property of <oj-label> and is not a global attribute.";const COLON_FOR=":for";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{"ojtag":_handle}}function _handle(ruleCtx,tagName){var attribs,attrPos,issue,attrPos;if(tagName!=="oj-label"||ruleCtx.filepath.includes("jet-composites")||!ruleCtx.tagNode.attribs){return}attribs=ruleCtx.tagNode.attribs;if(attribs.hasOwnProperty(COLON_FOR)){issue=new ruleCtx.Issue("<"+ruleCtx.tag+"> ':for' should be unprefixed");attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,COLON_FOR);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}};module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
- const RULE_NAME="oj-html-missing-doctype";function getName(){return RULE_NAME};function getShortDescription(){return"The HTML document type declaration should be specified"};function getDescription(){return"JET requires HTML5 standards mode. To ensure that this mode is enabled in every browser, you should specify the HTML5 document type declaration <!DOCTYPE html>"};function register(){return{"file":_handleFile}};function _handleFile(ruleCtx){var issue;var node,siblings,i;var DomUtils=ruleCtx.utils.DomUtils;var NodeType=ruleCtx.NodeTypes;node=ruleCtx.node;if(node.type===NodeType.DIRECTIVE&&_isDocType(node.data)){return}siblings=DomUtils.getSiblings(node);for(i=0;i<siblings.length;i++){node=siblings[i];if(node.type===NodeType.DIRECTIVE){if(_isDocType(node.data)){break}}if(node.type===NodeType.TAG||node.type===NodeType.SCRIPT){if(DomUtils.isNonFragmentJetPage(ruleCtx)){issue=new ruleCtx.Issue("Missing '<!DOCTYPE html>'");ruleCtx.reporter.addIssue(issue,ruleCtx);break}}}};function _isDocType(s){s=s?s.replace(/!/g,"").trim().toLowerCase():s;return s.startsWith("doctype")};module.exports={getName,getDescription,getShortDescription,register};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="oj-html-missing-doctype";function getName(){return RULE_NAME};function getShortDescription(){return"The HTML document type declaration should be specified"};function getDescription(){return"JET requires HTML5 standards mode. To ensure that this mode is enabled in every browser, you should specify the HTML5 document type declaration <!doctype html>"};function register(){return{"file":_handleFile}};function _handleFile(ruleCtx){var issue;var node,siblings,i;var DomUtils=ruleCtx.utils.DomUtils;var NodeType=ruleCtx.NodeTypes;node=ruleCtx.node;if(node.type===NodeType.DIRECTIVE&&_isDocType(node.data)){return}siblings=DomUtils.getSiblings(node);for(i=0;i<siblings.length;i++){node=siblings[i];if(node.type===NodeType.DIRECTIVE){if(_isDocType(node.data)){break}}if(node.type===NodeType.TAG||node.type===NodeType.SCRIPT){if(DomUtils.isNonFragmentJetPage(ruleCtx)){issue=new ruleCtx.Issue("Missing '<!doctype html>'");ruleCtx.reporter.addIssue(issue,ruleCtx);break}}}};function _isDocType(s){s=s?s.replace(/!/g,"").trim().toLowerCase():s;return s.startsWith("doctype")};module.exports={getName,getDescription,getShortDescription,register};
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULENAME="oj-html-msgs-cat-text";const DESCRIPTION="For theme 'Redwood', the UX specification for Messages does not include category text."+"By default, the component renders the category text based on the severity. Redwood themed "+"applications should explicitly set the 'display-options.category' attribute to 'none' so "+"that the category text will not be rendered, and messages will match the UX "+"specificatiopn.";const SHORT_DESCRIPTION="Redwood themed applications should explicitly set the 'display-options.category' attribute to 'none'";const DISP_OPTS_CATEGORY="display-options.category";const OJ_MESSAGE="oj-message";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-messages>":this._onOjMessages}}_onOjMessages(ruleCtx){var msgs,val;var node=ruleCtx.tagNode;var attribs=node.attribs;var attr=attribs[DISP_OPTS_CATEGORY];var template=_hasMessageTemplate(node);if(template){if(msgs=_getMessages(template)){msgs.forEach(msg=>{val=undefined;if(msg.attribs){if((val=msg.attribs[DISP_OPTS_CATEGORY])!==undefined){if(val==="none"||val!=="auto"&&val!=="header"){return}}}this._emitIssue(ruleCtx,val!==undefined?1:2,msg,val)})}else{this._emitIssue(ruleCtx,3)}}else{if(attr!=="none"){this._emitIssue(ruleCtx,4,node,attr)}}}_emitIssue(ruleCtx,id,node,val){var issue;switch(id){case 1:issue=new ruleCtx.Issue(`<oj-message> attrib 'display-options.category' set to '${val}' - expected 'none'`);break;case 2:issue=new ruleCtx.Issue(`<oj-message> attrib 'display-options.category' missing or not set to 'none'`);break;case 3:issue=new ruleCtx.Issue("<template> with <oj-message> children expected");break;case 4:issue=new ruleCtx.Issue(`<oj-messages> attrib 'display-options.category' missing or not set to 'none'`);break;}if((id===1||id===4)&&val){let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,node,DISP_OPTS_CATEGORY);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end)}else if(id===2){issue.setPosition(null,null,node.startIndex,node.startIndex+OJ_MESSAGE.length)}if(id>1){issue.setMsgKey(RULENAME+"_"+(id-1))}ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _hasMessageTemplate(node){var ch,n,i;if((ch=node.children)&&ch.length){for(i=0;i<ch.length;i++){n=ch[i];if(n.type==="tag"&&n.name==="template"){if(n.attribs&&n.attribs.slot==="messageTemplate"){return n}}}}return null};function _getMessages(node){var ch,msgs=null;if((ch=node.children)&&ch.length){ch.forEach(n=>{if(n.type==="tag"&&n.name==="oj-message"){if(!msgs){msgs=[]}msgs.push(n)}})}return msgs};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-no-style-tag";const DESCRIPTION="In-line CSS in a <style> section is not permitted and should be declared in a CSS file.";const SHORT_DESCRIPTION="In-line CSS should be in a CSS file, not in a <style> section";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<style>":this._onStyle}}_onStyle(ruleCtx){if(!ruleCtx.rulePack.isRuleEnabled("csp-html-style-unsafe-inline","CSP")){let issue=new ruleCtx.Issue("In-line CSS in a <style> section is not permitted - use a .css file");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}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-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 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const RULE_NAME="oj-html-oj-lib";const DONT_LOAD=["ojcorebundle.js","oj3rdpartybundle.js","ojcommoncomponentbundle.js"];function getName(){return RULE_NAME};function getShortDescription(){return"Use of the oj.js script should be discontinued"};function getDescription(){return"The <i>oj.js</i> script has been <b>deprecated</b>. Applications should use <i>Require.js</i> for <a href=\"https://docs.oracle.com/en/middleware/jet/6/develop/using-requirejs-modular-development.html\">modular development</a>."};function register(){return{"script":_handleTag}};function _handleTag(ruleCtx,tagName,data){var node,attribs,attrib,src,issue;var attrPos;node=ruleCtx.node;attribs=node?node.attribs:null;if(!attribs){return}for(attrib in attribs){if(attrib.toLowerCase()==="src"){src=attribs[attrib].toLowerCase();if(src.endsWith("oj.js")){issue=new ruleCtx.Issue("<"+tagName+"> loads full library 'oj.js' - do not use - deprecated!")}if(issue){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 +1,6 @@
1
- const isValidAttr=require("./helpers/valid-attr");const RULE_NAME="oj-html-ojattr-520";const OJ_EVENT_PREFIX="on-oj-";const SLOT="slot";const DATABIND="data-bind";function getName(){return RULE_NAME};function getShortDescription(){return"JET component attribute must be valid"};function getDescription(){return"JET component attribute must be a defined attribute for the component"};function register(){return{"attr":_handleAttr}};function _handleAttr(ruleCtx,attrName,attrValue){var tagName,origName,attrPos,issue,metaLib;metaLib=ruleCtx.utils.metaLib;tagName=ruleCtx.tag;origName=attrName;attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(!isValidAttr(attrName)){issue=new ruleCtx.Issue("Invalid colon-prefixed attribute '"+origName+"'");attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,origName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);issue.setMsgKey(RULE_NAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(!ruleCtx.ojTag||ruleCtx.utils.DomUtils.isCommonAttr(attrName)||ruleCtx.utils.DomUtils.isCommonEventAttr(attrName)||attrName===SLOT||attrName===DATABIND||attrName.startsWith(OJ_EVENT_PREFIX)){return}if(!metaLib.isTagAttr(tagName,attrName)){if(!metaLib.isTagEvent(tagName,attrName)){if(!_whiteList(ruleCtx,tagName,attrName)){issue=new ruleCtx.Issue("<"+tagName+"> attribute '"+attrName+"' is unknown");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _whiteList(ruleCtx,tagName,attrName){var info,ret=false;if(tagName==="oj-label"&&(attrName==="help.definition"||attrName==="help.source")){info=ruleCtx.utils.metaLib.getRevisionInfo();if(info.jetVersion==="5.2.0"){ret=true}}return ret};module.exports={getName,getDescription,getShortDescription,register};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const isValidAttr=require("./helpers/valid-attr");const RULE_NAME="oj-html-ojattr-520";const OJ_EVENT_PREFIX="on-oj-";const SLOT="slot";const DATABIND="data-bind";function getName(){return RULE_NAME};function getShortDescription(){return"JET component attribute must be valid"};function getDescription(){return"JET component attribute must be a defined attribute for the component"};function register(){return{"attr":_handleAttr}};function _handleAttr(ruleCtx,attrName,attrValue){var tagName,origName,attrPos,issue,metaLib;metaLib=ruleCtx.utils.metaLib;tagName=ruleCtx.tag;origName=attrName;attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(!isValidAttr(attrName)){issue=new ruleCtx.Issue("Invalid attribute '"+origName+"'");attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,origName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);issue.setMsgKey(RULE_NAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(!ruleCtx.ojTag||ruleCtx.utils.DomUtils.isCommonAttr(attrName)||ruleCtx.utils.DomUtils.isCommonEventAttr(attrName)||attrName===SLOT||attrName===DATABIND||attrName.startsWith(OJ_EVENT_PREFIX)){return}if(!metaLib.isTagAttr(tagName,attrName)){if(!metaLib.isTagEvent(tagName,attrName)){if(!_whiteList(ruleCtx,tagName,attrName)){issue=new ruleCtx.Issue("<"+tagName+"> attribute '"+attrName+"' is unknown");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _whiteList(ruleCtx,tagName,attrName){var info,ret=false;if(tagName==="oj-label"&&(attrName==="help.definition"||attrName==="help.source")){info=ruleCtx.utils.metaLib.getRevisionInfo();if(info.jetVersion==="5.2.0"){ret=true}}return ret};module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
- const RULE_NAME="oj-html-ojattr-deprecated";const OJ_EVENT_PREFIX="on-oj-";const DATABIND="data-bind";function getName(){return RULE_NAME};function getShortDescription(){return"JET component deprecated attributes should not be used"};function getDescription(){return"JET component deprecated attributes should not be used."};function register(){return{"attr":_onAttr}};function _onAttr(ruleCtx,attrName){var tagName,issue,metaLib,dep,since,help;metaLib=ruleCtx.utils.metaLib;tagName=ruleCtx.tag;if(!metaLib.isWCTag(tagName)||ruleCtx.utils.DomUtils.isCommonAttr(attrName)||ruleCtx.utils.DomUtils.isCommonEventAttr(attrName)||attrName===DATABIND||attrName.startsWith(OJ_EVENT_PREFIX)){return}dep=metaLib.isTagAttrDeprecated(tagName,attrName);if(!dep){return}if(typeof dep==="object"){since=dep.since?" (since "+dep.since+")":"";help=dep.description?" "+dep.description:"";issue=new ruleCtx.Issue(`<${tagName}> attribute '${attrName}' is deprecated${since}!${help}`)}else{issue=new ruleCtx.Issue(`<${tagName}> attribute '${attrName}' is deprecated! ${dep}`)}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)};module.exports={getName,getDescription,getShortDescription,register};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="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 +1,6 @@
1
- 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{"ojtag":_handleTag}};function _handleTag(ruleCtx,tagName){var attribs,attrName,enumValue,issue,metaLib,o,since,help;metaLib=ruleCtx.utils.metaLib;attribs=ruleCtx.node.attribs;if(!attribs||!metaLib.isWCTag(tagName)){return}for(attrName in attribs){issue=null;attrName=attrName.charAt(0)!==":"?attrName:attrName.substring(1);enumValue=attribs[attrName];o=metaLib.isTagAttrEnumValueDeprecated(tagName,attrName,enumValue);if(o){help=o.description?" "+o.description.trim():"";since=o.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)}}};module.exports={getName,getDescription,getShortDescription,register};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="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 +1,6 @@
1
- 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};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="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 +1,6 @@
1
- const RULE_NAME="oj-html-ojattr-value";const OJ_EVENT_PREFIX="on-oj-";const DATABIND="data-bind";function getName(){return RULE_NAME};function getShortDescription(){return"Custom component attribute value must be a defined value"};function getDescription(){return"Custom component attribute value must be a defined value for the component"};function register(){return{"attr":_handleAttr}};function _handleAttr(ruleCtx,attrName,attrValue){var tagName,issue,metaLib,DomUtils,aVals,i;if(attrValue.startsWith("{{")||attrValue.startsWith("[[")||attrValue.charAt(0)==="{"){return}metaLib=ruleCtx.utils.metaLib;DomUtils=ruleCtx.utils.DomUtils;tagName=ruleCtx.tag;if(!metaLib.isWCTag(tagName)||DomUtils.isCommonAttr(attrName)||DomUtils.isCommonEventAttr(attrName)||attrName===DATABIND){return}if(metaLib.isTagAttr(tagName,attrName)){try{if(attrValue.charAt(0)==="["){aVals=JSON.parse(attrValue)}else{aVals=[attrValue]}}catch(e){}if(!aVals){return true}if(!metaLib.hasTagAttrValues(tagName,attrName)){return}for(i=0;i<aVals.length;i++){attrValue=aVals[i];if(!metaLib.isTagAttrValue(tagName,attrName,attrValue)){if(!_checkSpecialCases(ruleCtx,tagName,attrName,attrValue)){issue=new ruleCtx.Issue(`<${tagName}> attribute '${attrName}' refers to undefined value '${attrValue}'`);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}};function _checkSpecialCases(ruleCtx,tagName,attrName,attrValue){if(tagName==="oj-led-gauge"&&attrName==="type"){return ruleCtx.utils.DomUtils.isSvgPath(attrValue)}return false};module.exports={getName,getDescription,getShortDescription,register};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="oj-html-ojattr-value";const DATABIND="data-bind";function getName(){return RULE_NAME};function getShortDescription(){return"Custom component attribute value must be a defined value"};function getDescription(){return"Custom component attribute value must be a defined value for the component"};function register(){return{"webcomp":_onWComp}};function _onWComp(ruleCtx,tag,attr){var attrs,attr,val;if(ruleCtx.tagNode.attribs){attrs=ruleCtx.tagNode.attribs;for(attr in attrs){val=attrs[attr];if(val.startsWith("{{")||val.startsWith("[[")||val.charAt(0)==="{"){continue}_checkAttr(ruleCtx,tag,attr,val)}}};function _checkAttr(ruleCtx,tag,attr,val){var issue,metaLib,DomUtils,aVals,aVal,i;metaLib=ruleCtx.utils.metaLib;DomUtils=ruleCtx.utils.DomUtils;if(DomUtils.isCommonAttr(attr)||DomUtils.isCommonEventAttr(attr)||attr===DATABIND){return}if(metaLib.isTagAttr(tag,attr)){try{if(val.charAt(0)==="["){aVals=JSON.parse(val)}else{aVals=[val]}}catch(e){}if(!aVals){return true}if(!metaLib.hasTagAttrValues(tag,attr)){return}for(i=0;i<aVals.length;i++){aVal=aVals[i];if(!metaLib.isTagAttrValue(tag,attr,aVal)){if(!_checkSpecialCases(ruleCtx,tag,attr,aVal)){let attrPos;issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' refers to undefined value '${aVal}'`);attrPos=DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}};function _checkSpecialCases(ruleCtx,tag,attr,attrValue){if(tag==="oj-led-gauge"&&attr==="type"){return ruleCtx.utils.DomUtils.isSvgPath(attrValue)}return false};module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
- 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{"attr":_handleAttr}};function _handleAttr(ruleCtx,attrName){var tagName,issue,origName,attrPos,metaLib,DomUtils;metaLib=ruleCtx.utils.metaLib;DomUtils=ruleCtx.utils.DomUtils;tagName=ruleCtx.tag;origName=attrName;attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(!isValidAttr(attrName)){issue=new ruleCtx.Issue("<"+tagName+"> - invalid colon-prefixed attribute '"+origName+"'");attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,origName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);issue.setMsgKey(RULE_NAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(!metaLib.isWCTag(tagName)||DomUtils.isCommonAttr(attrName)||DomUtils.isCommonEventAttr(attrName)||attrName===SLOT||attrName===DATABIND||attrName===DATACMD||attrName===DATACONTEXT||attrName.startsWith(OJ_EVENT_PREFIX)||attrName.startsWith(EVENT_PREFIX)){return}if(!metaLib.isTagAttr(tagName,attrName)){if(!metaLib.isTagEvent(tagName,attrName)){issue=new ruleCtx.Issue("<"+tagName+"> attribute '"+attrName+"' is unknown");ruleCtx.reporter.addIssue(issue,ruleCtx)}}};module.exports={getName,getDescription,getShortDescription,register};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const 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 +1,6 @@
1
- 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,attrValue){var tagName,issue,metaLib;metaLib=ruleCtx.utils.metaLib;tagName=ruleCtx.tag;if(!metaLib.isWCTag(tagName)){return}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};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="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 +1,6 @@
1
- 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};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="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 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const getStyles=require("./helpers/extractStylesFromClass");const RULE_NAME="oj-html-ojstyle";const SHORT="JET component 'class' attribute styles must be valid";const LONG="JET web component 'class' attribute styles prefixed with 'oj-' must be JET defined styles, or defined in a styleset.";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){var i;if(regCtx.rulePack.isRuleEnabled("oj-html-stylesel")){return false}this._ignore=regCtx.ruleOpts["ignore"];if(this._ignore){for(i=0;i<this._ignore.length;i++){this._ignore[i]=new RegExp(this._ignore[i])}}return{"class":this._onClass}};Rule.prototype._onClass=function(ruleCtx,attrName,attrValue){var tagName,i,j,issue,classes,style,metaLib;metaLib=ruleCtx.utils.metaLib;tagName=ruleCtx.tag;if(!ruleCtx.ojTag||!metaLib.isJetTag(tagName)){return}classes=getStyles(attrValue);for(i=0;i<classes.length;i++){style=classes[i];if(this._ignore){for(j=0;j<this._ignore.length;j++){if(this._ignore[j].test(style)){break}}if(j<this._ignore.length){continue}}if(!metaLib.isStyle(style)){issue=new ruleCtx.Issue("<"+tagName+"> - unknown JET class style '"+style+"'");ruleCtx.reporter.addIssue(issue,ruleCtx)}}};module.exports=Rule;
@@ -1 +1,6 @@
1
- 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,attrValue){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};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="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 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const RULE_NAME="oj-html-ojtag-datactx";const DATA_OJ_CTX="data-oj-context";function getName(){return RULE_NAME};function getShortDescription(){return"Attribute 'data-oj-context' should not specify an expression"};function getDescription(){return"Use of an attribute expression for 'data-oj-context' is meaningless"};function register(){return{"attrexpr":_handleAttr}};function _handleAttr(ruleCtx,attrName,attrValue){var issue;if(attrName===DATA_OJ_CTX){issue=new ruleCtx.Issue("'data-oj-context' attribute expession not expected");ruleCtx.reporter.addIssue(issue,ruleCtx)}};module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
- const RULE_NAME="oj-html-ojtag-deprecated";function getName(){return RULE_NAME};function getShortDescription(){return"Deprecated JET custom components should not be used"};function getDescription(){return"Deprecated JET custom components should not be used. Refer to the diagnostic issued for a suggested replacement."};function register(){return{"ojtag":_handleOjTag}};function _handleOjTag(ruleCtx,tagName){var issue,metaLib,deprecatedText;if(tagName==="oj-slot"){return}metaLib=ruleCtx.utils.metaLib;if(metaLib.isJetTag(tagName)){deprecatedText=metaLib.isTagDeprecated(tagName);if(deprecatedText!==null){issue=new ruleCtx.Issue("<"+tagName+"> is deprecated. "+deprecatedText);ruleCtx.reporter.addIssue(issue,ruleCtx)}}};module.exports={getName,getDescription,getShortDescription,register};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="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 +1,6 @@
1
- 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};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="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 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const RULE_NAME="oj-html-ojtag-id";const SHORT_DESCRIPT="JET custom components should not used hard-coded 'id' attributes";const LONG_DESCRIPT="Hard-coded element IDs should not be used within custom components. 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.";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){var issue,attrPos;return{"ojtag":function(ruleCtx,tagName){if(ruleCtx.utils.metaLib.isBindingTag(tagName)){return}if(ruleCtx.node.attribs&&ruleCtx.node.attribs.id){var id=ruleCtx.node.attribs.id;if(id.toLowerCase().indexOf("$unique")<0){if(!ruleCtx.ojTag){issue=new ruleCtx.Issue("<"+ruleCtx.tag+"> uses id attribute '"+id+"'. Use $UniqueId.");attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,"id");issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}}};module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
- 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};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="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 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const RULENAME="oj-html-ojtag-ns";const LONG="Web component namespaces starting with prefixes 'oj-' or 'ns-' must be registered. A component must not use an un-registered namespace.";const SHORT="Web component namespaces starting with prefixes 'oj-' or 'ns-' must be registered.";class Rule{getName(){return RULENAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(){return{ojtag:this._onOjTag}}_onOjTag(ruleCtx,tag){var a,prefix,msg,i;if(tag.startsWith("demo-")||tag.startsWith("my-")||tag==="oj-slot"){return}if(tag.startsWith("oj-")||tag.startsWith("ns-")){a=tag.split("-");if(a.length>=2){prefix=a[0]+"-"+a[1];if(!ruleCtx.utils.metaLib.isNSRegistered(prefix)){if(!ruleCtx.utils.metaLib.isJetTag(tag)){msg=`<${tag}> : unregistered use of '${tag.substring(0,2)}' namespace`;this._emitIssue(ruleCtx,msg)}}}}else{if(a.length>=2){if(this._nameSpaces){prefix=a[0]+"-"+a[1];for(i=0;i<this._nameSpaces.length;i++){if(this._nameSpaces[i].startsWith(prefix)){return}}}let b=tag.includes("-");let s=b?"web component namespace":"tag";msg=`'${tag}' : unknown ${s}`;this._emitIssue(ruleCtx,msg,b?1:2)}}}_emitIssue(ruleCtx,msg,id){var issue;issue=new ruleCtx.Issue(msg);if(id){issue.setMsgKey(RULENAME+"_"+id)}ruleCtx.reporter.addIssue(issue,ruleCtx)}}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-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;
@@ -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-redwood-cssnovars";const DESCRIPTION="Support for CSS files 'oj-redwood-novars.css' and 'oj-redwood-novars-min.css' will be discontinued in JET 12. Replace with 'oj-redwood.css' or 'oj-redwood-min.css'.";const SHORT_DESCRIPT=DESCRIPTION;const MSG="Support for '@' will be discontinued in JET 12. Use 'oj-redwood.css' or 'oj-redwood-min.css'.";const NOVARS="oj-redwood-novars";const NOVARS_MIN="oj-redwood-novars-min";const HREF="href";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPT}register(){return{link:this._onLink}}_onLink(ruleCtx){var attrPos;var attribs=ruleCtx.node.attribs;if(attribs&&attribs.href){if(attribs.href.includes(NOVARS)){let isMin=attribs.href.includes(NOVARS_MIN);let issue=new ruleCtx.Issue(MSG.replace("@",isMin?NOVARS_MIN:NOVARS));attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,HREF);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}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-redwood-cssvars";const SHORT_DESCRIPT="Do not use 'oj-redwood-cssvars' files. Rename files such 'oj-redwood-cssvars-min.css' to 'oj-redwood-min.css'.";const DESCRIPTION="Files starting with 'oj-redwood-cssvars should NOT be used, and the string '-cssvars' "+" should be removed from the file path. For example, rename 'oj-redwood-cssvars-min.css' to 'oj-redwood-min.css'.";const MSG="CSS filename contains 'oj-redwood-cssvars'. Rename: e.g. 'oj-redwood-cssvars-min.css' to 'oj-redwood-min.css'.";const BAD_VARS="oj-redwood-cssvars";const HREF="href";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPT}register(){return{link:this._onLink}}_onLink(ruleCtx){var attrPos;var attribs=ruleCtx.node.attribs;if(attribs&&attribs.href){if(attribs.href.includes(BAD_VARS)){let issue=new ruleCtx.Issue(MSG);attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,HREF);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}module.exports=Rule;
@@ -1 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const RULE_NAME="oj-html-self-close";const SHORT="Do not self-close non-void elements.";const DESCRIPT="Do not self-close non-void elements, e.g. &lt;div/&gt; or &lt;span/&gt;";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._utils=regCtx.utils.utils;return{elem:this._onElem}};Rule.prototype._onElem=function(ruleCtx,tag){var tag,n,issue;var DomUtils;DomUtils=ruleCtx.utils.DomUtils;n=ruleCtx.tagNode;if(!DomUtils.isSvgElem(tag)){if(!DomUtils.isCommonElem(tag)||!DomUtils.isSelfClosingTag(tag)){if(this._isClosed(ruleCtx.data.substring(n.startIndex,n.endIndex+1),n)){issue=new ruleCtx.Issue("Invalid self-closure of non-void tag '<"+tag+"/>'");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};Rule.prototype._isClosed=function(data,node){var c,x,i;data=_removeAttribs(data,node);data=data.trim();if(data.charAt(0)!=="<"){return false}x=_findClose(data);if(x>=0){data=data.substring(0,x+1)}if(data.charAt(data.length-1)===">"){for(i=data.length-2;i>1;i--){c=data.charAt(i);if(this._utils.isWhitespace(c)){continue}return c==="/"}}return false};function _findClose(data){var x;x=data.indexOf(">");return x<0?0:x};function _removeAttribs(data,node){var attrs,attr,val,re;if(!node.attribs){return data}attrs=node.attribs;for(attr in attrs){val=attrs[attr];re=new RegExp(attr);data=data.replace(re,"");val=val.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&");re=new RegExp(val);data=data.replace(re,"")}data=data.replace(/[\"\'\=\[\(\{\}\)\]\s#,_]/g,"");return data};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 getParentNodeForSlot=require('./helpers/has-slot-name');const RULE_NAME='oj-html-slot-item-minmax';const DESCRIPT='Components can include a \'minItems\' or \'maxItems\' property in a slot defintion in the component metadata, to describe '+'how many child elements can be assigned to that slot. 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(){this._handled=[];return{'elem':this._onElem,'file':this._onFile}};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,smd,min,max,items;if(!(node=getParentNodeForSlot(ruleCtx,slotVal))){return}if(this._isNodeHandled(node,slotVal)){return}if(node.name!==OJ_SWITCHER){if(smd=ruleCtx.utils.metaLib.getTagSlotMetadata(node.name,slotVal)){min=typeof smd.minItems==='number'?smd.minItems:0;max=typeof smd.maxItems==='number'?smd.maxItems:0;if(min>0&&max<0){return}}if(ruleCtx.tag===TEMPLATE){items=_getTemplateChildTagCount(ruleCtx.tagNode.children)}else{items=_getChildTagCount(node.children,slotVal)}let sItems;if(items>max&&max>0){sItems=max===1?'one element can':`${max} elements may`;issue=new ruleCtx.Issue(`<${node.name}> specifies that no more than ${sItems} be assigned to the '${slotVal}' slot`);issue.setPosition(null,null,node.startIndex+1,node.startIndex+node.name.length);ruleCtx.reporter.addIssue(issue,ruleCtx);this._handleNode(node,slotVal)}if(min>0&&items<min){sItems=min===1?'one element':`${min} elements`;issue=new ruleCtx.Issue(`<${node.name}> specifies that at least ${sItems} must be assigned to the '${slotVal}' slot`);issue.setMsgKey(RULE_NAME+'_1');issue.setSeverity('major');issue.setPosition(null,null,node.startIndex+1,node.startIndex+node.name.length);ruleCtx.reporter.addIssue(issue,ruleCtx);this._handleNode(node,slotVal)}}};Rule.prototype._onFile=function(){this._handled.length=0};Rule.prototype._isNodeHandled=function(node,slot){var i,si;si=node.startIndex;for(i=0;i<this._handled.length;i+=2){if(this._handled[i]===si&&this._handled[i+1]===slot){return true}}return false};Rule.prototype._handleNode=function(node,slot){this._handled.push(node.startIndex);this._handled.push(slot)};function _getTemplateChildTagCount(childs){var n=0;if(childs){for(let i=0;i<childs.length;i++){if(childs[i].type==='tag'){n++}}}return n};function _getChildTagCount(childs,slot){var child,n=0;if(childs){for(let i=0;i<childs.length;i++){child=childs[i];if(child.type==='tag'&&child.attribs&&child.attribs.slot===slot){n++}}}return n};module.exports=Rule;
@@ -1 +1,6 @@
1
- const RULE_NAME="oj-html-slot-name";const SLOT="slot";const helper=require("./helpers/has-slot-name");function getName(){return RULE_NAME};function getShortDescription(){return"The element specifies a slot attribute value that is not defined by the parent element."};function getDescription(){return"The element specifies a slot attribute value that is not defined by the parent element."};function register(){return{"attr":function(ruleCtx,attrName,attrValue){var issue,node;if(attrName!==SLOT||ruleCtx.tag==="template"){return}node=helper(ruleCtx,attrValue);if(!node){issue=new ruleCtx.Issue("unresolved slot '"+attrValue+"' on <"+ruleCtx.tag+">");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};module.exports={getName,getDescription,getShortDescription,register};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const 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;
@@ -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 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 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const{LENGTH_PROP_SET}=require("./helpers/cssHelper");const RULENAME="oj-html-style-abs-units";const DESCRIPTION="In general it is preferable to use relative length units in place of absolute units. "+"Specifically, 'rem' units are recommended because they proportionately adjust to the root "+"font size. 'rem' can be used for anything that takes a length unit - e.g. font-size, line-height, "+"width, height, padding, margin, etc. However, there are cases where absolute units are "+"required. This project is configured to allow absolute units in selector names that include "+"one of the following terms: 'image, and 'picture'.";const SHORT_DESCRIPTION="In general it is preferable to use relative length units in place of absolute units.";const ABS_UNITS=["px","cm","mm","in","pt","pc","all"];const COLON=":";const ALL="all";const NUMBER="number";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){if(!this._checkRuleOptions(regCtx)){return false}return{"style":this._onStyle}}_onStyle(ruleCtx,attr,value){var prop,val,unit,s,x,i;this._CssUtils=ruleCtx.utils.CssUtils;for(i=0;i<value.length;i++){s=value[i];x=s.indexOf(COLON);if(x>=0){prop=s.substring(0,x).trimEnd();val=s.substring(x+1).trimStart();if(!LENGTH_PROP_SET.has(prop)){continue}{unit=_hasAbsUnits(val);if(unit){this._prop(ruleCtx,prop,val,unit)}}}}}_prop(ruleCtx,prop,val,unit){var m,qty,s,i;m=val.match(/[0-9]+(px|cm|mm|in|pt|pc)/g);if(m&&m.length){for(i=0;i<m.length;i++){s=m[i];unit=s.substring(s.length-2);qty=s.substring(0,s.length-unit.length);qty=parseInt(qty);if(!this._okThreshold(unit,qty)||qty===0){this._emitIssue(ruleCtx,prop,m[i],unit,qty)}}}else if(_isExpr(val)){this._emitIssue2(ruleCtx,prop,val,unit)}}_emitIssue(ruleCtx,prop,val,unit,qty){var issue,unit;if(qty){issue=new ruleCtx.Issue(`style '${prop}' value '${val}' - best practices: replace absolute unit '${unit}' with a relative unit (e.g. 'rem' or '%')`)}else{issue=new ruleCtx.Issue(`style '${prop}' value '${val}' - best practices: remove '${unit}' for zero quantity`);issue.setMsgKey(RULENAME+"_1");issue.setSeverity("minor")}if(issue){this._reportIssue(ruleCtx,issue)}}_emitIssue2(ruleCtx,prop,val,unit){var issue;issue=new ruleCtx.Issue(`style '${prop}' expression '${val}' generates a '${unit}' length - best practices: convert to a relative unit (e.g. 'rem' or '%')`);issue.setMsgKey(RULENAME+"_2");this._reportIssue(ruleCtx,issue)}_reportIssue(ruleCtx,issue){var pos;pos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,"style");issue.setPosition(pos.row,pos.col,pos.start,pos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}_okThreshold(unit,qty){var th;if(!this._unitOpts||typeof qty!==NUMBER){return true}th=this._unitOpts[unit];if(th===undefined){th=this._unitOpts[ALL]}return th?Math.abs(qty)<=th:true}_checkRuleOptions(regCtx){var units,unit,th,b;units=regCtx.ruleOpts["absunits"];if(units){if(!regCtx.utils.utils.isObject(units)){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} : option 'absunits' is not an object`);this._fail=true;return false}for(unit in units){if(!ABS_UNITS.includes(unit)){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} : option 'absunits' value '${unit}' is not absolute`);b=true;continue}if(units.hasOwnProperty(unit)){th=units[unit];if(typeof th!==NUMBER){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} : option 'absunits' threshold '${th}' is not a number`);b=true}}}this._unitOpts=units}return!b}}function _hasAbsUnits(s){var expr,unit,start,end,i,x;for(i=0;i<ABS_UNITS.length;i++){unit=ABS_UNITS[i];if(unit!==ALL&&s.includes(unit)){return unit}}expr=_isExpr(s);if(!expr){return false}for(i=0;i<ABS_UNITS.length;i++){unit=ABS_UNITS[i];if(unit===ALL){continue}x=s.indexOf(unit);if(x>=0){end=s[x+1];start=s[x-1].toLowerCase();if(start==="."||start==="+"||start.match(/[a-z]/i)){continue}return unit}}return false};function _isExpr(s){return s.includes("$")};module.exports=Rule;
@@ -1 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const cssHelper=require("./helpers/cssHelper");const RULE_NAME="oj-html-style-bp-color";const SHORT_DESCRIPT="For best practices, CSS color values should not be used - color classes such as 'oj-text-color-primary' are preferred.";const DESCRIPT="For best practices, CSS color values should not be used - color classes such as 'oj-text-color-primary' are preferred."+" See the Colors demo category in the JET cookbook under the Framework "+"<a href='https://www.oracle.com/webfolder/technetwork/jet/jetCookbook.html?component=colors&demo=bgcolors'>Utility CSS</a> category.";function Rule(){this._checkList=null;this._isAccept=false};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT_DESCRIPT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){if(!this._checkAcceptReject(regCtx)){return false}return{"style":this._onStyle}};Rule.prototype._onStyle=function(ruleCtx,attr,value,raw){var prop,val,s,x,i;this._CssUtils=ruleCtx.utils.CssUtils;for(i=0;i<value.length;i++){s=value[i];x=s.indexOf(":");if(x>=0){prop=s.substring(0,x).trimEnd();val=s.substring(x+1).trimStart();if(cssHelper.COLOR_PROPS.includes(prop)){if(this._isColorValFound(val)){if(this._okProp(prop)){this._emitIssue(ruleCtx,prop,val)}}}else if(cssHelper.COLOR_PROPS_MULTI.includes(prop)){if(this._okProp(prop)){this._parseMulti(ruleCtx,prop,val)}}}}};Rule.prototype._parseMulti=function(ruleCtx,prop,val){var a,v,i;a=val.split(" ");for(i=0;i<a.length;i++){v=a[i].trim();if(v.charAt(0)==="#"||_isColorFunc(v)||this._CssUtils.isColorName(v)){this._emitIssue(ruleCtx,prop,v)}}};Rule.prototype._emitIssue=function(ruleCtx,prop,val){var issue;issue=new ruleCtx.Issue("CSS color '"+val+"' - best practices: use the utility CSS selectors available (see 'Text', 'Icons', and 'Link' pages)");ruleCtx.reporter.addIssue(issue,ruleCtx)};Rule.prototype._isColorValFound=function(s){var i;s=s.toLowerCase();if(_isColorFunc(s)||this._CssUtils.isColorName(s)){return true}i=s.indexOf("#");if(i>=0){s=s.substring(i);if(/[0-9A-F]{6}/i.test(s)||/[0-9A-F]{3}/i.test(s)){return true}}return false};Rule.prototype._okProp=function(prop){var i;if(this._checkList){for(i=0;i<this._checkList.length;i++){if(this._checkList[i]===prop){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]=this._checkList[i].trim()}}}return true};function _isColorFunc(s){s=s.toLowerCase();return s.startsWith("rgb")||s.startsWith("hsl")};module.exports=Rule;
@@ -1 +1,6 @@
1
- const RULE_NAME="oj-html-style-bp-display";const LONG_DESCRIPT="For best practices, CSS property 'display:none' should not be used. Use of JET hide classes is recommended.";const SHORT_DESCRIPT=LONG_DESCRIPT;function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{"style":_onStyle}};function _onStyle(ruleCtx,attr,value,raw){var prop,s,x,i;for(i=0;i<value.length;i++){s=value[i];x=s.indexOf(":");if(x>=0){prop=s.substring(0,x).trimEnd();value=s.substring(x+1).trimStart();if(prop==="display"&&value==="none"){_emitIssue(ruleCtx,prop)}}}};function _emitIssue(ruleCtx,prop){var issue;issue=new ruleCtx.Issue("CSS 'display:none' - best practices, use JET hide classes");ruleCtx.reporter.addIssue(issue,ruleCtx)};module.exports={getName,getDescription,getShortDescription,register};
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="oj-html-style-bp-display";const LONG_DESCRIPT="For best practices, CSS property 'display:none' should not be used. Use of JET <oj-bind-if> is recommended.";const SHORT_DESCRIPT=LONG_DESCRIPT;function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{"style":_onStyle}};function _onStyle(ruleCtx,attr,value,raw){var prop,s,x,i;for(i=0;i<value.length;i++){s=value[i];x=s.indexOf(":");if(x>=0){prop=s.substring(0,x).trimEnd();value=s.substring(x+1).trimStart();if(prop==="display"&&value==="none"){_emitIssue(ruleCtx,prop)}}}};function _emitIssue(ruleCtx,prop){var issue;issue=new ruleCtx.Issue("CSS 'display:none' - best practices, use <oj-bind-if>");ruleCtx.reporter.addIssue(issue,ruleCtx)};module.exports={getName,getDescription,getShortDescription,register};
@@ -1 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const RULENAME="oj-html-style-bp-font-family";const DESCRIPT="For best practices, the CSS 'font-family' property should not be used. Use of JET typography classes is recommended.";const SHORT_DESCRIPT=DESCRIPT;const FONT_FAMILY="font-family";class Rule{constructor(){this._checkList=null;this._isAccept=false}getName(){return RULENAME}getDescription(){return DESCRIPT}getShortDescription(){return SHORT_DESCRIPT}register(regCtx){if(!this._checkRuleOverrides(regCtx)){return false}return{"style":this._onStyle}}_onStyle(ruleCtx,attr,value){var prop,val,s,x,i;for(i=0;i<value.length;i++){s=value[i];x=s.indexOf(":");if(x>=0){prop=s.substring(0,x).trimEnd();val=s.substring(x+1).trim();if(prop===FONT_FAMILY){if(this._okProp(val)){this._emitIssue(ruleCtx,prop,val)}}}}}_emitIssue(ruleCtx,prop,val){var issue;issue=new ruleCtx.Issue(`<style> '${prop}: ${val}' - best practices: JET Typography classes preferred`);ruleCtx.reporter.addIssue(issue,ruleCtx)}_okProp(prop){var i;if(this._checkList){for(i=0;i<this._checkList.length;i++){if(prop.match(this._checkList[i])){return this._isAccept}}return!this._isAccept}return true}_checkRuleOverrides(regCtx){var accept=regCtx.ruleOpts["accept"];var ignore=regCtx.ruleOpts["ignore"];if(accept||ignore){if(accept&&ignore){regCtx.utils.msgLib.error(`Rule ${RULENAME} : options 'accept' and 'ignore' are mutually exclusive`);return false}if(accept){this._checkList=accept;this._isAccept=true}else{this._checkList=ignore}if(!Array.isArray(this._checkList)){regCtx.utils.msgLib.error(`Rule ${RULENAME} : 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 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
1
6
  const RULE_NAME="oj-html-style-bp-font";const DESCRIPT="For best practices, CSS 'font-size' and 'font-weight' should not be used. Use of JET typography classes is recommended.";const SHORT_DESCRIPT=DESCRIPT;const FONT_PROPS=["font-size","font-weight"];function Rule(){this._checkList=null;this._isAccept=false};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT_DESCRIPT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){if(!this._checkAcceptReject(regCtx)){return false}return{"style":this._onStyle}};Rule.prototype._onStyle=function(ruleCtx,attr,value,raw){var prop,s,x,i;for(i=0;i<value.length;i++){s=value[i];x=s.indexOf(":");if(x>=0){prop=s.substring(0,x).trimEnd();if(FONT_PROPS.includes(prop)){if(this._okProp(prop)){this._emitIssue(ruleCtx,prop)}}}}};Rule.prototype._emitIssue=function(ruleCtx,prop){var issue;issue=new ruleCtx.Issue("CSS '"+prop+"' - best practices: do not set, use the JET Typography classes");ruleCtx.reporter.addIssue(issue,ruleCtx)};Rule.prototype._okProp=function(prop){var i;if(this._checkList){for(i=0;i<this._checkList.length;i++){if(this._checkList[i]===prop){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]=this._checkList[i].trim()}}}return true};module.exports=Rule;
@@ -1 +1,6 @@
1
- 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;
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 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;