@oracle/oraclejet-audit 12.0.0 → 13.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 (117) hide show
  1. package/jaf-amd.js +2 -20
  2. package/jaf.js +1 -1
  3. package/jafapi.js +1 -1
  4. package/lib/AST_Ts.js +1 -1
  5. package/lib/AstJson.js +1 -1
  6. package/lib/AstMd.js +1 -1
  7. package/lib/AstNodeTypes.js +1 -1
  8. package/lib/Cli.js +6 -0
  9. package/lib/Color.js +6 -0
  10. package/lib/Comments.js +1 -1
  11. package/lib/ComponentSvcs.js +1 -1
  12. package/lib/Components.js +1 -1
  13. package/lib/Config.js +1 -1
  14. package/lib/ConfigLib.js +1 -1
  15. package/lib/CssUtils.js +1 -1
  16. package/lib/DomUtils.js +1 -1
  17. package/lib/FileSet.js +1 -1
  18. package/lib/FsUtils.js +1 -1
  19. package/lib/Issue.js +1 -1
  20. package/lib/JafEvents.js +1 -1
  21. package/lib/JafLib.js +1 -1
  22. package/lib/Json.js +1 -1
  23. package/lib/JsonLoader.js +1 -1
  24. package/lib/Md.js +1 -1
  25. package/lib/MetaLib.js +1 -1
  26. package/lib/OjCPack.js +6 -0
  27. package/lib/OjetLib.js +6 -0
  28. package/lib/Registry.js +1 -1
  29. package/lib/RuleSet.js +1 -1
  30. package/lib/Rules.js +1 -1
  31. package/lib/Scope.js +1 -1
  32. package/lib/Utils.js +1 -1
  33. package/lib/ZipUtils.js +1 -1
  34. package/lib/amdlist.js +6 -0
  35. package/lib/api.js +1 -1
  36. package/lib/betalist.js +6 -0
  37. package/lib/builtinpacks.js +1 -1
  38. package/lib/checkage.js +6 -0
  39. package/lib/cliStats.js +1 -1
  40. package/lib/cmdline.js +1 -1
  41. package/lib/defaults.js +1 -1
  42. package/lib/deflist.js +1 -1
  43. package/lib/dislist.js +1 -1
  44. package/lib/exportRules.js +1 -1
  45. package/lib/extends.js +1 -1
  46. package/lib/grouplist.js +1 -1
  47. package/lib/groups.js +1 -1
  48. package/lib/help.js +1 -1
  49. package/lib/jetver.js +1 -1
  50. package/lib/manpage.js +6 -0
  51. package/lib/manual.js +1 -1
  52. package/lib/metaLoader.js +1 -1
  53. package/lib/metahist.js +1 -1
  54. package/lib/msgidLoader.js +1 -1
  55. package/lib/ns.js +1 -1
  56. package/lib/outfile.js +1 -1
  57. package/lib/proflist.js +6 -0
  58. package/lib/rlolist.js +6 -0
  59. package/lib/scaffold.js +1 -1
  60. package/lib/scaffoldRule.js +1 -1
  61. package/lib/schema.js +1 -1
  62. package/lib/scopewalker.js +1 -1
  63. package/meta/12.1.0/jetauditmeta.js +9 -0
  64. package/meta/13.0.0/jetauditmeta.js +9 -0
  65. package/meta/metaverlist.json +1 -1
  66. package/package.json +6 -4
  67. package/profiles/best-practice.json +146 -0
  68. package/profiles/redwood-strict.json +31 -0
  69. package/rulepacks/jetwc/jetwc-bootstrap.js +1 -1
  70. package/rulepacks/jetwc/jetwc-css-oj-complete.js +1 -1
  71. package/rulepacks/jetwc/jetwc-pack-children.js +1 -1
  72. package/rulepacks/jetwc/jetwc-schema.js +1 -1
  73. package/rulepacks/jetwc/jetwc-supproperty-propagation.js +6 -0
  74. package/rulepacks/jetwc/msgid.json +1 -1
  75. package/rulepacks/jetwc/rules.json +1 -1
  76. package/rulepacks/jetwc-lib/jetwcutils-componentFinder.js +1 -1
  77. package/rulepacks/jetwc-lib/jetwcutils-preCompiler.js +1 -1
  78. package/rulepacks/jetwco/jetwco-bootstrap.js +1 -1
  79. package/rulepacks/jetwco/jetwco-component-api-controlled-changes.js +1 -1
  80. package/rulepacks/jetwco/rules.json +1 -1
  81. package/rules/jaf/jaf-sys-age.js +6 -0
  82. package/rules/jaf/jaf-ts-walk.js +6 -0
  83. package/rules/jaf/msgid.json +1 -1
  84. package/rules/jaf/rules.json +1 -1
  85. package/rules/jet/helpers/extractStylesFromClass.js +1 -1
  86. package/rules/jet/msgid.json +1 -1
  87. package/rules/jet/oj-acc-aria-ojselector-labelledby.js +6 -0
  88. package/rules/jet/oj-acc-aria-prop.js +1 -1
  89. package/rules/jet/oj-c-acc-avatar-aria-role.js +6 -0
  90. package/rules/jet/oj-cca-compjson-bp-jetver.js +1 -1
  91. package/rules/jet/oj-css-style-override.js +1 -1
  92. package/rules/jet/oj-css-var-override.js +1 -1
  93. package/rules/jet/oj-html-alta-deprecated.js +1 -1
  94. package/rules/jet/oj-html-attr-2def.js +1 -1
  95. package/rules/jet/oj-html-attr-req.js +1 -1
  96. package/rules/jet/oj-html-cca-tagname.js +1 -1
  97. package/rules/jet/oj-html-cdn.js +1 -1
  98. package/rules/jet/oj-html-combo-converter.js +1 -1
  99. package/rules/jet/oj-html-file-pick-accept.js +1 -1
  100. package/rules/jet/oj-html-notag-style.js +1 -1
  101. package/rules/jet/oj-html-ojattr-deprecated.js +1 -1
  102. package/rules/jet/oj-html-ojattr-enum-deprecated.js +1 -1
  103. package/rules/jet/oj-html-ojattr-evt-syntax.js +1 -1
  104. package/rules/jet/oj-html-ojattr-value.js +1 -1
  105. package/rules/jet/oj-html-ojattr.js +1 -1
  106. package/rules/jet/oj-html-ojtag-deprecated.js +1 -1
  107. package/rules/jet/oj-html-pageopts-type.js +6 -0
  108. package/rules/jet/oj-html-rating-gauge-size.js +6 -0
  109. package/rules/jet/oj-html-redwood-bp-endslot.js +6 -0
  110. package/rules/jet/oj-html-slot-deprecated.js +6 -0
  111. package/rules/jet/oj-html-slot-pref-content.js +1 -1
  112. package/rules/jet/oj-html-wctag-maintenance.js +6 -0
  113. package/rules/jet/rules.json +1 -1
  114. package/schema/component-schema.json +1 -1482
  115. package/src/JafCore.js +1 -1
  116. package/types/index.d.ts +38 -9
  117. package/lib/colors.js +0 -6
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- {"title":"Oracle Internal Audit Rules for JET Custom Component Authors","prefix":"JETWCO","version":"1.12.1","rules":{"jetwco-bootstrap":{"group":"jetwco-do-not-disable","enabled":true,"severity":"info","debug":false,"diagnosticFile":"jetwco-diagnostics","componentRoot":"jet-composites","auditBuildOutput":false,"testMode":false,"$required":true},"jetwco-component-cdn":{"group":"jetwco-pre-release","severity":"major","filetype":["json"]},"jetwco-prerelease-cdn":{"group":"jetwco-pre-release","enabled":true,"cdnRoot":"https://static.oracle.com/cdn/","severity":"blocker","filetype":["json"]},"jetwco-thirdparty-ba":{"group":"jetwco-pre-release","enabled":true,"severity":"major","filetype":["json","tsx"]},"jetwco-license-info":{"group":"jetwco-pre-release","enabled":true,"severity":"blocker","filetype":["json","tsx"]},"jetwco-exchange-version-check":{"group":"jetwco-api","enabled":false,"severity":"info","filetype":["json","tsx"]},"jetwco-component-api-changes":{"group":"jetwco-api","enabled":false,"severity":"blocker","filetype":["json","tsx"],"clearCache":false},"jetwco-compjson-ns-reg":{"group":"jetwco-api","enabled":true,"severity":"major","filetype":["json","tsx"]},"jetwco-component-api-baseline-changes":{"group":"jetwco-api","enabled":false,"severity":"blocker","filetype":["json","tsx"],"baseline":{},"clearCache":false},"jetwco-displayname-standards":{"group":"jetwco-doc","enabled":true,"severity":"minor","filetype":["json","tsx"]},"jetwco-description-standards":{"group":"jetwco-doc","enabled":true,"severity":"minor","filetype":["json","tsx"]},"jetwco-component-api-controlled-changes":{"group":"jetwco-api","enabled":false,"severity":"blocker","filetype":["json","tsx"],"clearCache":false,"controls":{}}}}
6
+ {"title":"Oracle Internal Audit Rules for JET Custom Component Authors","prefix":"JETWCO","version":"1.13.2","rules":{"jetwco-bootstrap":{"group":"jetwco-do-not-disable","enabled":true,"severity":"info","debug":false,"diagnosticFile":"jetwco-diagnostics","auditBuildOutput":false,"testMode":false,"$required":true,"amd":false},"jetwco-component-cdn":{"group":"jetwco-pre-release","severity":"major","filetype":["json"],"amd":false},"jetwco-prerelease-cdn":{"group":"jetwco-pre-release","enabled":true,"cdnRoot":"https://static.oracle.com/cdn/","severity":"blocker","filetype":["json"],"amd":false},"jetwco-thirdparty-ba":{"group":"jetwco-pre-release","enabled":true,"severity":"major","filetype":["json","tsx"],"amd":false},"jetwco-license-info":{"group":"jetwco-pre-release","enabled":true,"severity":"blocker","filetype":["json","tsx"],"amd":false},"jetwco-exchange-version-check":{"group":"jetwco-api","enabled":false,"severity":"info","filetype":["json","tsx"],"amd":false},"jetwco-component-api-changes":{"group":"jetwco-api","enabled":false,"severity":"blocker","filetype":["json","tsx"],"clearCache":false,"amd":false},"jetwco-compjson-ns-reg":{"group":"jetwco-api","enabled":true,"severity":"major","filetype":["json","tsx"],"amd":false},"jetwco-component-api-baseline-changes":{"group":"jetwco-api","enabled":false,"severity":"blocker","filetype":["json","tsx"],"baseline":{},"clearCache":false,"amd":false},"jetwco-displayname-standards":{"group":"jetwco-doc","enabled":true,"severity":"minor","filetype":["json","tsx"],"amd":false},"jetwco-description-standards":{"group":"jetwco-doc","enabled":true,"severity":"minor","filetype":["json","tsx"],"amd":false},"jetwco-component-api-controlled-changes":{"group":"jetwco-api","enabled":false,"severity":"blocker","filetype":["json","tsx"],"clearCache":false,"controls":{},"ignorePackPrivate":false,"amd":false}}}
@@ -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 LONG="An 'old' version of JAF has been detected. The quoted number of JET public releases have "+"been published since this version of JAF was released, and it is recommened that the latest "+"version be downloaded to take advantage of the updates and fixes that have been applied.";const SHORT="The version of JAF used in now considered to be 'old', and the latest version is recommended.";function getName(){return"jaf-sys-age"};function getShortDescription(){return SHORT};function getDescription(){return LONG};module.exports={getName,getDescription,getShortDescription};
@@ -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
+ function getName(){return"jaf-ts-walk"};function getShortDescription(){return"Handle TypeScript walk exception"};function getDescription(){return"While processing TypeScript, an internal exception has occurred while walking the Abstract Syntax Tree."};module.exports={getName,getDescription,getShortDescription};
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- {"jaf-js-diagnose":"1000","jaf-ts-diagnose":"1005","jaf-css-diagnose":"1010","jaf-html-diagnose":"1020","jaf-init-schema":"2000","jaf-sys-startup":"9000"}
6
+ {"jaf-js-diagnose":"1000","jaf-ts-diagnose":"1005","jaf-ts-walk":"1007","jaf-css-diagnose":"1010","jaf-html-diagnose":"1020","jaf-init-schema":"2000","jaf-sys-age":"9100"}
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- {"title":"JAF System Rules","version":"1.1.0","prefix":"JAF","rules":{"jaf-js-diagnose":{"severity":"blocker","filetype":["js","html"],"group":["jaf-js"],"status":"production","$internal":true},"jaf-ts-diagnose":{"severity":"blocker","filetype":["ts"],"group":["jaf-ts"],"status":"production","$internal":true},"jaf-html-diagnose":{"severity":"minor","filetype":["html"],"group":["jet-html"],"status":"production","$internal":true},"jaf-css-diagnose":{"severity":"minor","filetype":["css","html"],"group":["jet-css"],"status":"production","$internal":true},"jaf-init-schema":{"severity":"major","filetype":["json"],"group":["jet-json"],"status":"production","$internal":true}}}
6
+ {"title":"JAF System Rules","version":"1.1.0","prefix":"JAF","rules":{"jaf-js-diagnose":{"severity":"blocker","filetype":["js","html"],"group":["jaf-js"],"status":"production","$internal":true},"jaf-ts-diagnose":{"severity":"blocker","filetype":["ts"],"group":["jaf-ts"],"status":"production","$internal":true},"jaf-ts-walk":{"severity":"blocker","filetype":["ts"],"group":["jaf-ts"],"status":"production","$internal":true},"jaf-html-diagnose":{"severity":"minor","filetype":["html"],"group":["jet-html"],"status":"production","$internal":true},"jaf-css-diagnose":{"severity":"minor","filetype":["css","html"],"group":["jet-css"],"status":"production","$internal":true},"jaf-init-schema":{"severity":"major","filetype":["json"],"group":["jet-json"],"status":"production","$internal":true},"jaf-sys-age":{"severity":"minor","group":["jaf-sys"],"status":"production","$internal":true}}}
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const OJPREFIX="oj-";module.exports=function(val){var classes,style,isExpr,i,j;isExpr=val.startsWith("[[")||val.startsWith("{{");val=_cleanStyle(val.toLowerCase());classes=val.split(" ");if(classes.length){for(i=0,j=0;i<classes.length;i++){style=classes[i].trim();if(style&&style.startsWith(OJPREFIX)){if(isExpr&&style.endsWith("-")){continue}classes[j++]=_cleanStyle(style.toLowerCase())}}classes.length=j}return classes};function _cleanStyle(style){return style.replace(/[\'\"\`\[\]\{\}\(\)\?\+:]/g,"").trim()};
6
+ const OJPREFIX="oj-";module.exports=function(val){var classes,style,isExpr,i,j;isExpr=val.startsWith("[[")||val.startsWith("{{");val=_cleanStyle(val.toLowerCase());classes=val.split(" ");if(classes.length){for(i=0,j=0;i<classes.length;i++){style=classes[i].trim();if(style&&style.startsWith(OJPREFIX)){if(isExpr&&style.endsWith("-")){continue}classes[j++]=_cleanStyle(style.toLowerCase())}}classes.length=j}return classes};function _cleanStyle(style){style=style.replace(/[\'\"\`\[\]\{\}\(\)\?\+]/g,"");return style.replace(/:/g," ").trim()};
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- {"oj-html-ojtag-deprecated":"0010","oj-html-ojtag-deprecated_1":"0011","oj-html-attr-json_1":"0020","oj-html-attr-json_2":"0021","oj-html-ojattr":"0040","oj-html-ojattr_1":"0041","oj-html-ojattr-520":"0040","oj-html-ojattr-value":"0060","oj-html-attr-2def":"0070","oj-html-attr-prefix-ro":"0073","oj-html-attr-prefix-expr":"0075","oj-html-attr-req":"0077","oj-html-ojattr-deprecated":"0080","oj-html-ojattr-deprecated_1":"0081","oj-html-ojattr-deprecated_2":"0082","oj-html-ojattr-deprecated_3":"0083","oj-html-ojattr-enum-deprecated":"0085","oj-html-ojevent":"0090","oj-html-jq-databind_1":"0100","oj-html-jq-databind_2":"0110","oj-html-jq-databind_3":"0120","oj-html-databind-all":"0130","oj-html-ojslot":"0140","oj-html-slot-name":"0150","oj-html-slot-pref-content":"0153","oj-html-slot-item-minmax":"0156","oj-html-slot-item-minmax_1":"0157","oj-html-binding-attr":"0160","oj-html-bindif-test":"0163","oj-html-bindforeach-data":"0165","oj-html-dlg-title":"0168","oj-html-attr-$unique_1":"0170","oj-html-attr-$unique_2":"0180","oj-html-tag-attr-noprefix":"0190","oj-html-label-for-prefix":"0195","oj-html-ojtag-globattr-noprefix":"0200","oj-html-ojtag-nonglobattr-prefix":"0210","oj-html-invalid-doctype":"0220","oj-html-invalid-doctype_1":"0221","oj-html-missing-doctype":"0230","oj-html-oj-lib":"0240","oj-html-ko-comment":"0250","oj-html-ko-databind":"0260","oj-html-cca-count":"0270","oj-html-cdn":"0280","oj-html-ojattr-evt-syntax":"0290","oj-html-ojtag-datacmd":"0310","oj-html-ojtag-datacmd_1":"0311","oj-html-ojtag-datacmd_2":"0312","oj-html-ojtag-datacmd_3":"0313","oj-html-ojtag-datactx":"0320","oj-html-wctag-id":"0330","oj-html-wctag-id_1":"0331","oj-html-wctag-id_2":"0332","oj-html-wctag-for":"0340","oj-html-wctag-arialabelledby":"0350","oj-html-wctag-$props":"0360","oj-html-wctag-$props_1":"0361","oj-html-form-bindif":"0370","oj-html-combo-converter":"0380","oj-html-ojtag-ns":"0385","oj-html-ojtag-ns_1":"0386","oj-html-ojtag-ns_2":"0387","oj-html-unsup-theme":"0390","oj-html-unsup-theme_1":"0391","oj-html-form-noflex":"0395","oj-html-5-tag-obs":"0400","oj-html-5-attr-obs_1":"0410","oj-html-5-attr-obs_2":"0411","oj-html-redwood-cssvars":"0420","oj-html-redwood-cssnovars":"0421","oj-html-template-index":"0425","oj-form-maxcols":"0430","oj-form-maxcols_1":"0431","oj-form-maxcols_2":"0432","oj-html-form-layout-maxcols":"0435","oj-html-file-pick-accept":"0450","oj-html-file-pick-accept_1":"0451","oj-html-file-pick-accept_2":"0452","oj-html-wctag-packprivate":"0465","oj-html-picker-attrs":"0470","oj-html-wctag-nested":"0480","oj-html-notag-style":"0490","oj-html-notag-style_1":"0491","oj-html-msgs-cat-text":"0495","oj-html-msgs-cat-text_1":"0496","oj-html-msgs-cat-text_2":"0497","oj-html-msgs-cat-text_3":"0498","oj-html-no-style-tag":"0505","oj-html-alta-deprecated":"0510","oj-acc-input-aria-label_1":"2000","oj-acc-input-aria-label_2":"2010","oj-acc-input-aria-label_3":"2020","oj-acc-input-aria-label_4":"2030","oj-acc-input-aria-label_5":"2031","oj-acc-input-aria-label_6":"2032","oj-acc-select-aria-label_1":"2040","oj-acc-select-aria-label_2":"2050","oj-acc-select-aria-label_3":"2060","oj-acc-select-aria-label_4":"2070","oj-acc-select-aria-label_5":"2071","oj-acc-select-aria-label_6":"2072","oj-acc-combobox-aria-label_1":"2080","oj-acc-combobox-aria-label_2":"2090","oj-acc-combobox-aria-label_3":"2100","oj-acc-combobox-aria-label_4":"2120","oj-acc-combobox-aria-label_5":"2121","oj-acc-combobox-aria-label_6":"2122","oj-acc-aria-labelledby":"2130","oj-acc-avatar-aria-role":"2140","oj-acc-film-strip-aria-label":"2150","oj-acc-aria-prop":"2160","oj-html-cca-tagname":"2200","oj-html-cca-tagname_1":"2201","oj-html-cspexpr":"2210","oj-html-cspexpr_1":"2211","oj-js-ojcomp-deprecated":"3000","oj-js-comp-meth-deprecated":"3020","oj-js-comp-meth-deprecated_1":"3022","oj-js-comp-meth-deprecated_2":"3023","oj-js-comp-attr-deprecated":"3025","oj-js-comp-attr-deprecated_1":"3026","oj-js-comp-attr-deprecated_2":"3027","oj-js-ojcomp-new":"3060","oj-js-ojcomp-exist":"3070","oj-js-ojcomp-exist_1":"3071","oj-js-var-undef":"3080","oj-js-var-undef_1":"3082","oj-js-poly-promise":"3090","oj-js-noconsole":"3100","oj-js-no-ext-final":"3200","oj-ts-ojcomp-deprecated":"3400","oj-ts-comp-meth-deprecated":"3420","oj-ts-comp-meth-deprecated_1":"3422","oj-ts-comp-meth-deprecated_2":"3423","oj-ts-comp-attr-deprecated":"3425","oj-ts-comp-attr-deprecated_1":"3426","oj-ts-comp-attr-deprecated_2":"3427","oj-ts-ojcomp-new":"3440","oj-ts-ojcomp-exist":"3445","oj-ts-ojcomp-exist_1":"3450","oj-ts-poly-promise":"3455","oj-ts-noconsole":"3460","oj-ts-no-ext-final":"3465","oj-json-syntax":"4000","oj-cca-comp-json-file":"9000","oj-cca-comp-json-schema":"9005","oj-cca-comp-json-compdeps":"9010","oj-cca-comp-zip":"9015","oj-cca-comp-zip-type":"9020","oj-cca-comp-zip-content":"9025","oj-cca-comp-zip-content-case":"9030","oj-cca-compjson-bp-obj":"9040","oj-cca-compjson-bp-ar":"9043","oj-cca-compjson-ns-reg":"9046","oj-cca-compjson-ns-reg_1":"9047","oj-cca-compjson-bp-jetver":"9049","oj-cca-compjson-bp-dsplyname":"9052","oj-html-style":"5000","oj-html-style_1":"5001","oj-html-style-deprecated":"5010","oj-html-ojstyle":"5015","oj-html-style-bp-color":"5020","oj-html-style-bp-font":"5025","oj-html-style-bp-display":"5030","oj-html-self-close":"5035","oj-html-style-bp-font-family":"5040","oj-html-style-abs-units":"5045","oj-html-style-abs-units_1":"5046","oj-html-style-abs-units_2":"5047","oj-html-stylesel":"5080","oj-html-stylesel_1":"5081","oj-html-stylesel_2":"5082","oj-html-stylesel_3":"5083","oj-html-stylesel_4":"5084","oj-html-stylesel_5":"5085","oj-html-stylesel_6":"5086","oj-html-stylesel_7":"5087","oj-html-input-isodate":"5095","oj-html-input-isodate_1":"5096","oj-html-input-isodate_2":"5097","oj-html-input-isodate_3":"5098","oj-html-input-isodate_4":"5099","oj-html-input-isodate_5":"5100","oj-html-input-isodate_6":"5101","oj-html-input-isodate_7":"5102","oj-html-input-isodate_8":"5103","oj-html-input-isodate_9":"5104","oj-css-style-override_1":"6010","oj-css-style-override_2":"6011","oj-css-style-bp-color":"6015","oj-css-style-deprecated":"6020","oj-css-style-bp-font":"6025","oj-css-style-bp-display":"6030","oj-css-style-bp-font-family":"6035","oj-css-style-abs-units":"6040","oj-css-style-abs-units_1":"6041","oj-css-bp-float":"6045","oj-css-bp-float_1":"6046","oj-css-bp-textalign":"6050","oj-css-bp-textalign_1":"6051","oj-css-bp-border-color":"6060","oj-css-bp-border-color_1":"6061","oj-css-var-override":"6065","oj-css-var-override_1":"6066","oj-css-bp-dir-flow":"6070"}
6
+ {"oj-html-ojtag-deprecated":"0010","oj-html-ojtag-deprecated_1":"0011","oj-html-wctag-maintenance":"0014","oj-html-attr-json_1":"0020","oj-html-attr-json_2":"0021","oj-html-ojattr":"0040","oj-html-ojattr_1":"0041","oj-html-ojattr-520":"0040","oj-html-ojattr-value":"0060","oj-html-attr-2def":"0070","oj-html-attr-prefix-ro":"0073","oj-html-attr-prefix-expr":"0075","oj-html-attr-req":"0077","oj-html-ojattr-deprecated":"0080","oj-html-ojattr-deprecated_1":"0081","oj-html-ojattr-deprecated_2":"0082","oj-html-ojattr-deprecated_3":"0083","oj-html-ojattr-enum-deprecated":"0085","oj-html-ojevent":"0090","oj-html-jq-databind_1":"0100","oj-html-jq-databind_2":"0110","oj-html-jq-databind_3":"0120","oj-html-databind-all":"0130","oj-html-ojslot":"0140","oj-html-slot-deprecated":"0145","oj-html-slot-name":"0150","oj-html-slot-pref-content":"0153","oj-html-slot-item-minmax":"0156","oj-html-slot-item-minmax_1":"0157","oj-html-binding-attr":"0160","oj-html-bindif-test":"0163","oj-html-bindforeach-data":"0165","oj-html-dlg-title":"0168","oj-html-attr-$unique_1":"0170","oj-html-attr-$unique_2":"0180","oj-html-tag-attr-noprefix":"0190","oj-html-label-for-prefix":"0195","oj-html-ojtag-globattr-noprefix":"0200","oj-html-ojtag-nonglobattr-prefix":"0210","oj-html-invalid-doctype":"0220","oj-html-invalid-doctype_1":"0221","oj-html-missing-doctype":"0230","oj-html-oj-lib":"0240","oj-html-ko-comment":"0250","oj-html-ko-databind":"0260","oj-html-cca-count":"0270","oj-html-cdn":"0280","oj-html-ojattr-evt-syntax":"0290","oj-html-ojtag-datacmd":"0310","oj-html-ojtag-datacmd_1":"0311","oj-html-ojtag-datacmd_2":"0312","oj-html-ojtag-datacmd_3":"0313","oj-html-ojtag-datactx":"0320","oj-html-wctag-id":"0330","oj-html-wctag-id_1":"0331","oj-html-wctag-id_2":"0332","oj-html-wctag-for":"0340","oj-html-wctag-arialabelledby":"0350","oj-html-wctag-$props":"0360","oj-html-wctag-$props_1":"0361","oj-html-form-bindif":"0370","oj-html-combo-converter":"0380","oj-html-ojtag-ns":"0385","oj-html-ojtag-ns_1":"0386","oj-html-ojtag-ns_2":"0387","oj-html-unsup-theme":"0390","oj-html-unsup-theme_1":"0391","oj-html-form-noflex":"0395","oj-html-5-tag-obs":"0400","oj-html-5-attr-obs_1":"0410","oj-html-5-attr-obs_2":"0411","oj-html-redwood-cssvars":"0420","oj-html-redwood-cssnovars":"0421","oj-html-redwood-bp-endslot":"0422","oj-html-template-index":"0425","oj-form-maxcols":"0430","oj-form-maxcols_1":"0431","oj-form-maxcols_2":"0432","oj-html-form-layout-maxcols":"0435","oj-html-file-pick-accept":"0450","oj-html-file-pick-accept_1":"0451","oj-html-file-pick-accept_2":"0452","oj-html-wctag-packprivate":"0465","oj-html-picker-attrs":"0470","oj-html-wctag-nested":"0480","oj-html-notag-style":"0490","oj-html-notag-style_1":"0491","oj-html-msgs-cat-text":"0495","oj-html-msgs-cat-text_1":"0496","oj-html-msgs-cat-text_2":"0497","oj-html-msgs-cat-text_3":"0498","oj-html-no-style-tag":"0505","oj-html-alta-deprecated":"0510","oj-html-rating-gauge-size":"0520","oj-acc-input-aria-label_1":"2000","oj-acc-input-aria-label_2":"2010","oj-acc-input-aria-label_3":"2020","oj-acc-input-aria-label_4":"2030","oj-acc-input-aria-label_5":"2031","oj-acc-input-aria-label_6":"2032","oj-acc-select-aria-label_1":"2040","oj-acc-select-aria-label_2":"2050","oj-acc-select-aria-label_3":"2060","oj-acc-select-aria-label_4":"2070","oj-acc-select-aria-label_5":"2071","oj-acc-select-aria-label_6":"2072","oj-acc-combobox-aria-label_1":"2080","oj-acc-combobox-aria-label_2":"2090","oj-acc-combobox-aria-label_3":"2100","oj-acc-combobox-aria-label_4":"2120","oj-acc-combobox-aria-label_5":"2121","oj-acc-combobox-aria-label_6":"2122","oj-acc-aria-labelledby":"2130","oj-acc-avatar-aria-role":"2140","oj-acc-film-strip-aria-label":"2150","oj-acc-aria-prop":"2160","oj-acc-aria-ojselector-labelledby":"2170","oj-html-cca-tagname":"2200","oj-html-cca-tagname_1":"2201","oj-html-cspexpr":"2210","oj-html-cspexpr_1":"2211","oj-c-acc-avatar-aria-role":"2500","oj-js-ojcomp-deprecated":"3000","oj-js-comp-meth-deprecated":"3020","oj-js-comp-meth-deprecated_1":"3022","oj-js-comp-meth-deprecated_2":"3023","oj-js-comp-attr-deprecated":"3025","oj-js-comp-attr-deprecated_1":"3026","oj-js-comp-attr-deprecated_2":"3027","oj-js-ojcomp-new":"3060","oj-js-ojcomp-exist":"3070","oj-js-ojcomp-exist_1":"3071","oj-js-var-undef":"3080","oj-js-var-undef_1":"3082","oj-js-poly-promise":"3090","oj-js-noconsole":"3100","oj-js-no-ext-final":"3200","oj-ts-ojcomp-deprecated":"3400","oj-ts-comp-meth-deprecated":"3420","oj-ts-comp-meth-deprecated_1":"3422","oj-ts-comp-meth-deprecated_2":"3423","oj-ts-comp-attr-deprecated":"3425","oj-ts-comp-attr-deprecated_1":"3426","oj-ts-comp-attr-deprecated_2":"3427","oj-ts-ojcomp-new":"3440","oj-ts-ojcomp-exist":"3445","oj-ts-ojcomp-exist_1":"3450","oj-ts-poly-promise":"3455","oj-ts-noconsole":"3460","oj-ts-no-ext-final":"3465","oj-json-syntax":"4000","oj-html-style":"5000","oj-html-style_1":"5001","oj-html-style-deprecated":"5010","oj-html-ojstyle":"5015","oj-html-style-bp-color":"5020","oj-html-style-bp-font":"5025","oj-html-style-bp-display":"5030","oj-html-self-close":"5035","oj-html-style-bp-font-family":"5040","oj-html-style-abs-units":"5045","oj-html-style-abs-units_1":"5046","oj-html-style-abs-units_2":"5047","oj-html-stylesel":"5080","oj-html-stylesel_1":"5081","oj-html-stylesel_2":"5082","oj-html-stylesel_3":"5083","oj-html-stylesel_4":"5084","oj-html-stylesel_5":"5085","oj-html-stylesel_6":"5086","oj-html-stylesel_7":"5087","oj-html-input-isodate":"5095","oj-html-input-isodate_1":"5096","oj-html-input-isodate_2":"5097","oj-html-input-isodate_3":"5098","oj-html-input-isodate_4":"5099","oj-html-input-isodate_5":"5100","oj-html-input-isodate_6":"5101","oj-html-input-isodate_7":"5102","oj-html-input-isodate_8":"5103","oj-html-input-isodate_9":"5104","oj-html-pageopts-type":"5110","oj-html-pageopts-type_2":"5111","oj-html-slot-deprecated_aged":"5800","oj-html-ojtag-deprecated_aged":"5805","oj-html-ojtag-deprecated_1_aged":"5806","oj-html-ojattr-deprecated_aged":"5810","oj-html-ojattr-deprecated_1_aged":"5811","oj-html-ojattr-deprecated_2_aged":"5812","oj-html-ojattr-deprecated_3_aged":"5813","oj-html-ojattr-enum-deprecated_aged":"5820","oj-html-alta-deprecated_aged":"5825","oj-css-style-override_1":"6010","oj-css-style-override_2":"6011","oj-css-style-bp-color":"6015","oj-css-style-deprecated":"6020","oj-css-style-bp-font":"6025","oj-css-style-bp-display":"6030","oj-css-style-bp-font-family":"6035","oj-css-style-abs-units":"6040","oj-css-style-abs-units_1":"6041","oj-css-bp-float":"6045","oj-css-bp-float_1":"6046","oj-css-bp-textalign":"6050","oj-css-bp-textalign_1":"6051","oj-css-bp-border-color":"6060","oj-css-bp-border-color_1":"6061","oj-css-var-override":"6065","oj-css-var-override_1":"6066","oj-css-bp-dir-flow":"6070","oj-cca-comp-json-file":"9000","oj-cca-comp-json-schema":"9005","oj-cca-comp-json-compdeps":"9010","oj-cca-comp-zip":"9015","oj-cca-comp-zip-type":"9020","oj-cca-comp-zip-content":"9025","oj-cca-comp-zip-content-case":"9030","oj-cca-compjson-bp-obj":"9040","oj-cca-compjson-bp-ar":"9043","oj-cca-compjson-ns-reg":"9046","oj-cca-compjson-ns-reg_1":"9047","oj-cca-compjson-bp-jetver":"9049","oj-cca-compjson-bp-dsplyname":"9052"}
@@ -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-acc-aria-ojselector-labelledby";const DESCRIPTION="As of JET 13.0.0, <oj-selector> no longer generates a default aria-labelledby attribute for a screen reader. "+"Applications must specify an aria-labelledby or aria-label attribute explicitly.";const SHORT_DESCRIPTION="Applications must specify an aria-labelledby/aria-label attribute explicitly on <oj-selector.";const ARIA_LABELLEDBY="aria-labelledby";const ARIA_LABEL="aria-label";const COLON=":";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-selector>":this._onOjSelector}}_onOjSelector(ruleCtx){var attrs,attr;attrs=ruleCtx.tagNode.attribs;for(attr in attrs){if(attr.charAt(0)===COLON){attr=attr.substring(1)}if(attr===ARIA_LABELLEDBY||attr===ARIA_LABEL){return}}let issue=new ruleCtx.Issue("Missing attribute 'aria-labelledby' on <oj-selector>");ruleCtx.reporter.addIssue(issue,ruleCtx)}}module.exports=Rule;
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-acc-aria-prop";const ARIA="aria-";const DESCRIPTION="Attributes beginning with <i>'aria-'</i> must be valid WAI-ARIA definitions.";const ARIA_LIST=["aria-atomic","aria-busy","aria-controls","aria-describedat","aria-describedby","aria-disabled","aria-dropeffect","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-labelledby","aria-live","aria-owns","aria-relevant","aria-autocomplete","aria-checked","aria-disabled","aria-expanded","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-level","aria-multiline","aria-multiselectable","aria-orientation","aria-pressed","aria-readonly","aria-required","aria-selected","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","aria-dropeffect","aria-grabbed","aria-activedescendant","aria-flowto","aria-posinset","aria-setsize"];function getName(){return RULE_NAME};function getShortDescription(){return"'aria' attribute must be a valid WAI-ARIA definition."};function getDescription(){return DESCRIPTION};function register(){return{"elem":_handle}};function _handle(ruleCtx){var attribs,attrib,attrPos,issue;attribs=ruleCtx.tagNode.attribs;if(attribs){for(attrib in attribs){if(attrib.startsWith(ARIA)&&!ARIA_LIST.includes(attrib)){issue=new ruleCtx.Issue("<"+ruleCtx.tagNode.name+"> '"+attrib+"' is not a valid WAI-ARIA definition");attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-acc-aria-prop";const DESCRIPTION="Attributes beginning with <i>'aria-'</i> must be valid WAI-ARIA definitions.";const ARIA="aria-";const ARIA_LIST=["aria-atomic","aria-busy","aria-controls","aria-describedat","aria-describedby","aria-disabled","aria-dropeffect","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-labelledby","aria-live","aria-owns","aria-relevant","aria-autocomplete","aria-checked","aria-disabled","aria-expanded","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-level","aria-multiline","aria-multiselectable","aria-orientation","aria-pressed","aria-readonly","aria-required","aria-selected","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","aria-dropeffect","aria-grabbed","aria-activedescendant","aria-flowto","aria-posinset","aria-setsize"];function getName(){return RULE_NAME};function getShortDescription(){return DESCRIPTION};function getDescription(){return DESCRIPTION};function register(){return{"elem":_onElem}};function _onElem(ruleCtx){var attribs,attrib,attrPos,issue;attribs=ruleCtx.tagNode.attribs;if(attribs){for(attrib in attribs){if(attrib.startsWith(ARIA)&&!ARIA_LIST.includes(attrib)){issue=new ruleCtx.Issue("<"+ruleCtx.tagNode.name+"> '"+attrib+"' is not a valid WAI-ARIA definition");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};
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="oj-c-acc-avatar-aria-role";const SHORT="The 'role' attribute should not be set on &lt;oj-c-avatar&gt;";const LONG="The <i>role</i> attribute should never be set on &lt;oj-c-avatar&gt;. If the component needs to be accessible, "+"set the <i>'aria-label'</i> or </i>'aria-labelledby'</i> attribute and &lt;oj-c-avatar&gt; will internally set "+"<i>role='img'</i>. Otherwise, no <i>role</i> attribute is needed.";const ROLE="role";function getName(){return RULE_NAME}function getShortDescription(){return SHORT}function getDescription(){return LONG}function register(){return{"<oj-c-avatar>":_onTag}}function _onTag(ruleCtx){var DomUtils=ruleCtx.utils.DomUtils;if(DomUtils.hasAttrib(ruleCtx.node,ROLE)){let issue=new ruleCtx.Issue("'role' attribute should not be specified on <oj-c-avatar>");let attrPos=DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,"role");issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}module.exports={getName,getDescription,getShortDescription,register};
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const helperPos=require("./helpers/json-propname-pos");const RULE_NAME="oj-cca-compjson-bp-jetver";const SHORT="Best practices for component.json property 'jetVersion'";const LONG="Best Practices for component.json metadata:<br>"+"The 'jetVersion' semver range should be capped. That is, not an open-ended 'jetVersion' "+"property - e.g. '>=7.20'<br>"+"The 'jetVersion' should generally represent some degree of range and not be "+"hard-coded to just one version of JET - e.g. '7.2.0'.<br>"+"The 'jetVersion' semver range in the component metadata should match/include the JAF configuration 'jetVer'.<br>"+"It is recommended that custom component owners re-certify their components at MAJOR version boundaries of JET, and update their metadata accordingly.";function Rule(){this._jetvers=null}Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return LONG};Rule.prototype.register=function(){return{"compjson-composite":this._handle,"compjson-pack":this._handle}};Rule.prototype._handle=function(ruleCtx,obj){var jetver,o,x,actual,keys,keysLC=[],pos,issue,bad;o=obj&&obj.obj;if(!o){return}keys=Object.keys(o);keys.forEach(function(s){keysLC.push(s.toLowerCase())});x=keysLC.indexOf("jetversion");if(x>=0){jetver=o[keys[x]];actual=keys[x]}if(!jetver){issue=new ruleCtx.Issue("'jetVersion' property is missing");issue.setSeverity("blocker");issue.setPosition(0,0,0,0);ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(!ruleCtx.rulePack.isRuleEnabled("oj-cca-compjson-prop-types","EXCH")){if(typeof jetver!=="string"){issue=new ruleCtx.Issue("'jetVersion' property '"+jetver+"' is not a valid range or semver");issue.setSeverity("blocker");pos=helperPos(ruleCtx,actual);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+9:0);ruleCtx.reporter.addIssue(issue,ruleCtx);return}}bad=typeof jetver!=="string";if(bad||!ruleCtx.utils.semVerUtils.isValidRange(jetver)){if(bad&&ruleCtx.rulePack.isRuleEnabled("oj-cca-compjson-prop-types","EXCH")){return}issue=new ruleCtx.Issue("'jetVersion' property '"+jetver+"' is not a valid range or semver");issue.setSeverity("blocker");pos=helperPos(ruleCtx,actual);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+9:0);ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(!_isPossibleRange(jetver)){issue=new ruleCtx.Issue("'jetVersion' semver property '"+jetver+"' should not be absolute");issue.setSeverity("minor");pos=helperPos(ruleCtx,actual);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+9:0);ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(_isOpenEndedRange(jetver)){issue=new ruleCtx.Issue("'jetVersion' semver property '"+jetver+"' should not be open-ended - best practices");pos=helperPos(ruleCtx,actual);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+9:0);ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(!this._isMatchVersions(ruleCtx,jetver)){issue=new ruleCtx.Issue("'jetVersion' semver property '"+jetver+"' does not match any supported JET versions");pos=helperPos(ruleCtx,actual);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+9:0);ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(ruleCtx.utils.semVerUtils.match(jetver)){return true}{issue=new ruleCtx.Issue("'jetVersion' semver property '"+jetver+"' does not match audit run JET version '"+ruleCtx.utils.semVerUtils.getReference()+"'");pos=helperPos(ruleCtx,actual);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+9:0);ruleCtx.reporter.addIssue(issue,ruleCtx);return}};function _isPossibleRange(ver){const initRange=["^",">","<","=","~"];const intraRange=["-",">","<"];var s,ret=false;s=ver.charAt(0);if(initRange.includes(s)||intraRange.includes(s)||ver.indexOf("-")>3){ret=true}return ret};function _isOpenEndedRange(ver){var ret=false;const openChars=[">"];if(openChars.includes(ver.charAt(0))){if(ver.indexOf("-")<0&&ver.indexOf("<")<0){ret=true}}return ret};Rule.prototype._isMatchVersions=function(ruleCtx,jetver){var ver;if(!this._jetvers){this._jetvers=ruleCtx.utils.metaLib.getMetaVers();this._jetvers=this._jetvers.versions}for(ver in this._jetvers){if(ruleCtx.utils.semVerUtils.satisfiesRange(ver,jetver)){return true}}return false};module.exports=Rule;
6
+ const helperPos=require("./helpers/json-propname-pos");const RULE_NAME="oj-cca-compjson-bp-jetver";const SHORT="Best practices for component.json property 'jetVersion'";const LONG="Best Practices for component.json metadata:<br>"+"The 'jetVersion' semver range should be capped. That is, not an open-ended 'jetVersion' "+"property - e.g. '>=7.20'<br>"+"The 'jetVersion' should generally represent some degree of range and not be "+"hard-coded to just one version of JET - e.g. '7.2.0'.<br>"+"The 'jetVersion' semver range in the component metadata should match/include the JAF configuration 'jetVer'.<br>"+"It is recommended that custom component owners re-certify their components at MAJOR version boundaries of JET, "+"and update their metadata accordingly.";function Rule(){this._jetvers=null}Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return LONG};Rule.prototype.register=function(){return{"compjson-composite":this._handle,"compjson-pack":this._handle}};Rule.prototype._handle=function(ruleCtx,obj){var jetver,o,x,actual,keys,keysLC=[],bad;o=obj&&obj.obj;if(!o){return}keys=Object.keys(o);keys.forEach(function(s){keysLC.push(s.toLowerCase())});x=keysLC.indexOf("jetversion");if(x>=0){jetver=o[keys[x]];actual=keys[x]}if(!jetver){if(ruleCtx.type!=="compjson-pack"){let issue=new ruleCtx.Issue("'jetVersion' property is missing");issue.setSeverity("blocker");issue.setPosition(0,0,0,0);ruleCtx.reporter.addIssue(issue,ruleCtx)}return}if(typeof jetver!=="string"){_emitIssue(ruleCtx,`'jetVersion' property '${jetver}' is not a valid range or semver`,"blocker",actual);return}bad=typeof jetver!=="string";if(bad||!ruleCtx.utils.semVerUtils.isValidRange(jetver)){_emitIssue(ruleCtx,`'jetVersion' property '${jetver}' is not a valid range or semver`,"blocker",actual);return}if(!_isPossibleRange(jetver)){_emitIssue(ruleCtx,`'jetVersion' semver property '${jetver}' should not be absolute`,"minor",actual);return}if(_isOpenEndedRange(jetver)){_emitIssue(ruleCtx,`'jetVersion' semver property '${jetver}' should not be open-ended - best practices`,null,actual);return}if(!this._isMatchVersions(ruleCtx,jetver)){_emitIssue(ruleCtx,`'jetVersion' semver property '${jetver}' does not match any supported JET versions`,null,actual);return}if(ruleCtx.utils.semVerUtils.match(jetver)){return true}{_emitIssue(ruleCtx,`'jetVersion' semver property '${jetver}' does not match audit run JET version '${ruleCtx.utils.semVerUtils.getReference()}'`,null,actual);return}};function _emitIssue(ruleCtx,msg,sev,actual){var issue=new ruleCtx.Issue(msg);if(sev){issue.setSeverity(sev)}if(actual){let pos=helperPos(ruleCtx,actual);issue.setPosition(pos.row,pos.col,pos.index,pos.index?pos.index+9:0)}ruleCtx.reporter.addIssue(issue,ruleCtx)};function _isPossibleRange(ver){const initRange=["^",">","<","=","~"];const intraRange=["-",">","<"];var s,ret=false;s=ver.charAt(0);if(initRange.includes(s)||intraRange.includes(s)||ver.indexOf("-")>3){ret=true}return ret};function _isOpenEndedRange(ver){var ret=false;const openChars=[">"];if(openChars.includes(ver.charAt(0))){if(ver.indexOf("-")<0&&ver.indexOf("<")<0){ret=true}}return ret};Rule.prototype._isMatchVersions=function(ruleCtx,jetver){var ver;if(!this._jetvers){this._jetvers=ruleCtx.utils.metaLib.getMetaVers();this._jetvers=this._jetvers.versions}for(ver in this._jetvers){if(ruleCtx.utils.semVerUtils.satisfiesRange(ver,jetver)){return true}}return false};module.exports=Rule;
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-css-style-override";const SHORT_DESCRIPT="JET CSS style classes should not be overridden";const DESCRIPT=SHORT_DESCRIPT;const SELECTOR_LIST="SelectorList";const CLASS_SELECTOR="ClassSelector";const TYPE_SELECTOR="TypeSelector";const PSEUDO_CLASS_SELECTOR="PseudoClassSelector";const NUMBER="number";const STRING="string";const NOT_CLASSES=["oj-complete"];const OVERRIDE_LIST=["oj-buttonset-one","oj-buttonset-many","oj-color-invert","oj-badge-sm","oj-navigationlist-vertical","oj-navigationlist-horizontal","oj-navigationlist-icon-only","oj-navigationlist-stack-icon-label","oj-input-search-hero","oj-avatar-bg-purple","oj-avatar-bg-orange","oj-avatar-bg-teal","oj-avatar-bg-green","oj-avatar-bg-pink","oj-avatar-bg-slate","oj-avatar-bg-blue","oj-avatar-bg-lilac","oj-avatar-bg-gray","oj-avatar-xxs","oj-avatar-xs","oj-avatar-sm","oj-avatar-lg","oj-avatar-xl","oj-avatar-xxl","oj-tabbar-vertical","oj-tabbar-horizontal","oj-tabbar-icon-only","oj-tabbar-stack-icon-label","oj-invalid-drop"];const OVERRIDE_LIST_PREFIX=["oj-animate-inline-"];const NO_OVERRIDE=["oj-removable"];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._checkAcceptRejectOption(regCtx)){return false}this._metaLib=regCtx.utils.metaLib;if(!this._metaLib.hasJetStylePrefixes()){return false}return{"css-rule":this._onRule}};Rule.prototype._onRule=function(ruleCtx,rule){var sels,sel,t,i;sels=this._getOjSelectors(rule,this._metaLib);if(!sels.length){return}for(i=0;i<sels.length;i+=3){sel=sels[i];t=sels[i+1];if(_isBuiltinOverride(sel)){continue}if(this._checkList&&this._isSelAccepted(sel)){this._emitIssue(ruleCtx,t,sel,sels[i+2])}else if(t===CLASS_SELECTOR||t===TYPE_SELECTOR&&this._metaLib.isJetTag(sel)){this._emitIssue(ruleCtx,t,sel,sels[i+2])}};};Rule.prototype._emitIssue=function(ruleCtx,type,sel,loc){var tag,issue;if(type===TYPE_SELECTOR){issue=new ruleCtx.Issue(`type Selector '${sel}' must not be overridden.`);issue.setMsgKey(ruleCtx.ruleName+"_2")}else{tag=ruleCtx.utils.metaLib.getJetTagFromStyle(sel);issue=new ruleCtx.Issue(`class selector '.${sel}' ${tag?"(for <"+tag+">) ":""}must not be overridden.`);issue.setMsgKey(ruleCtx.ruleName+"_1")}issue.setPosition(ruleCtx.utils.CssUtils.getPosition(ruleCtx,loc));ruleCtx.reporter.addIssue(issue,ruleCtx)};Rule.prototype._getOjSelectors=function(rule){var sels,sel,a,c,i,j,ret=[];if(!(rule.prelude&&rule.prelude.children)||rule.prelude.type!=="SelectorList"){return ret}a=rule.prelude.children;for(i=0;i<a.length;i++){sels=a[i];if(sels.type==="Selector"){c=sels.children;for(j=0;j<c.length;j++){sel=c[j];if(sel.type===CLASS_SELECTOR&&(this._metaLib.isJetStylePrefix(sel.name)||NO_OVERRIDE.includes(sel.name))||sel.type===TYPE_SELECTOR&&this._metaLib.isJetTag(sel.name)){ret.push(sel.name);ret.push(sel.type);ret.push(sel.loc)}else if(sel.type===PSEUDO_CLASS_SELECTOR){this._evalPseudoClassSelector(sel,ret,sel.name)}}}}return ret};Rule.prototype._evalPseudoClassSelector=function(sel,a,pseudo){var c,o,l,e,i,j;if(!(c=sel.children)){return}for(i=0;i<c.length;i++){o=c[i];if(o.type==="Selector"){if(l=o.children){for(j=0;j<l.length;j++){e=l[j];if(e.type===CLASS_SELECTOR&&this._metaLib.isJetStylePrefix(e.name)||e.type===TYPE_SELECTOR&&this._metaLib.isJetTag(e.name)){if(!_checkNotClasses(e.name)){a.push(e.name);a.push(e.type);a.push(e.loc)}}}}continue}else{if(o.type!==SELECTOR_LIST){continue}}this._evalPseudoClassSelector(o,a,pseudo)}};Rule.prototype._isSelAccepted=function(sel){if(this._checkList){for(let i=0;i<this._checkList.length;i++){if(this._checkList[i].test(sel)){return this._isAccept}}return!this._isAccept}return true};Rule.prototype._checkAcceptRejectOption=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}: override 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){if(!(this._checkList[i]=this._makeRegExp(regCtx,this._checkList[i].trim(),i))){return false}}}}return true};Rule.prototype._makeRegExp=function(ruleCtx,s,x){var re;try{re=new RegExp(s.trim())}catch(e){re=null}if(!re){var s=typeof x===NUMBER?`element ${x} `:"";ruleCtx.utils.msgLib.error(`Rule ${RULE_NAME}: in override option '${this._isAccept?"accept":"reject"}' element ${x} is not a valid regular expression`)}return re};function _isBuiltinOverride(sel){if(OVERRIDE_LIST.includes(sel)){return true}for(let i=0;i<OVERRIDE_LIST_PREFIX.length;i++){if(sel.startsWith(OVERRIDE_LIST_PREFIX[i])){return true}}return false};function _checkNotClasses(name){return NOT_CLASSES.includes(name)};module.exports=Rule;
6
+ const RULE_NAME="oj-css-style-override";const SHORT_DESCRIPT="JET CSS style classes should not be overridden";const DESCRIPT=SHORT_DESCRIPT;const SELECTOR_LIST="SelectorList";const CLASS_SELECTOR="ClassSelector";const TYPE_SELECTOR="TypeSelector";const PSEUDO_CLASS_SELECTOR="PseudoClassSelector";const NUMBER="number";const STRING="string";const NOT_CLASSES=["oj-complete"];const OVERRIDE_LIST=["oj-buttonset-one","oj-buttonset-many","oj-color-invert","oj-badge-sm","oj-navigationlist-vertical","oj-navigationlist-horizontal","oj-navigationlist-icon-only","oj-navigationlist-stack-icon-label","oj-input-search-hero","oj-avatar-bg-purple","oj-avatar-bg-orange","oj-avatar-bg-teal","oj-avatar-bg-green","oj-avatar-bg-pink","oj-avatar-bg-slate","oj-avatar-bg-blue","oj-avatar-bg-lilac","oj-avatar-bg-gray","oj-avatar-xxs","oj-avatar-xs","oj-avatar-sm","oj-avatar-lg","oj-avatar-xl","oj-avatar-xxl","oj-tabbar-vertical","oj-tabbar-horizontal","oj-tabbar-icon-only","oj-tabbar-stack-icon-label","oj-invalid-drop"];const OVERRIDE_LIST_PREFIX=["oj-animate-inline-"];const NO_OVERRIDE=["oj-removable"];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._checkAcceptRejectOption(regCtx)){return false}this._metaLib=regCtx.utils.metaLib;if(!this._metaLib.hasJetStylePrefixes()){return false}return{"css-rule":this._onRule}};Rule.prototype._onRule=function(ruleCtx,rule){var sels,sel,emit,t,i;sels=this._getOjSelectors(rule,this._metaLib);if(!sels.length){return}for(i=0;i<sels.length;i+=3){sel=sels[i];t=sels[i+1];if(_isBuiltinOverride(sel)){continue}emit=false;if(this._checkList){if(this._isSelAccepted(sel)){emit=true}}else if(t===CLASS_SELECTOR||t===TYPE_SELECTOR&&this._metaLib.isJetTag(sel)){emit=true}if(emit){this._emitIssue(ruleCtx,t,sel,sels[i+2])}};};Rule.prototype._emitIssue=function(ruleCtx,type,sel,loc){var tag,issue;if(type===TYPE_SELECTOR){issue=new ruleCtx.Issue(`type Selector '${sel}' must not be overridden.`);issue.setMsgKey(ruleCtx.ruleName+"_2")}else{tag=ruleCtx.utils.metaLib.getJetTagFromStyle(sel);issue=new ruleCtx.Issue(`class selector '.${sel}' ${tag?"(for <"+tag+">) ":""}must not be overridden.`);issue.setMsgKey(ruleCtx.ruleName+"_1")}issue.setPosition(ruleCtx.utils.CssUtils.getPosition(ruleCtx,loc));ruleCtx.reporter.addIssue(issue,ruleCtx)};Rule.prototype._getOjSelectors=function(rule){var sels,sel,a,c,i,j,ret=[];if(!(rule.prelude&&rule.prelude.children)||rule.prelude.type!=="SelectorList"){return ret}a=rule.prelude.children;for(i=0;i<a.length;i++){sels=a[i];if(sels.type==="Selector"){c=sels.children;for(j=0;j<c.length;j++){sel=c[j];if(sel.type===CLASS_SELECTOR&&(this._metaLib.isJetStylePrefix(sel.name)||NO_OVERRIDE.includes(sel.name))||sel.type===TYPE_SELECTOR&&this._metaLib.isJetTag(sel.name)){ret.push(sel.name);ret.push(sel.type);ret.push(sel.loc)}else if(sel.type===PSEUDO_CLASS_SELECTOR){this._evalPseudoClassSelector(sel,ret,sel.name)}}}}return ret};Rule.prototype._evalPseudoClassSelector=function(sel,a,pseudo){var c,o,l,e,i,j;if(!(c=sel.children)){return}for(i=0;i<c.length;i++){o=c[i];if(o.type==="Selector"){if(l=o.children){for(j=0;j<l.length;j++){e=l[j];if(e.type===CLASS_SELECTOR&&this._metaLib.isJetStylePrefix(e.name)||e.type===TYPE_SELECTOR&&this._metaLib.isJetTag(e.name)){if(!_checkNotClasses(e.name)){a.push(e.name);a.push(e.type);a.push(e.loc)}}}}continue}else{if(o.type!==SELECTOR_LIST){continue}}this._evalPseudoClassSelector(o,a,pseudo)}};Rule.prototype._isSelAccepted=function(sel){if(this._checkList){for(let i=0;i<this._checkList.length;i++){if(this._checkList[i].test(sel)){return this._isAccept}}return!this._isAccept}return true};Rule.prototype._checkAcceptRejectOption=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}: override 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){if(!(this._checkList[i]=this._makeRegExp(regCtx,this._checkList[i].trim(),i))){return false}}}}return true};Rule.prototype._makeRegExp=function(ruleCtx,s,x){var re;try{re=new RegExp(s.trim())}catch(e){re=null}if(!re){var s=typeof x===NUMBER?`element ${x} `:"";ruleCtx.utils.msgLib.error(`Rule ${RULE_NAME}: in override option '${this._isAccept?"accept":"reject"}' element ${x} is not a valid regular expression`)}return re};function _isBuiltinOverride(sel){if(OVERRIDE_LIST.includes(sel)){return true}for(let i=0;i<OVERRIDE_LIST_PREFIX.length;i++){if(sel.startsWith(OVERRIDE_LIST_PREFIX[i])){return true}}return false};function _checkNotClasses(name){return NOT_CLASSES.includes(name)};module.exports=Rule;
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULENAME="oj-css-var-override";const DESCRIPTION="CSS Vars may be available for use on the client, but they cannot be overriden in this project.";const SHORT_DESCRIPTION="CSS Vars may be available for use on the client, but they cannot be overriden in this project.";const DECLARATION="Declaration";const VAR_PREFIX="--";const COLON=":";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){if(!this._checkRuleOptions(regCtx)){return false}return{"css-rule":this._onRule,"style":this._onStyle}}_onRule(ruleCtx,rule){var block,decl,issue,i;if(!(rule.prelude&&rule.prelude.children&&rule.prelude.children.length)){return}block=rule.block.children;for(i=0;i<block.length;i++){decl=block[i];if(decl.type===DECLARATION&&decl.property.startsWith(VAR_PREFIX)){if(this._okProp(decl)){issue=new ruleCtx.Issue(`CSS var '${decl.property}' should not be overridden`);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}_onStyle(ruleCtx,attr,attrVal){var csv,issue,i,x;for(i=0;i<attrVal.length;i++){csv=attrVal[i];if(csv.startsWith(VAR_PREFIX)){x=csv.indexOf(COLON);if(x>0){csv=csv.substring(2,x).trimRight();issue=new ruleCtx.Issue(`CSS var '${csv}' in 'style' attribute should not be overridden`);issue.setMsgKey(RULENAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}_okProp(decl){var cvar,list,i;cvar=decl.property;list=this._ignore||this._accept;if(!list){return true}for(i=0;i<list.length;i++){if(list[i].test(cvar)){return!!this._accept}}return!!this._accept}_checkRuleOptions(regCtx){var cvars,accept,ign,b;cvars=regCtx.ruleOpts["vars"];if(cvars){if(!regCtx.utils.utils.isObject(cvars)){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} : option 'vars' is not an object`);this._fail=true;return false}accept=cvars.accept;ign=cvars.ignore;if(accept&&ign){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} : option 'vars' - sub-properties 'accept' and 'ignore are mutually exclusive`);b=true}if(!b){if(accept){this._accept=this._getOptionVars(regCtx,"accept",accept)}else if(ign){this._ignore=this._getOptionVars(regCtx,"ignore",ign)}}}return this._fail?false:!b}_getOptionVars(regCtx,prop,val){var i;if(typeof val==="string"){val=[val]}else if(!Array.isArray(val)){return null}for(i=0;i<val.length;i++){if(typeof val[i]==="string"){try{val[i]=new RegExp(val[i])}catch(e){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} '${prop}' : invalid reg. expression '${val[i]}' at position ${i}`);this._fail=true}}}return this._fail?null:val}}module.exports=Rule;
6
+ const RULENAME="oj-css-var-override";const DESCRIPTION="CSS Vars may be available for use on the client, but they cannot be overriden in this project.";const SHORT_DESCRIPTION="CSS Vars may be available for use on the client, but they cannot be overriden in this project.";const DECLARATION="Declaration";const VAR_PREFIX="--";const COLON=":";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){if(!this._checkRuleOptions(regCtx)){return false}return{"css-rule":this._onRule,"style":this._onStyle}}_onRule(ruleCtx,rule){var block,decl,issue,i;if(!(rule.prelude&&rule.prelude.children&&rule.prelude.children.length)){return}block=rule.block.children;for(i=0;i<block.length;i++){decl=block[i];if(decl.type===DECLARATION&&decl.property.startsWith(VAR_PREFIX)){if(this._okProp(decl)){issue=new ruleCtx.Issue(`CSS var '${decl.property}' should not be overridden`);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}_onStyle(ruleCtx,attr,attrVal){var csv,issue,i,x;for(i=0;i<attrVal.length;i++){csv=attrVal[i];if(csv.startsWith(VAR_PREFIX)){x=csv.indexOf(COLON);if(x>0){csv=csv.substring(2,x).trimRight();issue=new ruleCtx.Issue(`CSS var '${csv}' in 'style' attribute should not be overridden`);issue.setMsgKey(RULENAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}_okProp(decl){var cvar,list,i;cvar=decl.property.substring(2);list=this._ignore||this._accept;if(!list){return true}for(i=0;i<list.length;i++){if(list[i].test(cvar)){return!!this._accept}}return this._accept?false:true}_checkRuleOptions(regCtx){var cvars,accept,ign,b;cvars=regCtx.ruleOpts["vars"];if(cvars){if(!regCtx.utils.utils.isObject(cvars)){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} : option 'vars' is not an object`);this._fail=true;return false}accept=cvars.accept;ign=cvars.ignore;if(accept&&ign){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} : option 'vars' - sub-properties 'accept' and 'ignore are mutually exclusive`);b=true}if(!b){if(accept){this._accept=this._getOptionVars(regCtx,"accept",accept)}else if(ign){this._ignore=this._getOptionVars(regCtx,"ignore",ign)}}}return this._fail?false:!b}_getOptionVars(regCtx,prop,val){var i;if(typeof val==="string"){val=[val]}else if(!Array.isArray(val)){return null}for(i=0;i<val.length;i++){if(typeof val[i]==="string"){try{val[i]=new RegExp(val[i])}catch(e){regCtx.utils.msgLib.error(`Rule ${regCtx.ruleName} '${prop}' : invalid reg. expression '${val[i]}' at position ${i}`);this._fail=true}}}return this._fail?null:val}}module.exports=Rule;
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULENAME="oj-html-alta-deprecated";const DESCRIPTION="Starting from JET 10, the Alta theme is deprecated and and use of this theme, or of "+"a custom theme such as the ApplicationsCloudUI theme, which extends it, should be "+"replaced with either the Redwood theme or a custom theme that extends the Redwood "+"theme or the Stable theme. The Alta theme will be removed all together in JET 13 "+"and must be replaced before then.";const SHORT_DESCRIPTION="Detect the use of the deprecated Alta theme";const RE_ALTA_MIN=/.*\/alta\/(oj-alta-min.css|oj-alta.css)/;const RE_APP_CLOUD=/.*\/web\/ApplicationsCloudUI.css/;const RE_INJECT_THEME=/\s*vb:inject\s.*theme="[a-zA-Z0-9\.\/]*ApplicationsCloudUI.css"/;const RE_INJECT=/\s*vb:inject id="headContent"\s*/;const STYLESHEET="stylesheet";const VER_12_0_0="12.0.0";const CRITICAL="critical";const HREF="href";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){let jetVer=regCtx.utils.metaLib.getMetaVers().runver;let semver=regCtx.utils.semVerUtils;this._jetVerGte12=semver.gte(jetVer,VER_12_0_0);return{link:this._onLink,comment:this._onComment}}_onLink(ruleCtx){var href;if(!_isStyleSheetLink(ruleCtx)||!(href=ruleCtx.tagNode.attribs.href)){return}if(RE_ALTA_MIN.test(href)||RE_APP_CLOUD.test(href)){this._emitIssue(ruleCtx,1)}}_onComment(ruleCtx,comment){var emit,stack;if((stack=ruleCtx.elemStack)&&stack.length){stack=stack[stack.length-1];if(stack.type==="tag"&&stack.name==="head"){if(!(emit=RE_INJECT_THEME.test(comment))){if(RE_INJECT.test(comment)){emit=comment.indexOf(" theme=")<0}}if(emit){this._emitIssue(ruleCtx,2,comment)}}}}_emitIssue(ruleCtx,type,comment){var issue,msg,node;msg=type===1?"Stylesheet <link> refers to deprecated Alta theme or a theme that extends it":"vb:inject theme : Alta theme is deprecated";issue=new ruleCtx.Issue(msg);if(type===1){issue.setPosition(ruleCtx.utils.DomUtils.getAttrValuePosition(ruleCtx.data,ruleCtx.node,HREF))}else{node=ruleCtx.node;let x=comment.indexOf("theme=");if(x>=0){x+=node.startIndex;issue.setPosition(null,null,node.startIndex+5,node.endIndex)}else{issue.setPosition(null,null,node.startIndex,node.endIndex)}}if(this._jetVerGte12){issue.setSeverity(CRITICAL)}ruleCtx.reporter.addIssue(issue,ruleCtx)}}function _isStyleSheetLink(ruleCtx){var attribs,ret;if(attribs=ruleCtx.tagNode.attribs){ret=attribs.rel===STYLESHEET}return ret?ret:false}module.exports=Rule;
6
+ const RULENAME="oj-html-alta-deprecated";const DESCRIPTION="Starting from JET 10, the Alta theme is deprecated and and use of this theme, or of "+"a custom theme such as the ApplicationsCloudUI theme, which extends it, should be "+"replaced with either the Redwood theme or a custom theme that extends the Redwood "+"theme or the Stable theme. The Alta theme will be removed all together in JET 13 "+"and must be replaced before then.";const SHORT_DESCRIPTION="Detect the use of the deprecated Alta theme";const RE_ALTA_MIN=/.*\/alta\/(oj-alta-min.css|oj-alta.css)/;const RE_APP_CLOUD=/.*\/web\/ApplicationsCloudUI.css/;const RE_INJECT_THEME=/\s*vb:inject\s.*theme="[a-zA-Z0-9\.\/]*ApplicationsCloudUI.css"/;const RE_INJECT=/\s*vb:inject id="headContent"\s*/;const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";const STYLESHEET="stylesheet";const VER_12_0_0="12.0.0";const CRITICAL="critical";const HREF="href";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){let jetVer=regCtx.utils.metaLib.getMetaVers().runver;let semver=regCtx.utils.semVerUtils;this._jetVerGte12=semver.gte(jetVer,VER_12_0_0);return{link:this._onLink,comment:this._onComment}}_onLink(ruleCtx){var href;if(!_isStyleSheetLink(ruleCtx)||!(href=ruleCtx.tagNode.attribs.href)){return}if(RE_ALTA_MIN.test(href)||RE_APP_CLOUD.test(href)){this._emitIssue(ruleCtx,1)}}_onComment(ruleCtx,comment){var emit,stack;if((stack=ruleCtx.elemStack)&&stack.length){stack=stack[stack.length-1];if(stack.type==="tag"&&stack.name==="head"){if(!(emit=RE_INJECT_THEME.test(comment))){if(RE_INJECT.test(comment)){emit=comment.indexOf(" theme=")<0}}if(emit){this._emitIssue(ruleCtx,2,comment)}}}}_emitIssue(ruleCtx,type,comment){var issue,msg,node;msg=type===1?"Stylesheet <link> refers to deprecated Alta theme or a theme that extends it":"vb:inject theme : Alta theme is deprecated";issue=new ruleCtx.Issue(msg);if(type===1){issue.setPosition(ruleCtx.utils.DomUtils.getAttrValuePosition(ruleCtx.data,ruleCtx.node,HREF))}else{node=ruleCtx.node;let x=comment.indexOf("theme=");if(x>=0){x+=node.startIndex;issue.setPosition(null,null,node.startIndex+5,node.endIndex)}else{issue.setPosition(null,null,node.startIndex,node.endIndex)}}if(this._jetVerGte12){issue.setSeverity(CRITICAL)}if(ruleCtx.utils.jafLib.getJetReleaseCount()>JET_RELS){issue.setSeverity(SEV_BLOCKER);issue.setMsgKey(RULENAME+MSG_ID_AGED)}ruleCtx.reporter.addIssue(issue,ruleCtx)}}function _isStyleSheetLink(ruleCtx){var attribs,ret;if(attribs=ruleCtx.tagNode.attribs){ret=attribs.rel===STYLESHEET}return ret?ret:false}module.exports=Rule;
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-attr-2def";const DOUBLE_BRACE="{{";const DOUBLE_BRACKET="[[";const EXEMPT=["style","class"];const EXPLAIN="A tag should not contain both an attribute and a colon-prefixed attribute of the same name."+"<p>For example:<p>"+"<div id=\"id1\" :id=\"[[mydiv]]\">";function getName(){return RULE_NAME};function getShortDescription(){return"Check tag does not contain an attribute and a colon-prefixed attribute of the same name"};function getDescription(){return EXPLAIN};function register(){return{"elem":_fnTags}};function _fnTags(ruleCtx,tagName){var attribs,attr,attr2,a,attrPos,issue;attribs=ruleCtx.node.attribs;for(attr in attribs){if(attr.charAt(0)===":"||EXEMPT.includes(attr)){continue}attr2=":"+attr;for(a in attribs){if(a===attr2){issue=new ruleCtx.Issue("<"+tagName+"> contains attributes '"+attr+"' and '"+attr2+"'");attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-attr-2def";const DOUBLE_BRACE="{{";const DOUBLE_BRACKET="[[";const EXEMPT=["style","class"];const SHORT="A tag should not contain an attribute and a colon-prefixed attribute of the same name";const EXPLAIN=SHORT+"<p>For example:<p>"+"<div id=\"id1\" :id=\"[[mydiv]]\">";function getName(){return RULE_NAME}function getShortDescription(){return SHORT}function getDescription(){return EXPLAIN};function register(){return{"elem":_fnTags}};function _fnTags(ruleCtx,tagName){var attribs,attr,attr2,a,attrPos,issue;attribs=ruleCtx.node.attribs;for(attr in attribs){if(attr.charAt(0)===":"||EXEMPT.includes(attr)){continue}attr2=":"+attr;for(a in attribs){if(a===attr2){issue=new ruleCtx.Issue("<"+tagName+"> contains attributes '"+attr+"' and '"+attr2+"'");attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};module.exports={getName,getDescription,getShortDescription,register};
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-attr-req";const SHORT_DESCR="Check that a webcomponent element contains all mandatory attributes";const LONG_DESCR="A Web Component attribute which is mandatory, must be declared on the web component element.";const DOUBLE_BRACE="{{";const DOUBLE_BRACKET="[[";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCR};function getDescription(){return LONG_DESCR};function register(){return{webcomp:_fnTag}};function _fnTag(ruleCtx,tagName){var node,req,attribs,attrib,attrReq,sub,val,i,x,tmp,issue,n,found;req=ruleCtx.utils.metaLib.getRequiredAttrs(tagName);if(!req||!req.length){return}node=ruleCtx.tagNode;if(!ruleCtx.utils.utils.hasAnyProps(node.attribs)){if(req.length){val=req.length+" required attribute"+(req.length>1?"s":"")+": ";for(i=0;i<req.length;i++){val+=i?", ":"";val+="'"+req[i]+"'"}val+=" missing on <"+tagName+">";issue=new ruleCtx.Issue(val)}ruleCtx.reporter.addIssue(issue,ruleCtx);return}attribs=node.attribs;n=0;for(i=0;i<req.length;i++){attrReq=req[i];found=false;for(attrib in attribs){attrib=attrib.charAt(0)===":"?attrib.substring(1):attrib;if(attrib===attrReq){n++;found=true;break}}if(n===req.length){return}if(found){continue}tmp=attrReq;while((x=tmp.lastIndexOf("."))>0){sub=tmp=tmp.substring(0,x);val=_isAttrMatch(node.attribs,sub);if(val){if(_isExpr(val)){return}if(_isJson(val)){if(_resolveWithObj(attrReq,sub,val)){return}}else{break}}}issue=new ruleCtx.Issue(`Required attribute '${attrReq}' is missing on <${tagName}>`);issue._msgEx={reqAttr:attrReq};ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _isAttrMatch(attribs,attr){var attrib,ret=false;for(attrib in attribs){attrib=attrib.charAt(0)===":"?attrib.substring(1):attrib;if(attrib===attr){ret=attribs[attrib];break}}return ret};function _resolveWithObj(attrReq,sub,json){var obj,prop;try{obj=JSON.parse(json);for(prop in obj){if(attrReq===sub+"."+prop)return true}}catch(e){}return false};function _isExpr(s){s=s.trim();return s.startsWith("[[")||s.startsWith("{{")};function _isJson(s){var start=s.charAt(0);return(start==="{"||start!=="[")&&!_isExprStart(s)};function _isExprStart(s){return s.startsWith(DOUBLE_BRACKET)||s.startsWith(DOUBLE_BRACE)};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-attr-req";const SHORT_DESCR="Check that a webcomponent element contains all mandatory attributes";const LONG_DESCR="A Web Component attribute which is mandatory, must be declared on the web component element.";const DOUBLE_BRACE="{{";const DOUBLE_BRACKET="[[";const DOT=".";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCR};function getDescription(){return LONG_DESCR};function register(){return{webcomp:_fnTag}};function _fnTag(ruleCtx,tagName){var node,req,attribs,attrib,attrReq,sub,val,i,x,tmp,issue,n,found;req=ruleCtx.utils.metaLib.getRequiredAttrs(tagName);if(!req||!req.length){return}node=ruleCtx.tagNode;if(!ruleCtx.utils.utils.hasAnyProps(node.attribs)){val=req.length+" required attribute"+(req.length>1?"s":"")+": ";for(i=0;i<req.length;i++){val+=i?", ":"";val+="'"+req[i]+"'"}val+=" missing on <"+tagName+">";issue=new ruleCtx.Issue(val);ruleCtx.reporter.addIssue(issue,ruleCtx);return}attribs=node.attribs;n=0;_checkAttrs:for(i=0;i<req.length;i++){attrReq=req[i];found=false;for(attrib in attribs){attrib=attrib.charAt(0)===":"?attrib.substring(1):attrib;if(attrib===attrReq){n++;found=true;break}}if(n===req.length){return}if(found){continue}for(attrib in attribs){if((x=attrib.indexOf(DOT))>0){if(req.includes(attrib.substring(0,x))){n++;found=true;continue _checkAttrs}}}tmp=attrReq;while((x=tmp.lastIndexOf(DOT))>0){sub=tmp=tmp.substring(0,x);val=_isAttrMatch(node.attribs,sub);if(val){if(_isExpr(val)){return}if(_isJson(val)){if(_resolveWithObj(attrReq,sub,val)){return}}else{break}}}issue=new ruleCtx.Issue(`Required attribute '${attrReq}' is missing on <${tagName}>`);issue._msgEx={reqAttr:attrReq};ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _isAttrMatch(attribs,attr){var attrib,ret=false;for(attrib in attribs){attrib=attrib.charAt(0)===":"?attrib.substring(1):attrib;if(attrib===attr){ret=attribs[attrib];break}}return ret};function _resolveWithObj(attrReq,sub,json){var obj,prop;try{obj=JSON.parse(json);for(prop in obj){if(attrReq===sub+"."+prop)return true}}catch(e){}return false};function _isExpr(s){s=s.trim();return s.startsWith("[[")||s.startsWith("{{")};function _isJson(s){var start=s.charAt(0);return(start==="{"||start!=="[")&&!_isExprStart(s)};function _isExprStart(s){return s.startsWith(DOUBLE_BRACKET)||s.startsWith(DOUBLE_BRACE)};module.exports={getName,getDescription,getShortDescription,register};
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-cca-tagname";const SHORT_DESCRIPT="Web component element names must be defined";const LONG_DESCRIPT="This web component is unknown to JAF. Check the element spelling. For non-JET core components, check that the component metadata has been declared to JAF via the 'component's configuration property.";const IGNORE_LIST=["oj-slot","oj-dynamic-form"];function Rule(){this._ignoreList=null}Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT_DESCRIPT};Rule.prototype.getDescription=function(){return LONG_DESCRIPT};Rule.prototype.register=function(regCtx){if(!this._getIgnoreOverrides(regCtx)){return false}return{"tag":this._handleTag,"ojtag":this._handleTag}};Rule.prototype._handleTag=function(ruleCtx,tagName){if(ruleCtx.utils.DomUtils.isCommonElem(tagName)||ruleCtx.utils.DomUtils.isHtml5ObsoleteElem(tagName)||tagName==="template"||_isSvg(ruleCtx,tagName)){return}if(!ruleCtx.utils.metaLib.isWCTag(tagName)&&!IGNORE_LIST.includes(tagName)&&!this._checkOverrides(tagName)){let b=tagName.includes("-");let s=b?"web component":"tag";var issue=new ruleCtx.Issue(`<${ruleCtx.tag}> is not a known ${s}`);if(b){issue.setMsgKey(RULE_NAME+"_1")}ruleCtx.reporter.addIssue(issue,ruleCtx)}};Rule.prototype._checkOverrides=function(tag){if(tag.startsWith("oj-what-is-")){var jj=42}if(this._ignoreList){for(let i=0;i<this._ignoreList.length;i++){if(this._ignoreList[i].test(tag)){return true}}}return false};Rule.prototype._getIgnoreOverrides=function(regCtx){var ignore;if(ignore=regCtx.ruleOpts["ignore"]){if(!Array.isArray(ignore)){regCtx.utils.msgLib.error(`Rule ${RULE_NAME} : config option 'ignore' is not an array`);return false}this._ignoreList=[];for(let i=0;i<ignore.length;i++){if(typeof ignore[i]==="string"){try{this._ignoreList[i]=new RegExp(ignore[i].trim())}catch(e){regCtx.utils.msgLib.error(`Config 'ruleMods' ${RULE_NAME} 'ignore' entry [${i}]: ${e.message}`);return false}}}}return true};function _isSvg(ruleCtx,elem){var ret=false,n;if(elem==="svg"){return true}if(ruleCtx.utils.DomUtils.isSvgElem(elem)){n=ruleCtx.tagNode;while(n){n=n.parent;if(!n){break}if(n.name&&n.name==="svg"){ret=true;break}}}return ret};module.exports=Rule;
6
+ const RULE_NAME="oj-html-cca-tagname";const SHORT_DESCRIPT="Web component element names must be defined";const LONG_DESCRIPT="This web component is unknown to JAF. Check the element spelling. For non-JET core components, check that the component metadata has been declared to JAF via the 'component's configuration property.";const IGNORE_LIST=["oj-slot","oj-dynamic-form"];function Rule(){this._ignoreList=null}Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT_DESCRIPT};Rule.prototype.getDescription=function(){return LONG_DESCRIPT};Rule.prototype.register=function(regCtx){if(!this._getIgnoreOverrides(regCtx)){return false}return{"tag":this._handleTag,"ojtag":this._handleTag}};Rule.prototype._handleTag=function(ruleCtx,tagName){if(ruleCtx.utils.DomUtils.isCommonElem(tagName)||ruleCtx.utils.DomUtils.isHtml5ObsoleteElem(tagName)||tagName==="template"||_isSvg(ruleCtx,tagName)){return}if(!ruleCtx.utils.metaLib.isWCTag(tagName)&&!IGNORE_LIST.includes(tagName)&&!this._checkOverrides(tagName)){let b=tagName.includes("-");let s=b?"web component":"tag";var issue=new ruleCtx.Issue(`<${ruleCtx.tag}> is not a known ${s}`);if(b){issue.setMsgKey(RULE_NAME+"_1")}ruleCtx.reporter.addIssue(issue,ruleCtx)}};Rule.prototype._checkOverrides=function(tag){if(this._ignoreList){for(let i=0;i<this._ignoreList.length;i++){if(this._ignoreList[i].test(tag)){return true}}}return false};Rule.prototype._getIgnoreOverrides=function(regCtx){var ignore;if(ignore=regCtx.ruleOpts["ignore"]){if(!Array.isArray(ignore)){regCtx.utils.msgLib.error(`Rule ${RULE_NAME} : config option 'ignore' is not an array`);return false}this._ignoreList=[];for(let i=0;i<ignore.length;i++){if(typeof ignore[i]==="string"){try{this._ignoreList[i]=new RegExp(ignore[i].trim())}catch(e){regCtx.utils.msgLib.error(`Config 'ruleMods' ${RULE_NAME} 'ignore' entry [${i}]: ${e.message}`);return false}}}}return true};function _isSvg(ruleCtx,elem){var ret=false,n;if(elem==="svg"){return true}if(ruleCtx.utils.DomUtils.isSvgElem(elem)){n=ruleCtx.tagNode;while(n){n=n.parent;if(!n){break}if(n.name&&n.name==="svg"){ret=true;break}}}return ret};module.exports=Rule;
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-cdn";const LONG_DESCRIPT="For improved performance, production status pages referred to in <b><i><link></i></b> or <b></i><script></i></b> elements should load from the Content Delivery Network (<b>CDN</b>).";const SHORT_DESCRIPT="Production status pages should preferably load from the CDN.";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{"script":_handle,"link":_handle}};function _handle(ruleCtx,tagName){var attribs=ruleCtx.tagNode.attribs;var url,issue;if(attribs){if(attribs.src){url=attribs.src}else if(attribs.href){url=attribs.href}if(url){if(url.toLowerCase().indexOf("/cdn/jet/v")>=0){issue=new ruleCtx.Issue("Performance: <"+tagName+"> does not refer to the Content Delivery Network (CDN)");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-cdn";const LONG_DESCRIPT="For improved performance, production status pages referred to in <b><i><link></i></b> or <b><i><script></i></b> elements should load from the Content Delivery Network (<b>CDN</b>).";const SHORT_DESCRIPT="Production status pages should preferably load from the CDN.";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{"script":_handle,"link":_handle}};function _handle(ruleCtx,tagName){var attribs=ruleCtx.tagNode.attribs;var url,issue;if(attribs){if(attribs.src){url=attribs.src}else if(attribs.href){url=attribs.href}if(url){if(url.toLowerCase().indexOf("/cdn/jet/v")>=0){issue=new ruleCtx.Issue("Performance: <"+tagName+"> does not refer to the Content Delivery Network (CDN)");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};module.exports={getName,getDescription,getShortDescription,register};
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULENAME="oj-html-combo-converter";const SHORT_DESCRIPTION="Starting in JET 10.0.0, oj-combobox-one/many will not apply the converter to format the display label of the dropdown items";const DESCRIPTION=SHORT_DESCRIPTION+" It will be the application's responsibility to provide option items with already-formatted labels, potentially by calling the converter instance directly.";const CONVERTER="converter";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{ojtag:this._onOjTag}}_onOjTag(ruleCtx,tag){var issue;if(!tag.startsWith("oj-combobox-")){return}let attribs=ruleCtx.tagNode.attribs;if(attribs[CONVERTER]){issue=new ruleCtx.Issue(`<${tag}> use of 'converter' - in 10.0.0 this will not format the display label of the dropdown items`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,CONVERTER);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;
6
+ const RULENAME="oj-html-combo-converter";const SHORT_DESCRIPTION="Starting in JET 10.0.0, oj-combobox-one/many will not apply the converter to format the display label of the dropdown items";const DESCRIPTION=SHORT_DESCRIPTION+" It will be the application's responsibility to provide option items with already-formatted labels, potentially by calling the converter instance directly.";const CONVERTER="converter";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{ojtag:this._onOjTag}}_onOjTag(ruleCtx,tag){var issue;if(!tag.startsWith("oj-combobox-")){return}let attribs=ruleCtx.tagNode.attribs;if(attribs[CONVERTER]){issue=new ruleCtx.Issue(`<${tag}> use of 'converter' - in JET 10.0.0 this will not format the display label of the dropdown items`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,CONVERTER);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-file-pick-accept";const DESCRIPTION="Valid array entries for the 'accept' attribute of <oj-file-picker> are:<p>"+"1) a file suffix beginning with a period, e.g. \".xxx\"<br>"+"2) an empty string<br>"+"3) an audio, video, or image file, e.g. \"image/*\" or \"audio/*\", or \"video/*\".";const SHORT_DESCRIPTION="Array entries for <oj-file-picker accept=' . . .'> attribute should be valid file strings.";const BASE_MSG="<oj-file-picker> attribute 'accept'";const FILE_PICKER="oj-file-picker";const ACCEPT="accept";const RO_EXPR="[[";const RW_EXPR="{{";const ARRAY_LEFT="[";const ARRAY_RIGHT="]";const GOOD_VALS=[".","audio/","video/","image/"];class Rule{getName(){return RULE_NAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-file-picker>":this._onTag}}_onTag(ruleCtx){let accept;accept=ruleCtx.tagNode.attribs;accept=accept?accept[ACCEPT]:null;if(accept){let avals=this._checkAttr(ruleCtx,accept);if(avals){this._checkArray(ruleCtx,avals)}}}_emitIssue(ruleCtx,msgNum,info,val){var msg,issue;switch(msgNum){case 0:msg=`${BASE_MSG} is not an array of strings`;break;case 1:msg=`${BASE_MSG} syntax : ${info.msg} at index ${info.startIndex}`;break;case 2:msg=`${BASE_MSG} : invalid array entry \"${val}\"`;break;}if(msg){issue=new ruleCtx.Issue(msg);if(msgNum){issue.setMsgKey(RULE_NAME+"_"+msgNum)}let pos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,ACCEPT);issue.setPosition(pos.row,pos.col,pos.start,pos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}_checkArray(ruleCtx,avals){var v,i,j;for(i=0;i<avals.length;i++){v=avals[i];if(typeof v!=="string"){this._emitIssue(ruleCtx,2,null,v);continue}for(j=0;j<GOOD_VALS.length;j++){if(v.startsWith(GOOD_VALS[j])||v===""){break}}if(j>=GOOD_VALS.length){this._emitIssue(ruleCtx,2,i,v)}}}_checkAttr(ruleCtx,s){if(s.startsWith(RO_EXPR)||s.startsWith(RW_EXPR)){return}if(s.charAt(0)!==ARRAY_LEFT&&s.charAt(s.length-1)!==ARRAY_RIGHT){this._emitIssue(ruleCtx,0);return}let o=ruleCtx.utils.utils.parseJson(s,false);if(o.msg){this._emitIssue(ruleCtx,1,o);return}return o.obj}}module.exports=Rule;
6
+ const RULE_NAME="oj-html-file-pick-accept";const DESCRIPTION="Valid array entries for the 'accept' attribute of <oj-file-picker> are:<p>"+"1) a file suffix beginning with a period, e.g. \".xxx\"<br>"+"2) an empty string<br>"+"3) an audio, video, or image file, e.g. \"image/*\" or \"audio/*\", or \"video/*\".";const SHORT_DESCRIPTION="Array entries for <oj-file-picker accept=' ...'> attribute should be valid file strings.";const BASE_MSG="<oj-file-picker> attribute 'accept'";const FILE_PICKER="oj-file-picker";const ACCEPT="accept";const RO_EXPR="[[";const RW_EXPR="{{";const ARRAY_LEFT="[";const ARRAY_RIGHT="]";const GOOD_VALS=[".","audio/","video/","image/"];class Rule{getName(){return RULE_NAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-file-picker>":this._onTag}}_onTag(ruleCtx){let accept;accept=ruleCtx.tagNode.attribs;accept=accept?accept[ACCEPT]:null;if(accept){let avals=this._checkAttr(ruleCtx,accept);if(avals){this._checkArray(ruleCtx,avals)}}}_emitIssue(ruleCtx,msgNum,info,val){var msg,issue;switch(msgNum){case 0:msg=`${BASE_MSG} is not an array of strings`;break;case 1:msg=`${BASE_MSG} syntax : ${info.msg} at index ${info.startIndex}`;break;case 2:msg=`${BASE_MSG} : invalid array entry \"${val}\"`;break;}if(msg){issue=new ruleCtx.Issue(msg);if(msgNum){issue.setMsgKey(RULE_NAME+"_"+msgNum)}let pos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,ACCEPT);issue.setPosition(pos.row,pos.col,pos.start,pos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}_checkArray(ruleCtx,avals){var v,i,j;for(i=0;i<avals.length;i++){v=avals[i];if(typeof v!=="string"){this._emitIssue(ruleCtx,2,null,v);continue}for(j=0;j<GOOD_VALS.length;j++){if(v.startsWith(GOOD_VALS[j])||v===""){break}}if(j>=GOOD_VALS.length){this._emitIssue(ruleCtx,2,i,v)}}}_checkAttr(ruleCtx,s){if(s.startsWith(RO_EXPR)||s.startsWith(RW_EXPR)){return}if(s.charAt(0)!==ARRAY_LEFT&&s.charAt(s.length-1)!==ARRAY_RIGHT){this._emitIssue(ruleCtx,0);return}let o=ruleCtx.utils.utils.parseJson(s,false);if(o.msg){this._emitIssue(ruleCtx,1,o);return}return o.obj}}module.exports=Rule;
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULENAME="oj-html-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;
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 &lt;h1&gt;, &lt;p&gt;, or &lt;ul&gt; 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;
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-ojattr-deprecated";const OJ_EVENT_PREFIX="on-oj-";const ON_EVENT_PREFIX="on-";const CHANGED="-changed";const DATABIND="data-bind";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};
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 JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";const OR="|";const SHORT="Deprecated web component attributes or deprecated event attributes should not be used";const LONG="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 getName(){return RULE_NAME}function getShortDescription(){return SHORT}function getDescription(){return LONG}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)}if(ruleCtx.utils.jafLib.getJetReleaseCount()>JET_RELS){issue.setSeverity(SEV_BLOCKER);issue.setMsgKey(RULE_NAME+(msgKey?msgKey:"")+MSG_ID_AGED)}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){return s&&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};
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-ojattr-enum-deprecated";function getName(){return RULE_NAME};function getShortDescription(){return"Deprecated enumerated attribute values should not be used."};function getDescription(){return"Web component attributes that are assigned a deprecated enumerated value should not be used."};function register(){return{"webcomp":_onWc}};function _onWc(ruleCtx,tagName){var attribs,attrName,enumValue,issue,metaLib,o,since,help;metaLib=ruleCtx.utils.metaLib;attribs=ruleCtx.node.attribs;if(!attribs){return}for(attrName in attribs){issue=null;attrName=attrName.charAt(0)!==":"?attrName:attrName.substring(1);if(!(enumValue=attribs[attrName])){if(!(enumValue=attribs[":"+attrName])){return}}if(_isExpr(enumValue)){return}o=metaLib.isTagAttrEnumValueDeprecated(tagName,attrName,enumValue);if(o){help=o.description?" "+o.description.trim():"";since=o.since?" (since "+o.since+")":"";issue=new ruleCtx.Issue(`<${tagName}> attribute '${attrName}' enumerated value '${enumValue}' is deprecated${since}.${help}`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _isExpr(s){var start=s.substring(0,2);return start==="[["||start==="{{"}module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-ojattr-enum-deprecated";const LONG="Web component attributes that are assigned a deprecated enumerated value should not be used.";const SHORT="Deprecated enumerated attribute values should not be used.";const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";function getName(){return RULE_NAME};function getShortDescription(){return SHORT};function getDescription(){return LONG};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);if(ruleCtx.utils.jafLib.getJetReleaseCount()>JET_RELS){issue.setSeverity(SEV_BLOCKER);issue.setMsgKey(RULE_NAME+MSG_ID_AGED)}ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _isExpr(s){var start=s.substring(0,2);return start==="[["||start==="{{"}module.exports={getName,getDescription,getShortDescription,register};
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-ojattr-evt-syntax";function getName(){return RULE_NAME};function getShortDescription(){return"Web component event listener attributes should not use {{...}} notation"};function getDescription(){return"A web component event listener attribute cannot use '{{ . . . }}' notation because writeback is inapplicable. Use '[[. . .]]' notation."+"<p>For example, change:<br>"+" <oj-accordion on-oj-before-collapse='{{listener}}'></oj-accordion><br>"+"to:<br>"+" <oj-accordion on-oj-before-collapse='[[listener]]'></oj-accordion><br>"};function register(){return{"event":_handleEvent}};function _handleEvent(ruleCtx,evtName,evtValue){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};
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};
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-ojattr-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};
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("[[")){continue}_checkAttr(ruleCtx,tag,attr,val)}}};function _checkAttr(ruleCtx,tag,attr,val){var issue,metaLib,DomUtils,aVals,aVal,jsonChar,i;metaLib=ruleCtx.utils.metaLib;DomUtils=ruleCtx.utils.DomUtils;if(DomUtils.isCommonAttr(attr)||DomUtils.isCommonEventAttr(attr)||attr===DATABIND){return}if(!metaLib.isTagAttr(tag,attr)){return}jsonChar=val.charAt(0);try{if(jsonChar==="{"){return}else 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};
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const isValidAttr=require("./helpers/valid-attr");const RULE_NAME="oj-html-ojattr";const OJ_EVENT_PREFIX="on-oj-";const EVENT_PREFIX="on-";const SLOT="slot";const DATABIND="data-bind";const DATACMD="data-oj-command";const DATACONTEXT="data-oj-context";function getName(){return RULE_NAME};function getShortDescription(){return"JET component attribute must be 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};
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.substring(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};
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-html-ojtag-deprecated";const SHORT="Deprecated custom components should not be used";const LONG="Deprecated custom components should not be used. Refer to the diagnostic issued for a suggested replacement.";class Rule{getName(){return RULE_NAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(){return{"webcomp":this._onWC}}_onWC(ruleCtx,tag){var issue,metaLib,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;
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.";const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";const ID_PLUS_1="_1";class Rule{getName(){return RULE_NAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(){return{"webcomp":this._onWC}}_onWC(ruleCtx,tag){var metaLib,status;if(tag==="oj-slot"){return}metaLib=ruleCtx.utils.metaLib;if(status=metaLib.isTagDeprecated(tag)){let descript=status.description?" "+status.description:"";let since=status.since?" (since "+status.since+")":null;let b;let issue=new ruleCtx.Issue(`<${tag}> is deprecated${since}.${descript}`);if(!ruleCtx.ojTag){issue.setMsgKey(RULE_NAME+ID_PLUS_1);b=true}if(ruleCtx.utils.jafLib.getJetReleaseCount()>JET_RELS){issue.setSeverity(SEV_BLOCKER);issue.setMsgKey(RULE_NAME+(b?ID_PLUS_1:"")+MSG_ID_AGED)}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-pageopts-type";const DESCRIPTION="Paging Control with numbers is an antipattern in Redwood. Instead the UX recommendation "+"is to use high-water mark scrolling patterns on pages and collections. The JET collections "+"all support high-water mark scrolling natively without the need for a paging control via "+"the scroll-policy attribute. For teams using paging control in Alta we recommend to begin "+"changing the behavior as it will not be supported in Redwood. The only supported use of "+"<oj-paging-control> is to use page-options.type=\"dots\".";const SHORT_DESCRIPTION="Paging Control with numbers is an anti pattern in Redwood";const PAGE_OPTS_TYPE="page-options.type";const DOTS="dots";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-paging-control>":this._onPageCtl}}_onPageCtl(ruleCtx){var attrs,attr,found;attrs=ruleCtx.tagNode.attribs;for(attr in attrs){if(attr.startsWith("page-options")){found=true;if(attr.endsWith(".type")){if(ruleCtx.utils.DomUtils.getAttribValue(ruleCtx.tagNode,PAGE_OPTS_TYPE)!==DOTS){this._emit(ruleCtx,true)}break}}}if(!found){this._emit(ruleCtx)}}_emit(ruleCtx,haveAttr){let msg=haveAttr?"page-options.type=numbers is deprecated":"page-options.type omitted and default value 'numbers' is deprecated";let issue=new ruleCtx.Issue(`<oj-paging-control> - ${msg}. Use the scroll property 'loadMoreOnScroll' on the collection.`);if(haveAttr){let pos=ruleCtx.utils.DomUtils.getAttribValuePosition(ruleCtx.data,ruleCtx.tagNode,PAGE_OPTS_TYPE);issue.setPosition(pos);issue.setMsgKey(RULENAME+"_2")}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-rating-gauge-size";const DESCRIPTION="The use of the <oj-rating-gauge> 'size' attribute set to enumerated value 'fit' is a "+"Redwood theme anti-pattern. The UX recommendation is to use an 'sm', 'md', or 'lg' value instead. "+"For interactive gauges, 'sm' and 'md' sizes are not recommended, since the touch target sizes are not "+"large enough to meet the accessibility guidelines.";const SHORT_DESCRIPTION="Do not use <oj-rating-gauge> with the 'size' attribute set to 'fit' in Redwood";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-rating-gauge size=>":this._onSize}}_onSize(ruleCtx,attr,value){if(value==="fit"){let issue=new ruleCtx.Issue(`<oj-rating-gauge> attribute 'size' value 'fit' is an anti-pattern in Redwood.`);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-bp-endslot";const DESCRIPTION="<oj-button> supports the 'startIcon' and 'endIcon' slots. \uFFFDHowever, in Redwood, it is best practice to use "+"only one icon, and the 'startIcon' slot should be used for this unless the icon is intended to communicate a "+"directional action to the right, in which case 'endIcon' can be used together with a suitable Redwood icon.";const SHORT="Use the startIcon (not the endIcon) slot in <oj-button> unless the icon communicates a direction action to the right";const TAG="tag";const SLOT="slot";const COLON_SLOT=":slot";const END_ICON="endIcon";const DIV="div";const SPAN="span";const COLON_CLASS=":class";const SPACE=" ";const ALLOWLIST=["oj-ux-ico-arrow-alt-right","oj-ux-ico-arrow-right-alt","oj-ux-ico-caret-right","oj-ux-ico-chevron-circle-right","oj-ux-ico-chevron-right","oj-ux-ico-nav-right","oj-ux-ico-triangle-right-s","oj-ux-ico-arrow-circle-right","oj-ux-ico-arrow-right","oj-ux-ico-chevron-double-right","oj-ux-ico-triangle-right","oj-ux-ico-arrow-alt-left","oj-ux-ico-arrow-left-alt","oj-ux-ico-caret-left","oj-ux-ico-chevron-circle-left","oj-ux-ico-chevron-left","oj-ux-ico-nav-left","oj-ux-ico-triangle-left-s","oj-ux-ico-arrow-circle-left","oj-ux-ico-arrow-left","oj-ux-ico-chevron-double-left","oj-ux-ico-triangle-left"];class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT}register(){return{"<oj-button>":this._onBtn}}_onBtn(ruleCtx){if(this._slots){this._slots.length=0}this._getSlots(ruleCtx.tagNode);if(this._slots){this._checkIconUsage(ruleCtx)}}_emit(ruleCtx,tagNode){var issue,pos,attr;issue=new ruleCtx.Issue("Redwood best practices - use slot 'startIcon' only");attr=tagNode.attribs.hasOwnProperty(SLOT)?SLOT:COLON_SLOT;if(pos=ruleCtx.utils.DomUtils.getAttribValuePosition(ruleCtx.data,tagNode,attr)){issue.setPosition(pos)}ruleCtx.reporter.addIssue(issue,ruleCtx)}_getSlots(tagNode){var childs,ch,attrs,attr,i;attrs=tagNode.attribs;if(attr=attrs.slot||attrs[COLON_SLOT]){if(attr===END_ICON){if(!this._slots){this._slots=[]}this._slots.push(tagNode)}}childs=tagNode.children;for(i=0;i<childs.length;i++){ch=childs[i];if(ch.type===TAG){this._getSlots(ch)}}}_checkIconUsage(ruleCtx){var i,node,clazz;for(i=0;i<this._slots.length;i++){node=this._slots[i];if(node.name===DIV||node.name===SPAN){if(_isEmpty(node)){if(clazz=node.attribs.class||node.attribs[COLON_CLASS]){clazz=clazz.trim();if(_isExpr(clazz)||_isClassAllowListed(clazz)){continue}}}}this._emit(ruleCtx,node)}}}function _isClassAllowListed(clazz){var a,cl,i;if(clazz.indexOf(SPACE)){clazz=clazz.replace(/ +(?= )/g,"").trim();a=clazz.split(SPACE);for(i=0;i<a.length;i++){if(ALLOWLIST.includes(a[i])){cl=a[i];break}}}else if(ALLOWLIST.includes(clazz)){cl=clazz}return!!cl};function _isEmpty(node){var childs,ch,i,ret=false;if((childs=node.children)&&childs.length){for(i=0;i<childs.length;i++){ch=childs[i];if(ch.type==="text"){if(!ret){ret=ch.data&&ch.data.trim().length===0;continue}}if(ch.type==="tag"){ret=false;break}}}else{ret=true}return ret};function _isExpr(s){s=s.trimLeft();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-deprecated";const DESCRIPT="The slot has been deprecated, and is subject to removal or non-active support in the future.";const SHORT="A deprecated slot has been found.";const SLOT="slot";const TEMPLATE="template";const DEPRECATED="deprecated";const DOT=".";const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";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;return{"<slot=>":this._onSlot}};Rule.prototype._onSlot=function(ruleCtx,slot,slotVal){if(slotVal&&!_isExpr(slotVal)&&ruleCtx.tagNode.name!==TEMPLATE){this._checkSlot(ruleCtx,slotVal)}};Rule.prototype._checkSlot=function(ruleCtx,slotName){var issue,node,meta;node=getParentNodeForSlot(ruleCtx,slotName);if(!node||node.type!=="tag"){return}if(meta=this._metaLib.getTagSlotMetadata(node.name,slotName)){if(meta.type!==DEPRECATED){return}let since=meta.since?` (since ${meta.since})`:"";let descript=(meta.description?` ${meta.description}`:"").trimRight();if(descript&&!descript.endsWith(DOT)){descript+=DOT}issue=new ruleCtx.Issue(`slot '${slotName}' on <${ruleCtx.tag}> for <${node.name}> is deprecated${since}.${descript}`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,SLOT);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);if(ruleCtx.utils.jafLib.getJetReleaseCount()>JET_RELS){issue.setSeverity(SEV_BLOCKER);issue.setMsgKey(RULE_NAME+MSG_ID_AGED)}ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _isExpr(s){return s.startsWith("[[")||s.startsWith("{{")};module.exports=Rule;
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const getParentNodeForSlot=require('./helpers/has-slot-name');const RULE_NAME='oj-html-slot-pref-content';const DESCRIPT='When component metadata defines \'preferredContent\' for a slot, child elements placed into that slot should '+'implement one or more of the requested interfaces and document that through their \'implements\' metadata. '+'This rule applies to components that are directly allocated to a slot, or which are direct children '+'of a template allocated to that slot.';const SHORT=DESCRIPT;const TEMPLATE='template';const OJ_SWITCHER='oj-switcher';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;
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.getPreferredSlotContentEx(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;
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULENAME="oj-html-wctag-maintenance";const DESCRIPTION="A notification that the component is in 'maintenance' status. This indicates "+"that the component is fully supported, but will be deprecated in a future release "+"and has no new features planned for it.";const SHORT_DESCRIPTION="The component is in 'maintenance' status and will be deprecated in a future release.";const MSG="<%c> is in 'maintenance' status%s.%d";const MAINTENANCE="maintenance";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._metaLib=regCtx.utils.metaLib;return{ojtag:this._onTag}}_onTag(ruleCtx,tag){var status;if(status=this._metaLib.getTagStatus(tag,MAINTENANCE)){let msg=MSG.replace("%c",tag);;if(status.since){msg=msg.replace("%s",` (since ${status.since})`)}if(status.description){msg=msg.replace("%d",` ${status.description}`);if(!msg.endsWith(".")){msg+="."}}let issue=new ruleCtx.Issue(msg);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;