@oracle/oraclejet-audit 15.1.9 → 16.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/corePackMigrator/corePackMigrator.js +2 -2
  2. package/corePackMigrator/metadata/actionCardMetadata.json +8 -0
  3. package/corePackMigrator/metadata/avatarMetadata.json +0 -12
  4. package/corePackMigrator/metadata/drawerPopupMetadata.json +16 -0
  5. package/corePackMigrator/metadata/formLayoutMetadata.json +34 -0
  6. package/corePackMigrator/metadata/highlightTextMetadata.json +8 -0
  7. package/corePackMigrator/metadata/inputNumberMetadata.json +26 -2
  8. package/corePackMigrator/metadata/inputPasswordMetadata.json +32 -2
  9. package/corePackMigrator/metadata/inputTextMetadata.json +26 -2
  10. package/corePackMigrator/metadata/legendItemMetadata.json +1 -5
  11. package/corePackMigrator/metadata/legendMetadata.json +42 -0
  12. package/corePackMigrator/metadata/legendSectionMetadata.json +6 -4
  13. package/corePackMigrator/metadata/listviewMetadata.json +61 -2
  14. package/corePackMigrator/metadata/messageBannerMetadata.json +8 -0
  15. package/corePackMigrator/metadata/messagesMetadata.json +17 -5
  16. package/corePackMigrator/metadata/radiosetMetadata.json +86 -0
  17. package/corePackMigrator/metadata/ratingGaugeMetadata.json +29 -17
  18. package/corePackMigrator/metadata/selectManyMetadata.json +9 -3
  19. package/corePackMigrator/metadata/selectSingleMetadata.json +16 -5
  20. package/corePackMigrator/metadata/selectorMetadata.json +37 -0
  21. package/corePackMigrator/metadata/statusMeterGaugeMetadata.json +21 -9
  22. package/corePackMigrator/metadata/tagCloudMetadata.json +8 -0
  23. package/corePackMigrator/metadata/textAreaMetadata.json +8 -2
  24. package/corePackMigrator/resource/astUtils.js +1 -1
  25. package/corePackMigrator/resource/componentMigrator.js +1 -1
  26. package/corePackMigrator/resource/fileScanner.js +1 -1
  27. package/corePackMigrator/resource/htmlUtils.js +1 -1
  28. package/corePackMigrator/resource/manifest.json +25 -10
  29. package/corePackMigrator/resource/migrationConfig.json +3 -0
  30. package/corePackMigrator/templates/componentMetaData.json +18 -4
  31. package/corePackMigrator/templates/migrationConfig.json +15 -3
  32. package/corePackMigrator/utilities/logging.js +1 -1
  33. package/jaf-amd.js +1 -1
  34. package/jaf.js +1 -1
  35. package/jafapi.js +1 -1
  36. package/lib/AST_Ts.js +1 -1
  37. package/lib/AstJson.js +1 -1
  38. package/lib/AstNodeTypes.js +1 -1
  39. package/lib/Components.js +1 -1
  40. package/lib/DomUtils.js +1 -1
  41. package/lib/FsUtils.js +1 -1
  42. package/lib/HtmlUtils.js +1 -1
  43. package/lib/JafLib.js +1 -1
  44. package/lib/MetaLib.js +1 -1
  45. package/lib/OjCPack.js +1 -1
  46. package/lib/Registry.js +1 -1
  47. package/lib/RulePack.js +1 -1
  48. package/lib/RuleSet.js +1 -1
  49. package/lib/Rules.js +1 -1
  50. package/lib/Stats.js +1 -1
  51. package/lib/Ts.js +1 -1
  52. package/lib/TsUtils.js +6 -0
  53. package/lib/TsxUtils.js +1 -1
  54. package/lib/TsxUtils2.js +1 -1
  55. package/lib/Utils.js +1 -1
  56. package/lib/checkage.js +1 -1
  57. package/lib/defaults.js +1 -1
  58. package/lib/jsx.js +1 -1
  59. package/lib/migrator.js +1 -1
  60. package/lib/scaffold.js +1 -1
  61. package/lib/sublib/precomp/ComponentFinder.js +6 -0
  62. package/lib/sublib/precomp/Precompiler.js +6 -0
  63. package/lib/sublib/precomp/TsxUtils.js +6 -0
  64. package/lib/sublib/precomp/Utils.js +6 -0
  65. package/meta/15.0.0/jetauditmeta.js +1 -1
  66. package/meta/15.1.0/jetauditmeta.js +1 -1
  67. package/meta/16.0.0/jetauditmeta.js +9 -0
  68. package/meta/metaverlist.json +1 -1
  69. package/package.json +10 -7
  70. package/profiles/best-practice.json +1 -0
  71. package/rulepacks/csp/csp-json-unsafe-expr.js +1 -1
  72. package/rulepacks/jetwc/jetwc-bootstrap.js +1 -1
  73. package/rulepacks/jetwc/jetwc-require-paths.js +1 -1
  74. package/rulepacks/jetwc/jetwc-schema.js +1 -1
  75. package/rulepacks/jetwc/jetwc-well-formed-description.js +6 -0
  76. package/rulepacks/jetwc/msgid.json +1 -1
  77. package/rulepacks/jetwc/rules.json +1 -1
  78. package/rulepacks/jetwc-lib/jetwcutils-componentAuditUtils.js +1 -1
  79. package/rulepacks/jetwc-lib/jetwcutils-componentFinder.js +1 -1
  80. package/rulepacks/jetwc-lib/jetwcutils-tsxUtils.js +1 -1
  81. package/rulepacks/jetwco/jetwco-bootstrap.js +1 -1
  82. package/rulepacks/jetwco/jetwco-cacc-methodParamTypes.js +1 -1
  83. package/rulepacks/jetwco/jetwco-cacc-methodReturnType.js +1 -1
  84. package/rulepacks/jetwco/jetwco-description-standards.js +1 -1
  85. package/rulepacks/jetwco/jetwco-license-info.js +1 -1
  86. package/rulepacks/jetwco/jetwco-validate-applied-audits.js +6 -0
  87. package/rulepacks/jetwco/msgid.json +1 -1
  88. package/rulepacks/jetwco/rules.json +1 -1
  89. package/rulepacks/ojc/msgid.json +1 -1
  90. package/rulepacks/ojc/ojc-html-button-defslot.js +6 -0
  91. package/rulepacks/ojc/ojc-tsx-button-defslot.js +6 -0
  92. package/rulepacks/ojc/rules.json +1 -1
  93. package/rules/jaf/jaf-css-diagnose.js +1 -1
  94. package/rules/jaf/jaf-js-diagnose.js +1 -1
  95. package/rules/jaf/jaf-sys-dup-component.js +6 -0
  96. package/rules/jaf/jaf-sys-rule-opt.js +6 -0
  97. package/rules/jaf/jaf-ts-precompile.js +6 -0
  98. package/rules/jaf/msgid.json +1 -1
  99. package/rules/jaf/rules.json +1 -1
  100. package/rules/jet/helpers/has-slot-name.js +1 -1
  101. package/rules/jet/msgid.json +1 -1
  102. package/rules/jet/oj-cca-compjson-bp-jetver.js +1 -1
  103. package/rules/jet/oj-html-alta-deprecated.js +1 -1
  104. package/rules/jet/oj-html-attr-expr-writeback.js +6 -0
  105. package/rules/jet/oj-html-binding-as-slot-child.js +6 -0
  106. package/rules/jet/oj-html-event-focus-blur.js +6 -0
  107. package/rules/jet/oj-html-form-bindif.js +1 -1
  108. package/rules/jet/oj-html-ojattr-deprecated.js +1 -1
  109. package/rules/jet/oj-html-ojattr-enum-deprecated.js +1 -1
  110. package/rules/jet/oj-html-ojattr.js +1 -1
  111. package/rules/jet/oj-html-ojtag-deprecated.js +1 -1
  112. package/rules/jet/oj-html-ojtag-nonglobattr-prefix.js +1 -1
  113. package/rules/jet/oj-html-prop-anti-pattern.js +6 -0
  114. package/rules/jet/oj-html-slot-default.js +6 -0
  115. package/rules/jet/oj-html-slot-deprecated.js +1 -1
  116. package/rules/jet/oj-html-slot-name.js +1 -1
  117. package/rules/jet/oj-html-slot-pref-content.js +1 -1
  118. package/rules/jet/oj-html-style-deprecated.js +1 -1
  119. package/rules/jet/oj-html-treeview-actionable-content.js +6 -0
  120. package/rules/jet/oj-html-wctag-anti-pattern.js +6 -0
  121. package/rules/jet/oj-html-wctag-maintenance.js +1 -1
  122. package/rules/jet/oj-html-wctag-supersedes.js +1 -1
  123. package/rules/jet/oj-js-ojcomp-exist.js +1 -1
  124. package/rules/jet/oj-ts-ojcomp-exist.js +1 -1
  125. package/rules/jet/oj-tsx-aria-ojselector-labelledby.js +1 -1
  126. package/rules/jet/oj-tsx-aria-prop.js +1 -1
  127. package/rules/jet/oj-tsx-event.js +6 -0
  128. package/rules/jet/oj-tsx-ojattr-deprecated.js +1 -1
  129. package/rules/jet/oj-tsx-ojattr-enum-deprecated.js +1 -1
  130. package/rules/jet/oj-tsx-ojattr-value.js +1 -1
  131. package/rules/jet/oj-tsx-ojattr.js +1 -1
  132. package/rules/jet/oj-tsx-ojtag-deprecated.js +1 -1
  133. package/rules/jet/oj-tsx-pageopts-type.js +1 -1
  134. package/rules/jet/oj-tsx-picker-attrs.js +1 -1
  135. package/rules/jet/oj-tsx-popup-sibling.js +6 -0
  136. package/rules/jet/oj-tsx-prop-anti-pattern.js +6 -0
  137. package/rules/jet/oj-tsx-rating-gauge-size.js +1 -1
  138. package/rules/jet/oj-tsx-rating-gauge-track-resize.js +1 -1
  139. package/rules/jet/oj-tsx-slot-deprecated.js +1 -1
  140. package/rules/jet/oj-tsx-slot-pref-content.js +1 -1
  141. package/rules/jet/oj-tsx-treeview-actionable-content.js +6 -0
  142. package/rules/jet/oj-tsx-unsup-theme.js +1 -1
  143. package/rules/jet/oj-tsx-wctag-anti-pattern.js +6 -0
  144. package/rules/jet/oj-tsx-wctag-maintenance.js +1 -1
  145. package/rules/jet/rules.json +1 -1
  146. package/schema/component-schema.json +1 -1
  147. package/src/JafCore.js +1 -1
  148. package/types/index.d.ts +1 -0
  149. package/rulepacks/jetwc-lib/jetwcutils-preCompiler.js +0 -6
  150. package/rules/jet/oj-html-combo-converter.js +0 -6
  151. package/rules/jet/oj-tsx-combo-converter.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
- const path=require("path");const Utils=require("../jetwc-lib/jetwcutils-componentAuditUtils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwco-license-info"};ruleDef.prototype.getShortDescription=function(){return"Validate License Information"};ruleDef.prototype.getDescription=function(){return"This rule is checks that a license file (LICENSE.txt) or URL is supplied, and third party license (THIRD_PARTY_LICENSE.txt) file is present if required"};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){const msg=context.utils.msgLib;const componentMetadata=context.suppData.obj;const rulePackState=context.rulePack.getExtension();if(componentMetadata){let issue;let licenseFileFound=false;let isInMonoPack=Utils.isMonoPackMember(context,componentMetadata);;let licenseURL;let licenseCandidate="LICENSE.txt";const compRootFiles=context.utils.fsUtils.readDir(path.dirname(context.filepath));for(let i=0;i<compRootFiles.length;i++){const rootEntry=compRootFiles[i];if(rootEntry.isFile&&rootEntry.name===licenseCandidate){licenseFileFound=true;break}}if(componentMetadata.hasOwnProperty("license")&&typeof componentMetadata.license==="string"){licenseURL=componentMetadata.license}if(!isInMonoPack&&!licenseFileFound&&!licenseURL){issue=new context.Issue(`Component is missing license information. There should either be a 'LICENSE.txt' file (case sensitive) in the root, or a license attribute in the component metadata.`);issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context)}if(licenseURL){const allowedLicenses=context.rulePack.getRuleOptions().allowedLicenseURLs;if(Array.isArray(allowedLicenses)&&allowedLicenses.length>0){if(!allowedLicenses.includes(licenseURL)){issue=new context.Issue(`Component license metadata value does not specified one of the allowed values: ${allowedLicenses.join(", ")}`);issue.setMsgKey(context.ruleName+"_3");context.reporter.addIssue(issue,context)}}}let thirdPartyScan=false;if(componentMetadata.type&&componentMetadata.type==="reference"){thirdPartyScan=true}else{if(componentMetadata.dependencies){if(rulePackState.allReferenceComponents){Object.keys(componentMetadata.dependencies).forEach(dependency=>{if(rulePackState.allReferenceComponents.has(dependency)){thirdPartyScan=true}})}else{msg.error("JETWC: Unable to scan for reference component dependencies - JETWC-BOOTSTRAP was not run")}}}if(thirdPartyScan){licenseFileFound=false;licenseCandidate="THIRD_PARTY_LICENSE.txt";for(let i=0;i<compRootFiles.length;i++){const rootEntry=compRootFiles[i];if(rootEntry.isFile&&rootEntry.name===licenseCandidate){licenseFileFound=true;break}}if(!licenseFileFound){issue=new context.Issue(`Component with third party dependencies is missing 3rd party license information file in root, 'THIRD_PARTY_LICENSE.txt' is expected (case sensitive)`);issue.setMsgKey(context.ruleName+"_2");context.reporter.addIssue(issue,context)}}}};module.exports=ruleDef;
6
+ const path=require("path");const Utils=require("../jetwc-lib/jetwcutils-componentAuditUtils");const TsxUtils=require("../jetwc-lib/jetwcutils-tsxUtils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwco-license-info"};ruleDef.prototype.getShortDescription=function(){return"Validate License Information"};ruleDef.prototype.getDescription=function(){return"This rule is checks that a license file (LICENSE.txt) or URL is supplied, and third party license (THIRD_PARTY_LICENSE.txt) file is present if required"};ruleDef.prototype.register=function(context){return{compjson:this._doAudit,Program:this._doVComponentAudit}};ruleDef.prototype._doAudit=function(context){const componentMetadata=context.suppData.obj;this._checkLicense(context,componentMetadata)};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);this._checkLicense(context,componentInfo)};ruleDef.prototype._checkLicense=function(context,componentMetadata){const msg=context.utils.msgLib;const rulePackState=context.rulePack.getExtension();if(componentMetadata){let issue;let licenseFileFound=false;let isInMonoPack=Utils.isMonoPackMember(context,componentMetadata);;let licenseURL;let licenseCandidate="LICENSE.txt";const compRootFiles=context.utils.fsUtils.readDir(path.dirname(context.filepath));for(let i=0;i<compRootFiles.length;i++){const rootEntry=compRootFiles[i];if(rootEntry.isFile&&rootEntry.name===licenseCandidate){licenseFileFound=true;break}}if(componentMetadata.hasOwnProperty("license")&&typeof componentMetadata.license==="string"){licenseURL=componentMetadata.license}if(!isInMonoPack&&!licenseFileFound&&!licenseURL){issue=new context.Issue(`Component is missing license information. There should either be a 'LICENSE.txt' file (case sensitive) in the root, or a license attribute in the component metadata.`);issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context)}if(licenseURL){const customOpts=context.rulePack.getRuleOptions().customOpts;const allowedLicenses=customOpts.allowedLicenseURLs;if(Array.isArray(allowedLicenses)&&allowedLicenses.length>0){if(!allowedLicenses.includes(licenseURL)){issue=new context.Issue(`Component license metadata value does not specified one of the allowed values: ${allowedLicenses.join(", ")}`);issue.setMsgKey(context.ruleName+"_3");context.reporter.addIssue(issue,context)}}}let thirdPartyScan=false;if(componentMetadata.type&&componentMetadata.type==="reference"){thirdPartyScan=true}else{if(componentMetadata.dependencies){if(rulePackState.allReferenceComponents){Object.keys(componentMetadata.dependencies).forEach(dependency=>{if(rulePackState.allReferenceComponents.has(dependency)){thirdPartyScan=true}})}else{msg.error("JETWC: Unable to scan for reference component dependencies - JETWC-BOOTSTRAP was not run")}}}if(thirdPartyScan){licenseFileFound=false;licenseCandidate="THIRD_PARTY_LICENSE.txt";for(let i=0;i<compRootFiles.length;i++){const rootEntry=compRootFiles[i];if(rootEntry.isFile&&rootEntry.name===licenseCandidate){licenseFileFound=true;break}}if(!licenseFileFound){issue=new context.Issue(`Component with third party dependencies is missing 3rd party license information file in root, 'THIRD_PARTY_LICENSE.txt' is expected (case sensitive)`);issue.setMsgKey(context.ruleName+"_2");context.reporter.addIssue(issue,context)}}}};module.exports=ruleDef;
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, 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 TsxUtils=require("../jetwc-lib/jetwcutils-tsxUtils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwco-validate-applied-audits"};ruleDef.prototype.getShortDescription=function(){return"Validate Applied Audits"};ruleDef.prototype.getDescription=function(){return"This rule checks that any applied-audits defined by a component are actually valid in the context of the available rule-packs"};ruleDef.prototype.register=function(context){return{startup:this._setupRuleBasis,compjson:this._doAudit,Program:this._doVComponentAudit}};ruleDef.prototype._setupRuleBasis=function(context){this.validRuleNames=this._extractValidRuleNames(context);if(this.validRuleNames.size===0){context.utils.msgLib.error("Configuration for jetwco-validate-applied-audits is in error, the supplied value for \"auditRuleBundles\" does not yield any rules");return false}else{context.utils.msgLib.info(`jetwco-validate-applied-audits is using the following audit names for validation:\n${[...this.validRuleNames.keys()].join(", ")}`);return true}};ruleDef.prototype._doAudit=function(context){const componentMetadata=context.suppData.obj;this._checkAppliedAudits(context,componentMetadata)};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);this._checkAppliedAudits(context,componentInfo)};ruleDef.prototype._checkAppliedAudits=function(context,componentMetadata){if(componentMetadata?.extension?.catalog?.appliedAudits){componentMetadata.extension.catalog.appliedAudits.forEach(namedRule=>{if(!this.validRuleNames.has(namedRule?.auditName)){issue=new context.Issue(`The named applied audit "${namedRule.auditName}" does not exist in the specified audit rule pack(s)`);issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context)}})}};ruleDef.prototype._extractValidRuleNames=function(context){const ruleBundles=context.rulePack.getRuleOption("auditRuleBundles");const flattenedRuleNames=new Set;if(Array.isArray(ruleBundles)&&ruleBundles.length>0){ruleBundles.forEach(bundle=>{if(context.utils.fsUtils.fileExistsSync(bundle)){const ruleBundleDef=context.utils.fsUtils.readJsonSync(bundle,true);if(ruleBundleDef.rules){Object.keys(ruleBundleDef.rules).forEach(ruleName=>{flattenedRuleNames.add(ruleName)})}}})}return flattenedRuleNames};module.exports=ruleDef;
@@ -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
- {"jetwco-component-cdn":"0001","jetwco-license-info_1":"0002","jetwco-license-info_2":"0003","jetwco-license-info_3":"0050","jetwco-prerelease-cdn":"0004","jetwco-thirdparty-ba_1":"0005","jetwco-thirdparty-ba_2":"0006","jetwco-thirdparty-ba_3":"0007","jetwco-thirdparty-ba_4":"0008","jetwco-exchange-version-check_1":"0009","jetwco-exchange-version-check_2":"0010","jetwco-exchange-version-check_3":"0014","jetwco-component-api-changes_1":"0011","jetwco-component-api-changes_2":"0015","jetwco-compjson-ns-reg":"0012","jetwco-component-api-baseline-changes_1":"0013","jetwco-component-api-baseline-changes_2":"0016","jetwco-displayname-standards_1":"0020","jetwco-displayname-standards_2":"0021","jetwco-description-standards_1":"0030","jetwco-description-standards_2":"0031","jetwco-description-standards_3":"0032","jetwco-component-api-controlled-changes_1":"0040","jetwco-component-api-controlled-changes_2":"0041"}
6
+ {"jetwco-component-cdn":"0001","jetwco-license-info_1":"0002","jetwco-license-info_2":"0003","jetwco-license-info_3":"0050","jetwco-prerelease-cdn":"0004","jetwco-thirdparty-ba_1":"0005","jetwco-thirdparty-ba_2":"0006","jetwco-thirdparty-ba_3":"0007","jetwco-thirdparty-ba_4":"0008","jetwco-exchange-version-check_1":"0009","jetwco-exchange-version-check_2":"0010","jetwco-exchange-version-check_3":"0014","jetwco-component-api-changes_1":"0011","jetwco-component-api-changes_2":"0015","jetwco-compjson-ns-reg":"0012","jetwco-component-api-baseline-changes_1":"0013","jetwco-component-api-baseline-changes_2":"0016","jetwco-displayname-standards_1":"0020","jetwco-displayname-standards_2":"0021","jetwco-description-standards_1":"0030","jetwco-description-standards_2":"0031","jetwco-description-standards_3":"0032","jetwco-component-api-controlled-changes_1":"0040","jetwco-component-api-controlled-changes_2":"0041","jetwco-validate-applied-audits_1":"0050"}
@@ -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.16.2","rules":{"jetwco-bootstrap":{"group":"jetwco-do-not-disable","enabled":true,"severity":"info","debug":false,"diagnosticFile":"jetwco-diagnostics","auditBuildOutput":false,"testMode":false,"filetype":["tsx","css","html","js","json","md","ts"],"$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,"allowedLicenseURLs":[]},"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,"status":"deprecated"},"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,"status":"deprecated"},"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,"tolerantAPICompare":false,"amd":false}}}
6
+ {"title":"Oracle Internal Audit Rules for JET Custom Component Authors","prefix":"JETWCO","version":"1.17.1","rules":{"jetwco-bootstrap":{"group":"jetwco-do-not-disable","enabled":true,"severity":"info","debug":false,"diagnosticFile":"jetwco-diagnostics","auditBuildOutput":false,"testMode":false,"filetype":["tsx","css","html","js","json","md","ts"],"$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,"allowedLicenseURLs":[]},"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,"status":"deprecated"},"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,"status":"deprecated"},"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,"tolerantAPICompare":false,"amd":false},"jetwco-validate-applied-audits":{"group":"jetwco-pre-release","enabled":false,"severity":"blocker","filetype":["json","tsx"],"amd":false,"auditRuleBundles":[]}}}
@@ -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
- {"ojc-acc-avatar-aria-role":"0001","ojc-acc-filepicker-aria-role":"0005"}
6
+ {"ojc-acc-avatar-aria-role":"0001","ojc-acc-filepicker-aria-role":"0005","ojc-html-button-defslot":"0010","ojc-html-button-defslot_1":"0011","ojc-tsx-button-defslot":"0015","ojc-tsx-button-defslot_1":"0016"}
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, 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="ojc-html-button-defslot";const DESCRIPTION="There is no default slot for <oj-c-button>. If it has been used to label the button, "+"the 'label' attribute should be used.";const SHORT_DESCRIPTION="There is no default slot for <oj-c-button>.";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-c-button>":this._onBtn}}_onBtn(ruleCtx){let nodes;if((nodes=ruleCtx.tagNode.children)&&nodes.length){for(let node of nodes){if(node.type==="tag"){if(!ruleCtx.utils.DomUtils.getAttribValue(node,"slot")){this._emitIssue(ruleCtx,1);return}}else if(node.type==="text"&&node.data.trim().length){this._emitIssue(ruleCtx,2);return}}}}_emitIssue(ruleCtx,msgType){let msg=msgType===1?"<oj-c-button> cannot use the default slot.":"<oj-c-button> cannot use the default slot as a label. Use the 'label' attribute.";let issue=new ruleCtx.Issue(msg);if(msgType===2){issue.setMsgKey(RULENAME+"_1")}ruleCtx.reporter.addIssue(issue,ruleCtx)}}module.exports=Rule;
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, 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="ojc-tsx-button-defslot";const DESCRIPTION="<oj-c-button> does not have a default slot defined for it. (To label a button the 'label' property should be used.";const SHORT_DESCRIPTION="There is no default slot for <oj-c-button>.";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._tsxUtils=regCtx.utils.tsxUtils;return{"Tsx<oj-c-button>":this._onBtn}}_onBtn(ruleCtx,tsxComp){var nodes,node;if((nodes=this._tsxUtils.getChildren(tsxComp))&&nodes.length){for(node of nodes){if(!this._tsxUtils.getPropertyValue(node,"slot")){this._emitIssue(ruleCtx,1);return}}}if(nodes=tsxComp.node.children){for(node of nodes){if(node.type==="JSXText"&&node.value.trim().length){this._emitIssue(ruleCtx,2);break}}}}_emitIssue(ruleCtx,msgType){let msg=msgType===1?"<oj-c-button> cannot use the default slot.":"<oj-c-button> cannot use the default slot as a label. Use the 'label' attribute.";let issue=new ruleCtx.Issue(msg);if(msgType===2){issue.setMsgKey(RULENAME+"_1")}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
- {"title":"JET Core Pack Built-in Rulepack","version":"1.0.0","prefix":"OJC","rules":{"ojc-acc-avatar-aria-role":{"severity":"blocker","filetype":"html","group":"jet-aria","jetver":">=13.0.0","status":"production"},"ojc-acc-filepicker-aria-role":{"severity":"blocker","filetype":"html","group":"jet-aria","jetver":">=13.0.0","status":"production"}}}
6
+ {"title":"JET Core Pack Built-in Rulepack","version":"1.1.0","prefix":"OJC","rules":{"ojc-acc-avatar-aria-role":{"severity":"blocker","filetype":"html","group":"jet-aria","jetver":">=13.0.0","status":"production"},"ojc-acc-filepicker-aria-role":{"severity":"blocker","filetype":"html","group":"jet-aria","jetver":">=13.0.0","status":"production"},"ojc-html-button-defslot":{"severity":"blocker","filetype":"html","group":["jet-html"],"jetver":">=13.0.0","status":"production"},"ojc-tsx-button-defslot":{"severity":"blocker","filetype":"tsx","group":["jet-tsx"],"amd":false,"status":"production"}}}
@@ -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
- function getName(){return"jaf-css-diagnose"};function getShortDescription(){return"Handle CSS syntax exceptions"};function getDescription(){return"While processing CSS, an exception has occurred, and is probably the result of a syntax specification error. Review the CSS for invalid syntax."};module.exports={getName,getDescription,getShortDescription};
6
+ const LONG="While processing CSS, an exception has occurred, and is probably the result of a syntax specification error. Review the CSS for invalid syntax.";function getName(){return"jaf-css-diagnose"};function getShortDescription(){return"Handle CSS syntax exceptions"};function getDescription(){return LONG};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
- function getName(){return"jaf-js-diagnose"};function getShortDescription(){return"Handle Javascript syntax exceptions"};function getDescription(){return"While processing JavaScript, an exception has occurred, and is probably the result of a syntax specification error. Review the Javascript for invalid syntax."};module.exports={getName,getDescription,getShortDescription};
6
+ const LONG="While processing JavaScript, an exception has occurred, and is probably the result of a syntax specification error. Review the Javascript for invalid syntax.";function getName(){return"jaf-js-diagnose"};function getShortDescription(){return"Handle Javascript syntax exceptions"};function getDescription(){return LONG};module.exports={getName,getDescription,getShortDescription};
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, 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="While processing the JAF configuration 'components' declaration during start-up, JAF has detected that a "+"component has been declared more than once. The first declaration's metadata is accepted, and any subsequemt "+"declaration is discarded.";const SHORT="A web component has been declared one or more times.";function getName(){return"jaf-sys-dup-component"}function getDescription(){return LONG}function getShortDescription(){return SHORT}module.exports={getName,getDescription,getShortDescription};
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, 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="When declaring a custom rule option in a custom (i.e. a user-written) rule in a rule pack's "+"manifest file rules.json, it must NOT be declared at the top-level. It should, instead, be "+"declared in the top-level property object 'customOpts' to avoid potential naming collisions with JAF options.\n"+"The ability to declare custom rule properties at the top-level was deprecated in JAF 5.11.0. "+"For compatibility, this will still work in JAF versions 5.11.0 or later, and a 'customOpts' property "+"is created for you during start-up - any user options found are moved into it and flagged "+"as warnings. However, in JET 16, this compatibility will end, and any user options found "+"at the top-level will be flagged as errors, and use of 'customOpts' will be mandatory.";const SHORT="User-declared rule properties must be declared in the 'customOpts' top-level property.";function getName(){return"jaf-sys-rule-opt"}function getDescription(){return LONG}function getShortDescription(){return SHORT}module.exports={getName,getDescription,getShortDescription};
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, 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-precompile"};function getShortDescription(){return"Handle TypeScript precompilation error"};function getDescription(){return"During the JAF preprocess phase to determine if VComponent compilation has produced component metadata, the TypeScript compiler emitted one or more errors."};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-ts-walk":"1007","jaf-css-diagnose":"1010","jaf-html-diagnose":"1020","jaf-ts-noparser":"1999","jaf-init-schema":"2000","jaf-sys-age":"9100"}
6
+ {"jaf-js-diagnose":"1000","jaf-ts-diagnose":"1005","jaf-ts-walk":"1007","jaf-css-diagnose":"1010","jaf-html-diagnose":"1020","jaf-ts-precompile":"1025","jaf-ts-noparser":"1999","jaf-init-schema":"2000","jaf-sys-rule-opt":"2005","jaf-sys-dup-component":"2010","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.2.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-noparser":{"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}}}
6
+ {"title":"JAF System Rules","version":"1.3.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-precompile":{"severity":"blocker","filetype":["ts"],"group":["jaf-ts"],"status":"production","$internal":true},"jaf-ts-noparser":{"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-rule-opt":{"severity":"major","filetype":["html"],"group":["jaf-sys"],"status":"production","$internal":true},"jaf-sys-dup-component":{"severity":"major","filetype":["html"],"group":["jaf-sys"],"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 TEMPLATE="template";const OJ_BIND="oj-bind";const OJ_DEFER="oj-defer";const BODY="body";module.exports=function(ruleCtx,slotName){return _getSlotParent(ruleCtx,slotName)};function _getSlotParent(ruleCtx,slotName){var parent,isOjDefer=false,ret=null;parent=ruleCtx.tagNode.parent;isOjDefer=ruleCtx.tag==="oj-defer";if(parent?.name){if(parent.name!==BODY){if(ruleCtx.utils.DomUtils.isSelfClosingTag(parent.name)){ret=_continueUpwards(ruleCtx,parent,slotName)}else{if(ruleCtx.utils.metaLib.isTagSlotName(parent.name,slotName)){ret=parent}}if(!ret){if(isOjDefer&&parent.name===TEMPLATE||parent.name==="oj-switcher"){ret=parent}else if(parent.name===TEMPLATE||parent.name.startsWith(OJ_BIND)||parent.name===OJ_DEFER){ret=_continueUpwards(ruleCtx,parent,slotName)}}}}return ret};function _continueUpwards(ruleCtx,tag,slotName){var ret=null,parent;parent=tag.parent;while(parent?.name){if(parent.name===TEMPLATE||parent.name.startsWith(OJ_BIND)||parent.name===OJ_DEFER||ruleCtx.utils.DomUtils.isSelfClosingTag(parent.name)){parent=parent.parent;continue}if(parent.name!==BODY){if(ruleCtx.utils.metaLib.isTagSlotName(parent.name,slotName)){ret=parent}}break}return ret};
6
+ const TEMPLATE="template";const OJ_BIND="oj-bind";const OJ_DEFER="oj-defer";const BODY="body";module.exports=function(ruleCtx,slotName){return _getSlotParent(ruleCtx,slotName)};function _getSlotParent(ruleCtx,slotName){var parent,isOjDefer=false,ret=null;parent=ruleCtx.tagNode.parent;isOjDefer=ruleCtx.tag==="oj-defer";if(parent?.name&&parent.name!==BODY){if(ruleCtx.utils.DomUtils.isSelfClosingTag(parent.name)){ret=_continueUpwards(ruleCtx,parent,slotName)}else if(ruleCtx.utils.metaLib.isTagSlotName(parent.name,slotName)||ruleCtx.utils.metaLib.hasTagDynamicSlot(parent.name)){ret=parent}if(!ret){if(isOjDefer&&parent.name===TEMPLATE||parent.name==="oj-switcher"){ret=parent}else if(parent.name===TEMPLATE||parent.name.startsWith(OJ_BIND)||parent.name===OJ_DEFER){ret=_continueUpwards(ruleCtx,parent,slotName)}}}return ret};function _continueUpwards(ruleCtx,tag,slotName){var ret=null,parent;parent=tag.parent;while(parent?.name){if(parent.name===TEMPLATE||parent.name.startsWith(OJ_BIND)||parent.name===OJ_DEFER||ruleCtx.utils.DomUtils.isSelfClosingTag(parent.name)){parent=parent.parent;continue}if(parent.name!==BODY){if(ruleCtx.utils.metaLib.isTagSlotName(parent.name,slotName)||ruleCtx.utils.metaLib.hasTagDynamicSlot(parent.name)){ret=parent}}break}return ret};
@@ -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-wctag-maintenance":"0014","oj-html-wctag-supersedes":"0015","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-cca-count_1":"0271","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-wctag-$props_2":"0362","oj-html-wctag-$props_3":"0363","oj-html-form-bindif":"0370","oj-html-combo-converter":"0380","oj-html-ojtag-ns":"0385","oj-html-ojtag-ns_1":"0386","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":"0505","oj-html-no-style-tag":"0505","oj-html-alta-deprecated":"0510","oj-html-rating-gauge-size":"0520","oj-html-rating-gauge-track-resize":"0525","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-acc-button-onclick":"2180","oj-html-cca-tagname":"2200","oj-html-cca-tagname_1":"2201","oj-html-attr-expr-delims":"2211","oj-html-tabbar-edge":"2215","oj-html-tabbar-edge_1":"2216","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-ts-numconv-pattern":"3470","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-js-numconv-pattern":"5830","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-tsx-wctag-packprivate":"7000","oj-tsx-ojtag-deprecated":"7010","oj-tsx-ojtag-deprecated_1":"7011","oj-tsx-cca-tagname":"7015","oj-tsx-cca-tagname_1":"7016","oj-tsx-ojattr":"7020","oj-tsx-ojattr_1":"7021","oj-tsx-ojattr_2":"7022","oj-tsx-ojattr-value":"7025","oj-tsx-attr-req":"7030","oj-tsx-5-tag-obs":"7035","oj-tsx-prop-inline-definition":"7040","oj-tsx-combo-converter":"7045","oj-tsx-aria-ojselector-labelledby":"7050","oj-tsx-aria-prop":"7055","oj-tsx-rating-gauge-size":"7060","oj-tsx-input-isodate":"7065","oj-tsx-input-isodate_1":"7066","oj-tsx-input-isodate_2":"7067","oj-tsx-input-isodate_3":"7068","oj-tsx-input-isodate_4":"7069","oj-tsx-input-isodate_5":"7070","oj-tsx-input-isodate_6":"7071","oj-tsx-input-isodate_7":"7072","oj-tsx-input-isodate_8":"7073","oj-tsx-input-isodate_9":"7074","oj-tsx-unsup-theme":"7080","oj-tsx-unsup-theme_1":"7081","oj-tsx-pageopts-type":"7085","oj-tsx-pageopts-type_1":"7086","oj-tsx-pageopts-type_2":"7087","oj-tsx-pageopts-type_3":"7088","oj-tsx-picker-attrs":"7090","oj-tsx-wctag-nested":"7095","oj-tsx-dlg-title":"7100","oj-tsx-acc-button-onclick":"7105","oj-tsx-acc-avatar-aria-role":"7110","oj-tsx-databind-all":"7115","oj-tsx-wctag-maintenance":"7120","oj-tsx-slot-deprecated":"7125","oj-tsx-ojattr-deprecated":"7130","oj-tsx-ojattr-deprecated_1":"7131","oj-tsx-jsx-prop":"7135","oj-tsx-jsx-prop_1":"7136","oj-tsx-form-bindif":"7140","oj-tsx-form-noflex":"7145","oj-tsx-rating-gauge-track-resize":"7150","oj-tsx-slot-pref-content":"7155","oj-tsx-ojtag-ns":"7160","oj-tsx-ojtag-ns_1":"7161","oj-tsx-ojattr-enum-deprecated":"7165","oj-tsx-tabbar-edge":"7170","oj-tsx-tabbar-edge_1":"7171","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"}
6
+ {"oj-html-ojtag-deprecated":"0010","oj-html-ojtag-deprecated_user":"0011","oj-html-wctag-maintenance":"0014","oj-html-wctag-supersedes":"0015","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-ojattr-enum-deprecated_user":"0086","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-deprecated_user":"0146","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-cca-count_1":"0271","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-wctag-$props_2":"0362","oj-html-wctag-$props_3":"0363","oj-html-form-bindif":"0370","oj-html-ojtag-ns":"0385","oj-html-ojtag-ns_1":"0386","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":"0505","oj-html-no-style-tag":"0505","oj-html-alta-deprecated":"0510","oj-html-rating-gauge-size":"0520","oj-html-rating-gauge-track-resize":"0525","oj-html-slot-default":"0530","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-acc-button-onclick":"2180","oj-html-cca-tagname":"2200","oj-html-cca-tagname_1":"2201","oj-html-attr-expr-delims":"2211","oj-html-tabbar-edge":"2215","oj-html-tabbar-edge_1":"2216","oj-html-wctag-anti-pattern":"2220","oj-html-prop-anti-pattern":"2225","oj-html-prop-anti-pattern_1":"2226","oj-html-attr-expr-writeback":"2235","oj-html-event-focus-blur":"2240","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-ts-numconv-pattern":"3470","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-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-deprecated_user":"5814","oj-html-ojattr-deprecated_1_user":"5815","oj-html-ojattr-deprecated_2_user":"5816","oj-html-ojattr-deprecated_3_user":"5817","oj-html-ojattr-enum-deprecated_aged":"5820","oj-html-alta-deprecated_aged":"5825","oj-js-numconv-pattern":"5830","oj-html-treeview-actionable-content":"5835","oj-html-binding-as-slot-child":"5840","oj-html-binding-as-slot-child_1":"5841","oj-tsx-ojtag-deprecated_aged":"5845","oj-tsx-slot-deprecated_aged":"5850","oj-tsx-ojattr-enum-deprecated_aged":"5855","oj-tsx-ojattr-deprecated_aged":"5860","oj-tsx-ojattr-deprecated_1_aged":"5861","oj-tsx-ojattr-deprecated_2_aged":"5862","oj-tsx-ojattr-deprecated_3_aged":"5863","oj-tsx-ojattr-deprecated_user":"5870","oj-tsx-ojattr-deprecated_1_user":"5871","oj-tsx-ojattr-deprecated_2_user":"5872","oj-tsx-ojattr-deprecated_3_user":"5873","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-tsx-wctag-packprivate":"7000","oj-tsx-ojtag-deprecated":"7010","oj-tsx-ojtag-deprecated_user":"7011","oj-tsx-cca-tagname":"7015","oj-tsx-cca-tagname_1":"7016","oj-tsx-ojattr":"7020","oj-tsx-ojattr_1":"7021","oj-tsx-ojattr_2":"7022","oj-tsx-ojattr-value":"7025","oj-tsx-attr-req":"7030","oj-tsx-5-tag-obs":"7035","oj-tsx-prop-inline-definition":"7040","oj-tsx-aria-ojselector-labelledby":"7050","oj-tsx-aria-prop":"7055","oj-tsx-rating-gauge-size":"7060","oj-tsx-input-isodate":"7065","oj-tsx-input-isodate_1":"7066","oj-tsx-input-isodate_2":"7067","oj-tsx-input-isodate_3":"7068","oj-tsx-input-isodate_4":"7069","oj-tsx-input-isodate_5":"7070","oj-tsx-input-isodate_6":"7071","oj-tsx-input-isodate_7":"7072","oj-tsx-input-isodate_8":"7073","oj-tsx-input-isodate_9":"7074","oj-tsx-unsup-theme":"7080","oj-tsx-unsup-theme_1":"7081","oj-tsx-pageopts-type":"7085","oj-tsx-pageopts-type_1":"7086","oj-tsx-pageopts-type_2":"7087","oj-tsx-pageopts-type_3":"7088","oj-tsx-picker-attrs":"7090","oj-tsx-wctag-nested":"7095","oj-tsx-dlg-title":"7100","oj-tsx-acc-button-onclick":"7105","oj-tsx-acc-avatar-aria-role":"7110","oj-tsx-databind-all":"7115","oj-tsx-wctag-maintenance":"7120","oj-tsx-slot-deprecated":"7125","oj-tsx-slot-deprecated_user":"7126","oj-tsx-ojattr-deprecated":"7130","oj-tsx-ojattr-deprecated_1":"7131","oj-tsx-ojattr-deprecated_2":"7132","oj-tsx-ojattr-deprecated_3":"7133","oj-tsx-jsx-prop":"7135","oj-tsx-jsx-prop_1":"7136","oj-tsx-form-bindif":"7140","oj-tsx-form-noflex":"7145","oj-tsx-rating-gauge-track-resize":"7150","oj-tsx-slot-pref-content":"7155","oj-tsx-slot-pref-content_1":"7156","oj-tsx-ojtag-ns":"7160","oj-tsx-ojtag-ns_1":"7161","oj-tsx-ojattr-enum-deprecated":"7165","oj-tsx-ojattr-enum-deprecated_user":"7166","oj-tsx-tabbar-edge":"7170","oj-tsx-tabbar-edge_1":"7171","oj-tsx-wctag-anti-pattern":"7175","oj-tsx-prop-anti-pattern":"7180","oj-tsx-prop-anti-pattern_1":"7181","oj-tsx-treeview-actionable-content":"7185","oj-tsx-popup-sibling":"7190","oj-tsx-event":"7195","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"}
@@ -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=[],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;
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(regCtx){if(regCtx.rulePack.isRuleEnabled("jetwc-jet-version","JETWC")){return false}else 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 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;
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)}}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;
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, 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-attr-expr-writeback";const SHORT="An attribute expression uses write-back syntax (\"{{...}}\" but the attribute metadata does not support write-back.";const LONG=SHORT+"\n"+"Note that although technically incorrect, functionally there is no harm incurred by using the wrong style of binding notation for a read-only property "+"except for a theoretical performance penalty (minimal).";class Rule{getName(){return RULENAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(regCtx){this._metaLib=regCtx.utils.metaLib;return{attrexpr:this._onExpr}}_onExpr(ruleCtx,attrib,attrValue){var tag=ruleCtx.tagNode.name;if(this._metaLib.isTagAttr(tag,attrib)){if(attrValue.startsWith("{")){if(!ruleCtx.utils.metaLib.isTagAttrWriteback(tag,attrib)){let issue=new ruleCtx.Issue(`<${tag}> attribute '${attrib}' uses a writeback expression, but attribute writeback is not enabled. Replace wih "[[ . . .]]"`);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}}module.exports=Rule;
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, 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-binding-as-slot-child";const DESCRIPTION="JET binding components such as <oj-bind-if> are not present in the final browser "+"DOM at runtime, and as such will not function correctly when directly assigned to "+"a slot. They should always be wrapped in another element such as a <div> or <span> "+"which has the slot attribute applied.<br>";const SHORT_DESCRIPTION="The slot attribute should not be applied directly to JET binding components";const SLOT="slot";const TEMPLATE="template";const OJ_BIND="oj-bind";const OJ_OPTION="oj-option";const BODY="body";const EXCEPTION_TAGS=["oj-accordion","oj-buttonset-many","oj-buttonset-one","oj-checkboxset","oj-combobox-many","oj-combobox-one","oj-film-strip","oj-form-layout","oj-list-item-layout","oj-masonry-layout","oj-menu","oj-menu-select-many","oj-optgroup","oj-radioset","oj-select-many","oj-select-single","oj-toolbar","oj-validation-group","template"];class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._metaLib=regCtx.utils.metaLib;return{bindingtag:this._onBind}}_onBind(ruleCtx){var attribs,attrib,node,parent,name;node=ruleCtx.tagNode;if(attribs=node.attribs){for(attrib in attribs){if(attrib===SLOT){this._emitIssue(1,ruleCtx,node.name);break}}}if(parent=this._getParentElem(node,ruleCtx)){name=parent.name;if(name===OJ_OPTION){if(parent?.parent?.name===TEMPLATE){return}}if(EXCEPTION_TAGS.includes(name)){return}if(this._metaLib.isWCTag(name)&&this._metaLib.hasTagDefaultSlot(name)){this._emitIssue(2,ruleCtx,node.name,name)}}}_getParentElem(node,ruleCtx){var parent,name;if(node&&(parent=node.parent)){if(name=parent.name){if(name.startsWith(OJ_BIND)||name===TEMPLATE||ruleCtx.utils.DomUtils.isSelfClosingTag(name)){return this._getParentElem(parent,ruleCtx)}if(name===BODY){return null}}return parent}return null}_emitIssue(msgType,ruleCtx,tagName,parentName){var issue;if(msgType===1){issue=new ruleCtx.Issue(`The slot attribute must not be applied directly on a <${tagName}> : wrap it in a <div> or <span> and apply the slot attribute to that.`)}else if(msgType===2){issue=new ruleCtx.Issue(`If <${tagName}> is used as the direct child of <${parentName}>, then <${parentName}> may not reflect updates to the bound value unless the <${tagName}> is enclosed in a DOM element such as <div> or <span>.`);issue.setMsgKey(RULENAME+"_1");issue.setSeverity("info")}ruleCtx.reporter.addIssue(issue,ruleCtx)}}module.exports=Rule;
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, 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-event-focus-blur";const SHORT_DESCRIPTION="JET Core-Pack components do not dispatch focus or blur events.";const DESCRIPTION=SHORT_DESCRIPTION+" Listen for focusin and focusout events instead.";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._metaLib=regCtx.utils.metaLib;return{"<on-blur=>":this._onEvent,"<on-focus=>":this._onEvent}}_onEvent(ruleCtx,evName){if(this._metaLib.isCoreTag(ruleCtx.tagNode.name)){let suggest="on-focus"+(evName==="on-blur"?"out":"in");let issue=new ruleCtx.Issue(`Event attribute '${evName}' found on JET Core component <${ruleCtx.tagNode.name}> - use '${suggest}'`);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 RULENAME="oj-html-form-bindif";const DESCRIPTION="<oj-form-layout> is meant to have static content only. The use of <oj-bind-for-each> or <oj-bind-if> is not supported";const SHORT_DESCRIPTION="The use of <oj-bind-for-each> or <oj-bind-if> inside <oj-form-layout> is not supported";const OJ_BIND_IF="oj-bind-if";const OJ_BIND_FOR_EACH="oj-bind-for-each";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-form-layout>":this._onForm}}_onForm(ruleCtx){let node=ruleCtx.tagNode;let attribs=node.attribs;if(this._attrVal(attribs,"direction")!=="column"){let maxcol=this._attrVal(attribs,"max-columns");if(isNaN(maxcol)||maxcol>1){this._walkDomChildren(ruleCtx,node)}}}_emit(ruleCtx,node){let issue=new ruleCtx.Issue(`<oj-form-layout> is meant to have static content only. The use of <${node.name}> is not supported`);issue.setPosition(null,null,node.startIndex+1,node.startIndex+node.name.length);ruleCtx.reporter.addIssue(issue,ruleCtx)}_walkDomChildren(ruleCtx,node){var ch,n,i,ok=true;;ch=node.children;if(ch){for(i=0;i<ch.length;i++){n=ch[i];if(n.type==="tag"){if(n.name===OJ_BIND_FOR_EACH){ok=false;this._emit(ruleCtx,n)}else if(n.name===OJ_BIND_IF){if(n.children&&n.children.length>1){ok=false;this._emit(ruleCtx,n)}}}}}return ok}_attrVal(attribs,attr){var v=attribs[attr];switch(attr){case"max-columns":v=parseInt(v);break}return v}}module.exports=Rule;
6
+ const RULENAME="oj-html-form-bindif";const DESCRIPTION="<oj-form-layout> is meant to have static content only. The use of <oj-bind-for-each> or <oj-bind-if> is not supported.<p>"+"The problem with using oj-bind-if (and oj-for-each) inside a form layout, is that the layout will not be refreshed if "+"its child DOM changes after instantiation (unless the refresh() method on the layout is called). This can result in the "+"layout not managing multiple columns correctly and is therefore not supported.<p>"+"If the <oj-bind-if> evaluation is fully resolved and will not change before the form is rendered, there will be no problem. "+"Similarly, if the form has only one column of fields, there is unlikely to be any visible issue. "+"If there is the possibility that the expression used to control the bind-if is going to change, then the solution is to put "+"the <oj-form-layout> inside the <oj-bind-if> (i.e. split the form layout into multiple layouts and control each as a unit).";const SHORT_DESCRIPTION="The use of <oj-bind-for-each> or <oj-bind-if> inside <oj-form-layout> is not supported";const OJ_BIND_IF="oj-bind-if";const OJ_BIND_FOR_EACH="oj-bind-for-each";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-form-layout>":this._onForm}}_onForm(ruleCtx){let node=ruleCtx.tagNode;let attribs=node.attribs;if(this._attrVal(attribs,"direction")!=="column"){let maxcol=this._attrVal(attribs,"max-columns");if(isNaN(maxcol)||maxcol>1){this._walkDomChildren(ruleCtx,node)}}}_emit(ruleCtx,node){let issue=new ruleCtx.Issue(`<oj-form-layout> is meant to have static content only. The use of <${node.name}> is not supported`);issue.setPosition(null,null,node.startIndex+1,node.startIndex+node.name.length);ruleCtx.reporter.addIssue(issue,ruleCtx)}_walkDomChildren(ruleCtx,node){var ch,n,i,ok=true;;ch=node.children;if(ch){for(i=0;i<ch.length;i++){n=ch[i];if(n.type==="tag"){if(n.name===OJ_BIND_FOR_EACH){ok=false;this._emit(ruleCtx,n)}else if(n.name===OJ_BIND_IF){if(n.children&&n.children.length>1){ok=false;this._emit(ruleCtx,n)}}}}}return ok}_attrVal(attribs,attr){var v=attribs[attr];switch(attr){case"max-columns":v=parseInt(v);break}return v}}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 ON_EVENT_PREFIX="on-";const DASH_CHANGED="-changed";const DATABIND="data-bind";const STATUS_PROP_TYPE="propertyType";const STATUS_PROP_VALUE="propertyValue";const STATUS_PROPERTY="property";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 ANY="any";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===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)){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=_getAttrValueType(attrVal);for(status of deps){if(status.target===STATUS_PROPERTY){if(isEvent){return}}else 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"||attrValType==="boolean"){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}}else if(attrValType==="Array<string>"){let aVals=_getStringValsFromAttr(attrVal);if(aVals.length){status.value.forEach(av=>{if(aVals.includes(av)){_emitIssue(ruleCtx,tag,attr,av,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().replace(/\>\./,">")});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"){if(attr.endsWith(DASH_CHANGED)){scope="attribute"}issue=new ruleCtx.Issue(`Event '${attr}' is deprecated${since} for <${tag}>.${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(_isExpr(attrVal)||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=>{val=val.replace(/[\"\']/g,"");ret.push(val.trim())})}return ret};function _getAttrValueType(v){var ret;if(_isExpr(v)){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){var ret,t,a,i;a=s.split(OR);for(i=0;i<a.length;i++){t=a[i].trim().toLowerCase();if(t===OBJECT||t===ANY){ret=true;break}}return ret?ret:false};function _isExpr(s){return s.startsWith("{{")||s.startsWith("[[")};function _getPropFromEvent(ruleCtx,tag,attr){return ruleCtx.utils.metaLib.getTagPropertyFromEvent(tag,attr)};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-ojattr-deprecated";const ON_EVENT_PREFIX="on-";const DASH_CHANGED="-changed";const DATABIND="data-bind";const OJ_DYNAMIC="oj-dynamic";const OJ_DYN="oj-dyn";const STATUS_PROP_TYPE="propertyType";const STATUS_PROP_VALUE="propertyValue";const STATUS_PROPERTY="property";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 MSG_ID_USER="_user";const OR="|";const ANY="any";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===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)){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=_getAttrValueType(attrVal);for(status of deps){if(status.target===STATUS_PROPERTY){if(isEvent){return}}else 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"||attrValType==="boolean"){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}}else if(attrValType==="Array<string>"){let aVals=_getStringValsFromAttr(attrVal);if(aVals.length){status.value.forEach(av=>{if(aVals.includes(av)){_emitIssue(ruleCtx,tag,attr,av,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().replace(/\>\./,">")});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"){if(attr.endsWith(DASH_CHANGED)){scope="attribute"}issue=new ruleCtx.Issue(`Event '${attr}' is deprecated${since} for <${tag}>.${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}`)}msgKey=RULE_NAME+(msgKey?msgKey:"");if(ruleCtx.utils.metaLib.isJetTag(tag)||tag===OJ_DYNAMIC||tag===OJ_DYN){if(status.since&&ruleCtx.utils.jafLib.getMajorReleaseCount(status.since)>JET_RELS){issue.setSeverity(SEV_BLOCKER);msgKey+=MSG_ID_AGED}}else{msgKey+=MSG_ID_USER}issue.setMsgKey(msgKey);return issue};function _checkObjectProps(ruleCtx,tag,attr,attrVal){var obj,key,deps,dep,metaLib,propType,propVal;if(_isExpr(attrVal)||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=>{val=val.replace(/[\"\']/g,"");ret.push(val.trim())})}return ret};function _getAttrValueType(v){var ret;if(_isExpr(v)){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){var ret,t,a,i;a=s.split(OR);for(i=0;i<a.length;i++){t=a[i].trim().toLowerCase();if(t===OBJECT||t===ANY){ret=true;break}}return ret?ret:false};function _isExpr(s){return s.startsWith("{{")||s.startsWith("[[")};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";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)||enumValue.startsWith("data-")||enumValue.startsWith("aria-")||enumValue==="class"||enumValue==="style"){return}if(o=metaLib.isTagAttrEnumValueDeprecated(tagName,attrName,enumValue)){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};
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";const MSG_ID_USER="_user";const OJ_DYNAMIC="oj-dynamic";const OJ_DYN="oj-dyn";function getName(){return RULE_NAME};function getShortDescription(){return SHORT};function getDescription(){return LONG};function register(regCtx){this._metaLib=regCtx.utils.metaLib;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)||enumValue.startsWith("data-")||enumValue.startsWith("aria-")||enumValue==="class"||enumValue==="style"){return}if(o=metaLib.isTagAttrEnumValueDeprecated(tagName,attrName,enumValue)){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(this._metaLib.isJetTag(tagName)||tagName===OJ_DYNAMIC||tagName===OJ_DYN){if(o.since&&ruleCtx.utils.jafLib.getMajorReleaseCount(o.since)>JET_RELS){issue.setSeverity(SEV_BLOCKER);issue.setMsgKey(RULE_NAME+MSG_ID_AGED)}}else{issue.setMsgKey(RULE_NAME+MSG_ID_USER)}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 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};
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.";const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";const DOT=".";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 value="";let b;if(descript&&!descript.endsWith(DOT)){descript+=DOT}if(status.value&&status.value.length){value=` Available alternative${status.value.length===1?" is":"s are"}`;value+=`: <${status.value.join(">, ")}>.`}let issue=new ruleCtx.Issue(`<${tag}> is deprecated${since}.${descript}${value}`);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;
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 OJ_DYNAMIC="oj-dynamic";const OJ_DYN="oj-dyn";const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";const MSG_ID_USER="_user";const DOT=".";class Rule{getName(){return RULE_NAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(regCtx){this._metaLib=regCtx.utils.metaLib;return{"webcomp":this._onWC}}_onWC(ruleCtx,tag){var status;if(tag==="oj-slot"){return}if(!(status=this._metaLib.isTagDeprecated(tag))){return}let descript=status.description?` ${status.description}`:"";let since=status.since?" (since "+status.since+")":null;let value="";if(descript&&!descript.endsWith(DOT)){descript+=DOT}if(status.value&&status.value.length){value=` Available alternative${status.value.length===1?" is":"s are"}`;value+=`: <${status.value.join(">, ")}>.`}let issue=new ruleCtx.Issue(`<${tag}> is deprecated${since}.${descript}${value}`);if(this._metaLib.isJetTag(tag)||tag===OJ_DYNAMIC||tag===OJ_DYN){if(status.since&&ruleCtx.utils.jafLib.getMajorReleaseCount(status.since)>JET_RELS){issue.setSeverity(SEV_BLOCKER);issue.setMsgKey(RULE_NAME+MSG_ID_AGED)}}else{issue.setMsgKey(RULE_NAME+MSG_ID_USER)}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-ojtag-nonglobattr-prefix";function getName(){return RULE_NAME};function getShortDescription(){return"Web component elements with a non-global attribute with a ':' prefix and an attribute expression, is not recommended"};function getDescription(){return"On web component elements, any use of a non-global attribute "+"prefixed with ':' and with an attribute expression such as attr=\"[[...]]\" or attr=\"{{...}}\", is not recommended."};function register(){return{"ojtag":_handleTag}};function _handleTag(ruleCtx,tagName){var attribs,attrib,attrValue,DomUtils,attrPos,issue;attribs=ruleCtx.node.attribs;if(!attribs){return}DomUtils=ruleCtx.utils.DomUtils;for(attrib in attribs){if(tagName==="oj-label"&&(attrib==="for"||attrib===":for")){continue}if(!DomUtils.isCommonAttr(attrib)){if(attrib.charAt(0)===":"){attrValue=attribs[attrib];if(attrValue.startsWith("[[")||attrValue.startsWith("{{")){issue=new ruleCtx.Issue(`Expression-bound non-global attribute '${attrib}' with ':' prefix found on <${tagName}> - use '${attrib.substring(1)}'`);attrPos=DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-ojtag-nonglobattr-prefix";const SHORT="Web component elements with a non-global attribute with a ':' prefix and an attribute expression, is not recommended";const LONG="On web component elements, any use of a non-global attribute prefixed with ':' and with an attribute expression such "+"as attr=\"[[...]]\" or attr=\"{{...}}\", is not recommended.<br><br>"+"If the expression has a complex (e.g. array or object) value, it won't be applied correctly. The :foo syntax is effectively "+"binding an attribute on the element, which means that the value is always coerced to a string (since that's all HTML attributes are). "+"The standard non-colon binding creates a property binding which can have any value it wants because the value will be "+"applied on the JS object, not the DOM element.";function getName(){return RULE_NAME};function getShortDescription(){return SHORT};function getDescription(){return LONG};function register(){return{"ojtag":_handleTag}};function _handleTag(ruleCtx,tagName){var attribs,attrib,attrValue,DomUtils,attrPos,issue;attribs=ruleCtx.node.attribs;if(!attribs){return}DomUtils=ruleCtx.utils.DomUtils;for(attrib in attribs){if(tagName==="oj-label"&&(attrib==="for"||attrib===":for")){continue}if(!DomUtils.isCommonAttr(attrib)){if(attrib.charAt(0)===":"){attrValue=attribs[attrib];if(attrValue.startsWith("[[")||attrValue.startsWith("{{")){issue=new ruleCtx.Issue(`Expression-bound non-global attribute '${attrib}' with ':' prefix found on <${tagName}> - use '${attrib.substring(1)}'`);attrPos=DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attrib);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}};module.exports={getName,getDescription,getShortDescription,register};
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, 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-prop-anti-pattern";const DESCRIPTION="Some components, or component features, may be present but are not applicable for "+"use in all design systems and as such may be flagged as anti-patterns in the content "+"of a particular theme. In these cases, the feature should not be used if targeting the "+"design system in question.";const SHORT_DESCRIPTION="The specified component property is an anti pattern for code written for the designated theme.";const ANTIPATTERN="antiPattern";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._metaLib=regCtx.utils.metaLib;this._theme=regCtx.config.theme;return{webcomp:this._onWebComp}}_onWebComp(ruleCtx,tagName){var attrs,attr;if(ruleCtx.tagNode.attribs){attrs=ruleCtx.tagNode.attribs;for(attr in attrs){this._checkAttr(ruleCtx,tagName,attr,attrs[attr])}}}_checkAttr(ruleCtx,tagName,attrName,attrValue){var aStat,attrName;if(aStat=this._metaLib.getPropStatus(tagName,attrName,ANTIPATTERN)){let stat,themes,i;for(i=0;i<aStat.length;i++){stat=aStat[i];if(!(themes=stat.themes)){continue}if(!stat.hasOwnProperty("target")){if(themes.includes(this._theme)){this._emitIssue(1,ruleCtx,tagName,attrName,stat)}}else if(stat.target==="propertyValue"&&attrValue){if(!_isExpr(attrValue)&&!attrValue.startsWith("{")){if(stat.value&&stat.value.includes(attrValue)){this._emitIssue(2,ruleCtx,tagName,attrName,stat,attrValue)}}}}}}_emitIssue(issueType,ruleCtx,tagName,attrName,stat,attrValue){var issue,since,descript,themes,multi,attrPos;since=stat.since?` (since ${stat.since})`:"";descript=stat.description;descript=descript?` ${descript}`:"";descript=descript&&!descript.endsWith(".")?descript+".":descript;themes="'"+stat.themes.join("', '")+"'";if(multi=stat.themes.length>1){let x;if((x=themes.lastIndexOf(","))>=0){themes=themes.substring(0,x)+" and"+themes.substring(x+1)}}themes=`${multi?"s":""} ${themes}`;if(issueType===1){issue=new ruleCtx.Issue(`<${tagName}> attribute '${attrName}' is an antipattern in theme${themes}${since}.${descript} `)}else{issue=new ruleCtx.Issue(`<${tagName}> attribute '${attrName}' value '${attrValue}' is an antipattern in theme${themes}${since}.${descript} `);issue.setMsgKey(RULENAME+"_1")}attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.node,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}function _isExpr(s){return /[(}{}+*\/]/.test(s)};module.exports=Rule;
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="oj-html-slot-default";const DESCRIPT="A child component is defined in a component parent's default slot, but the parent does not support default slots.";const SHORT=DESCRIPT;const SLOT="slot";const COLON_SLOT=":slot";const DEFAULT_SLOT="";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._utils=regCtx.utils.utils;return{"webcomp":this._onWebComp}};Rule.prototype._onWebComp=function(ruleCtx,tagName){if(tagName==="template"||tagName==="oj-defer"||tagName.startsWith("oj-bind-")||tagName==="oj-refresher"){return}if(!ruleCtx.utils.metaLib.hasTagDefaultSlot(tagName)){this._checkChildren(ruleCtx)}};Rule.prototype._checkChildren=function(ruleCtx){var childs,child,node;if((childs=ruleCtx.tagNode.children)&&childs.length){for(child of childs){node=null;if(child.type==="tag"){if(!this._hasChildSlotAttrib(child)){if(child.name.startsWith("oj-bind-")||child.name==="template"||child.name==="oj-defer"){node=this._getFirstActiveChild(child)}else{node=child};if(node){if(this._metaLib.isWCTag(node.name)){this._emitIssue(ruleCtx,node)}}}}}}};Rule.prototype._emitIssue=function(ruleCtx,child){let issue=new ruleCtx.Issue(`<${ruleCtx.tag}> does not define a default slot but it contains a child <${child.name}>`);issue.setPosition(null,null,child.startIndex,child.endIndex);ruleCtx.reporter.addIssue(issue,ruleCtx)};Rule.prototype._getFirstActiveChild=function(node){if(node.children&&node.children.length){let child;for(child of node.children){if(child.type==="tag"){if(this._hasChildSlotAttrib(child)){break}if(child.name.startsWith("oj-bind-")||child.name==="template"||child.name==="oj-defer"){return this._getFirstActiveChild(child)}return child}}}return null};Rule.prototype._hasChildSlotAttrib=function(child){var ret=false;var attribs=child.attribs;if(this._utils.hasAnyProps(attribs)){let slotx=attribs[SLOT]||attribs[COLON_SLOT];if(slotx&&slotx!==DEFAULT_SLOT){ret=true}}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 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,status;node=getParentNodeForSlot(ruleCtx,slotName);if(!node||node.type!=="tag"){return}if(status=this._metaLib.isTagSlotDeprecated(node.name,slotName)){let since=status.since?` (since ${status.since})`:"";let descript=(status.description?` ${status.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;
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 OJ_DYNAMIC="oj-dynamic";const OJ_DYN="oj-dyn";const SLOT="slot";const TEMPLATE="template";const DOT=".";const JET_RELS=2;const SEV_BLOCKER="blocker";const MSG_ID_AGED="_aged";const MSG_ID_USER="_user";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 pnode,status;pnode=getParentNodeForSlot(ruleCtx,slotName);if(!pnode||pnode.type!=="tag"){return}let parentTag=pnode.name;if(status=this._metaLib.isTagSlotDeprecated(parentTag,slotName)){let tag=ruleCtx.tag;let since=status.since?` (since ${status.since})`:"";let descript=(status.description?` ${status.description}`:"").trimRight();if(descript&&!descript.endsWith(DOT)){descript+=DOT}let issue=new ruleCtx.Issue(`slot '${slotName}' on <${tag}> for <${parentTag}> 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(this._metaLib.isJetTag(parentTag)||parentTag===OJ_DYNAMIC||parentTag===OJ_DYN){if(status.since&&ruleCtx.utils.jafLib.getMajorReleaseCount(status.since)>JET_RELS){issue.setSeverity(SEV_BLOCKER);issue.setMsgKey(RULE_NAME+MSG_ID_AGED)}}else{issue.setMsgKey(RULE_NAME+MSG_ID_USER)}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-name";const DESCRIPT="The element specifies a slot attribute value that is not defined by the slot owning component.";const SHORT=DESCRIPT;const SLOT="slot";const TEMPLATE="template";function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(){return{"<slot=>":this._onSlot}};Rule.prototype._onSlot=function(ruleCtx,slot,slotVal){if(slotVal&&!_isExpr(slotVal)&&ruleCtx.tagNode.name!==TEMPLATE){this._slotAttr(ruleCtx,slotVal)}};Rule.prototype._slotAttr=function(ruleCtx,slotVal){var issue,node;if(!(node=getParentNodeForSlot(ruleCtx,slotVal))){issue=new ruleCtx.Issue(`unresolved slot '${slotVal}' on <${ruleCtx.tag}>`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,SLOT);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx);return}};function _isExpr(s){return s.startsWith("[[")||s.startsWith("{{")};module.exports=Rule;
6
+ const getParentNodeForSlot=require("./helpers/has-slot-name");const RULE_NAME="oj-html-slot-name";const DESCRIPT="The element specifies a slot attribute value that is not defined by the slot owning component.";const SHORT=DESCRIPT;const SLOT="slot";const TEMPLATE="template";function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(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._slotAttr(ruleCtx,slotVal)}};Rule.prototype._slotAttr=function(ruleCtx,slotVal){var issue,node;if(!(node=getParentNodeForSlot(ruleCtx,slotVal))){issue=new ruleCtx.Issue(`unresolved slot '${slotVal}' on <${ruleCtx.tag}>`);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,SLOT);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx);return}};function _isExpr(s){return s.startsWith("[[")||s.startsWith("{{")};module.exports=Rule;
@@ -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 IGNORE_TAG=["oj-defer","html","head","body","script"];const TEMPLATE="template";const OJ_SWITCHER="oj-switcher";const OJ_DEFER="oj-defer";const OJ_BIND="oj-bind";const OJ_TOOLBAR="oj-toolbar";const OJ_LABEL="oj-label";const OJ_BIND_SLOT="oj-bind-slot";const DIV="div";const SPAN="span";const TAG="tag";const SLOT="slot";const _isBindTag=tagName=>{return tagName.startsWith("oj-bind")};const _ignoreTag=tagName=>{return IGNORE_TAG.includes(tagName)||tagName.startsWith("oj-bind")};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();this._utils=regCtx.utils.utils;this._domUtils=regCtx.utils.DomUtils;return{"webcomp":this._onWebComp,"elem":this._onElem}};Rule.prototype._onElem=function(ruleCtx,elemName){if(ruleCtx.utils.DomUtils.isCommonElem(elemName)||elemName===TEMPLATE){if(!_ignoreTag(elemName)){return this._onWebComp(ruleCtx,elemName)}}};Rule.prototype._onWebComp=function(ruleCtx,tagName){var attribs=ruleCtx.tagNode.attribs;var slotx,slotName="";this._slotDefined=false;if(this._utils.hasAnyProps(attribs)){slotx=attribs[SLOT];if(slotx||slotx===""){slotName=slotx;this._slotDefined=true}}this._onSlot(ruleCtx,SLOT,slotName)};Rule.prototype._onSlot=function(ruleCtx,slotAttr,slotName){var pnode,slotTag,psc;if(slotName&&ruleCtx.tagNode.name===OJ_BIND_SLOT){return}if(!(pnode=getParentNodeForSlot(ruleCtx,slotName))){return}if(pnode.name===OJ_SWITCHER||!this._metaLib.isWCTag(pnode.name)){return}if(this._metaLib.isJetTag(pnode.name)&&!this._hasJetWCInterfaces){return}psc=this._metaLib.getPreferredSlotContentEx(pnode.name,slotName);if(!(psc&&psc.interfaces)){return}slotTag=ruleCtx.tag;if(slotTag==="oj-vb-fragment"||slotTag==="oj-module"){return}if(slotTag.startsWith(OJ_BIND)||slotTag===OJ_DEFER||slotTag===TEMPLATE||slotTag===DIV){let child;if(!(child=_getFirstChildTag(ruleCtx.tagNode.children))||!this._isSlotInterfaceSupported(child,psc)){if(child?.name!==SPAN){this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,2)}}return}if(ruleCtx.utils.DomUtils.isCommonElem(slotTag)){if(pnode.name!==OJ_TOOLBAR&&ruleCtx.tagNode.name!==SPAN){this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,3)}return}if(this._metaLib.isWCTag(slotTag)){if(!_isBindTag(slotTag)&&slotTag!==OJ_DEFER&&slotTag!==TEMPLATE){if(!this._isSlotInterfaceSupported(ruleCtx.tagNode,psc)){this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,1)}}}};Rule.prototype._isSlotInterfaceSupported=function(node,psc){var ret,aIfc;if(aIfc=this._metaLib.getInterfaces(node.name)){for(let ifc of aIfc){if(psc.interfaces.includes(ifc)){ret=true;break}}}return ret};Rule.prototype._emitIssue=function(ruleCtx,elemNode,slotName,slotOwner,psci,issueType){var ifc=_list(psci.interfaces,"or");var comp=psci.components?` (e.g. ${_list(psci.components,"or",true)})`:"";var multi=psci.interfaces.length>1;var actualSlot=slotName;var slotName=slotName?`slot '${slotName}'`:"default slot";var isDefSlot=!slotName;var issue,msg;if(issueType===1){msg=`<${elemNode.name}> is in${isDefSlot?" the":""} ${slotName} of <${slotOwner}> but does not implement interface${multi?"s":""} ${ifc}${comp}`}else if(issueType===2){msg=`<${elemNode.name}> is in${isDefSlot?" the":""} ${slotName} of <${slotOwner}> but its first child does not implement interface${multi?"s":""} ${ifc}${comp}`}else if(issueType===3){msg=`${slotName} on <${elemNode.name}> for <${slotOwner}> cannot provide ${multi?"interfaces":"an interface"} of type ${ifc}${comp}`}else{return}issue=new ruleCtx.Issue(msg);if(this._slotDefined){let attrPos=ruleCtx.utils.DomUtils.getAttrValuePosition(ruleCtx.data,ruleCtx.tagNode,SLOT);ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,SLOT);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end)}issue.setMsgEx({slotName:actualSlot,slotElem:elemNode.name,slotOwner:slotOwner});ruleCtx.reporter.addIssue(issue,ruleCtx)};function _getFirstChildTag(childs){var ret,childs,child;if(childs){for(let i=0;i<childs.length;i++){child=childs[i];if(child.type!==TAG){continue}if(child.name.startsWith("oj-bind-")||child.name===OJ_DEFER||child.name===TEMPLATE){return _getFirstChildTag(child.children)}ret=child;break}}return ret};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 IGNORE_TAG=["oj-defer","html","head","body","script"];const TEMPLATE="template";const OJ_SWITCHER="oj-switcher";const OJ_DEFER="oj-defer";const OJ_BIND="oj-bind";const OJ_TOOLBAR="oj-toolbar";const OJ_LABEL="oj-label";const OJ_BIND_SLOT="oj-bind-slot";const DIV="div";const SPAN="span";const TAG="tag";const SLOT="slot";const _isBindTag=tagName=>{return tagName.startsWith("oj-bind")};const _ignoreTag=tagName=>{return IGNORE_TAG.includes(tagName)||tagName.startsWith("oj-bind")};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();this._utils=regCtx.utils.utils;this._domUtils=regCtx.utils.DomUtils;return{"webcomp":this._onWebComp,"elem":this._onElem}};Rule.prototype._onElem=function(ruleCtx,elemName){if(ruleCtx.utils.DomUtils.isCommonElem(elemName)||elemName===TEMPLATE){if(!_ignoreTag(elemName)){return this._onWebComp(ruleCtx,elemName)}}};Rule.prototype._onWebComp=function(ruleCtx,tagName){var attribs=ruleCtx.tagNode.attribs;var slotx,slotName="";this._slotDefined=false;if(this._utils.hasAnyProps(attribs)){slotx=attribs[SLOT];if(slotx||slotx===""){slotName=slotx;this._slotDefined=true}}this._onSlot(ruleCtx,SLOT,slotName)};Rule.prototype._onSlot=function(ruleCtx,slotAttr,slotName){var pnode,slotTag,psc;if(slotName&&ruleCtx.tagNode.name===OJ_BIND_SLOT){return}if(!(pnode=getParentNodeForSlot(ruleCtx,slotName))){return}if(pnode.name===OJ_SWITCHER||!this._metaLib.isWCTag(pnode.name)){return}if(this._metaLib.isJetTag(pnode.name)&&!this._hasJetWCInterfaces){return}psc=this._metaLib.getPreferredSlotContentEx(pnode.name,slotName);if(!(psc&&psc.interfaces)){return}slotTag=ruleCtx.tag;if(slotTag==="oj-vb-fragment"||slotTag==="oj-module"){return}if(slotTag.startsWith(OJ_BIND)||slotTag===OJ_DEFER||slotTag===TEMPLATE||slotTag===DIV){let child;if(!(child=_getFirstChildTag(ruleCtx.tagNode.children))||!this._isSlotInterfaceSupported(child,psc)){if(child?.name!==SPAN){if(child&&this._hasChildNamedSlotAttrib(child)){return}this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,2)}}return}if(ruleCtx.utils.DomUtils.isCommonElem(slotTag)){if(pnode.name!==OJ_TOOLBAR&&ruleCtx.tagNode.name!==SPAN){this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,3)}return}if(this._metaLib.isWCTag(slotTag)){if(!_isBindTag(slotTag)&&slotTag!==OJ_DEFER&&slotTag!==TEMPLATE){if(!this._isSlotInterfaceSupported(ruleCtx.tagNode,psc)){this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,1)}}}};Rule.prototype._isSlotInterfaceSupported=function(node,psc){var ret,aIfc;if(aIfc=this._metaLib.getInterfaces(node.name)){for(let ifc of aIfc){if(psc.interfaces.includes(ifc)){ret=true;break}}}return ret};Rule.prototype._emitIssue=function(ruleCtx,elemNode,slotName,slotOwner,psci,issueType){var ifc=_list(psci.interfaces,"or");var comp=psci.components?` (e.g. ${_list(psci.components,"or",true)})`:"";var multi=psci.interfaces.length>1;var actualSlot=slotName;var slotName=slotName?`slot '${slotName}'`:"default slot";var isDefSlot=!slotName;var issue,msg;if(issueType===1){msg=`<${elemNode.name}> is in${isDefSlot?" the":""} ${slotName} of <${slotOwner}> but does not implement interface${multi?"s":""} ${ifc}${comp}`}else if(issueType===2){msg=`<${elemNode.name}> is in${isDefSlot?" the":""} ${slotName} of <${slotOwner}> but its first child does not implement interface${multi?"s":""} ${ifc}${comp}`}else if(issueType===3){msg=`${slotName} on <${elemNode.name}> for <${slotOwner}> cannot provide ${multi?"interfaces":"an interface"} of type ${ifc}${comp}`}else{return}issue=new ruleCtx.Issue(msg);if(this._slotDefined){let attrPos=ruleCtx.utils.DomUtils.getAttrValuePosition(ruleCtx.data,ruleCtx.tagNode,SLOT);ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,SLOT);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end)}issue.setMsgEx({slotName:actualSlot,slotElem:elemNode.name,slotOwner:slotOwner});ruleCtx.reporter.addIssue(issue,ruleCtx)};Rule.prototype._hasChildNamedSlotAttrib=function(node){var attribs,attrib,ret=false;if(node&&(attribs=node.attribs)){for(attrib in attribs){if(attrib==="slot"){ret=true;break}}}return ret};function _getFirstChildTag(childs){var ret,childs,child;if(childs){for(let i=0;i<childs.length;i++){child=childs[i];if(child.type!==TAG){continue}if(child.name.startsWith("oj-bind-")||child.name===OJ_DEFER||child.name===TEMPLATE){return _getFirstChildTag(child.children)}ret=child;break}}return ret};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;