@oracle/oraclejet-audit 18.0.1 → 18.0.2

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.
@@ -1 +1 @@
1
- {"metaList":{"8.3.0":{"version":"8.3.0","date":"Monday May 04, 2020","time":"4:34pm edt"},"13.0.0":{"version":"13.0.4","date":"Thursday Sep 22, 2022","time":"3:14am utc"},"13.1.0":{"version":"13.1.0","date":"Sunday Oct 02, 2022","time":"3:37am utc"},"14.0.0":{"version":"14.0.0","date":"Tuesday Jan 03, 2023","time":"8:54pm utc"},"14.1.0":{"version":"14.1.0","date":"Thursday Apr 06, 2023","time":"7:55pm utc"},"15.0.0":{"version":"15.0.0","date":"Saturday Jul 01, 2023","time":"2:08pm utc"},"15.1.0":{"version":"15.1.0","date":"Thursday Jul 06, 2023","time":"8:04pm utc"},"16.0.0":{"version":"16.0.0","date":"Saturday Feb 10, 2024","time":"4:36pm utc"},"16.1.0":{"version":"16.1.0","date":"Monday Feb 12, 2024","time":"8:58pm utc"},"17.0.0":{"version":"17.0.0","date":"Thursday Jul 25, 2024","time":"1:57am utc"},"17.1.0":{"version":"17.1.0","date":"Friday Nov 01, 2024","time":"11:30pm utc"},"18.0.0":{"version":"18.0.1","date":"Thursday Feb 20, 2025","time":"5:35pm utc"}}}
1
+ {"metaList":{"8.3.0":{"version":"8.3.0","date":"Monday May 04, 2020","time":"4:34pm edt"},"13.0.0":{"version":"13.0.4","date":"Thursday Sep 22, 2022","time":"3:14am utc"},"13.1.0":{"version":"13.1.0","date":"Sunday Oct 02, 2022","time":"3:37am utc"},"14.0.0":{"version":"14.0.0","date":"Tuesday Jan 03, 2023","time":"8:54pm utc"},"14.1.0":{"version":"14.1.0","date":"Thursday Apr 06, 2023","time":"7:55pm utc"},"15.0.0":{"version":"15.0.0","date":"Saturday Jul 01, 2023","time":"2:08pm utc"},"15.1.0":{"version":"15.1.0","date":"Thursday Jul 06, 2023","time":"8:04pm utc"},"16.0.0":{"version":"16.0.0","date":"Saturday Feb 10, 2024","time":"4:36pm utc"},"16.1.0":{"version":"16.1.0","date":"Monday Feb 12, 2024","time":"8:58pm utc"},"17.0.0":{"version":"17.0.0","date":"Thursday Jul 25, 2024","time":"1:57am utc"},"17.1.0":{"version":"17.1.0","date":"Friday Nov 01, 2024","time":"11:30pm utc"},"18.0.0":{"version":"18.0.2","date":"Thursday Mar 06, 2025","time":"4:19pm utc"}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oracle/oraclejet-audit",
3
- "version": "18.0.1",
3
+ "version": "18.0.2",
4
4
  "description": "JET AUDIT FRAMEWORK",
5
5
  "main": "jaf.js",
6
6
  "files": [
@@ -44,7 +44,7 @@
44
44
  "lint"
45
45
  ],
46
46
  "Jaf": {
47
- "version": "11.12.3"
47
+ "version": "11.12.4"
48
48
  },
49
49
  "license": "UPL-1.0",
50
50
  "dependencies": {
@@ -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;if(_inHeadSection(ruleCtx.elemStack)){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. You must migrate to the Redwood or Stable based theme as soon as possible":"vb:inject theme : Alta theme is deprecated, You must migrate to the Redwood or Stable based theme as soon as possible";issue=new ruleCtx.Issue(msg);if(type===1){issue.setPosition(ruleCtx.utils.DomUtils.getAttribValuePosition(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};function _inHeadSection(stack){var node,ret=false;if(stack&&stack.length){for(let i=stack.length-1;i>=0;i--){node=stack[i];if(node.type==="tag"){if(node.name==="head"){ret=true;break}if(node.name==="body"){break}}}}return ret};module.exports=Rule;
6
+ const RULENAME="oj-html-alta-deprecated";const DESCRIPTION="Starting in JET 10.0, the Alta theme is deprecated, and the use of this theme, or of "+"a custom theme such as the <i>ApplicationsCloudUI</i> theme which extends it, should be "+"replaced with either the Redwood theme, or a custom theme that extends the Redwood "+"or Stable theme.<p>All Alta CSS and SCSS files will be removed in JET "+"21.0 (August 2026). Please discontinue use of Alta ASAP.<p>(Product Management warned "+"on February 13 2025 that this deadline will NOT be extended beyond August 2026!)";const SHORT_DESCRIPTION="Detect the use of the deprecated Alta theme";const VB_INJECT="vb:inject";const RE_ALTA_MIN=/.*\/alta\/(oj-alta-min.css|oj-alta.css)/;const RE_APP_CLOUD=/.*\/web\/ApplicationsCloudUI.css/;const RE_THEME_APPSUI=/\s*[a-zA-Z0-9\.\/]*ApplicationsCloudUI.css\s*.*/;const RE_THEME_ALTA=/\s*\/?[Aa]lta\/?\s*.*/;const RE_THEME_ALTA_MIN=/\s*\/?alta\/(oj-alta-min.css|oj-alta.css\s*.*)/;const STYLESHEET="stylesheet";const VER_12_0_0="12.0.0";const HREF="href";class Rule{_idAttribOnly;_idHeadContent;_theme;_jetVerGte12;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;if(!(_inHeadSection(ruleCtx.elemStack)&&comment.startsWith(VB_INJECT))){return}this._processComment(comment);if(!this._idHeadContent){return}if(!(emit=this._idAttribOnly)){if(!(emit=RE_THEME_APPSUI.test(this._theme))){emit=RE_THEME_ALTA_MIN.test(this._theme)||RE_THEME_ALTA.test(this._theme)}}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. ";msg+="All Alta CSS and SCSS will be removed in JET 21.0 (August 2026). Migrate to the Redwood or Stable based theme ASAP.";issue=new ruleCtx.Issue(msg);if(type===1){issue.setPosition(ruleCtx.utils.DomUtils.getAttribValuePosition(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)}_processComment(comment){var a,x,attrib;this._idAttribOnly=this._idHeadContent=false;this._theme="";a=comment.replace("vb:inject","").replace(/['"]/g,"").trim().split("=");for(let i=0;i<a.length-1;i++){attrib=(x=a[i].indexOf(" "))>=0?attrib=a[i].substring(x+1):attrib=a[i];if(attrib==="id"){this._idAttribOnly=true;this._idHeadContent=a[i+1].split(" ")[0]==="headContent"}else{this._idAttribOnly=false;if(attrib==="theme"){this._theme=a[i+1].split(" ")[0]}break}}}}function _hasIdAttribOnly(comment){var a,x,attrib;var hasIdOnly;a=comment.replace("vb:inject","").replace(/['"]/g,"").trim().split("=");for(let i=0;i<a.length-1;i++){attrib=(x=a[i].indexOf(" "))>=0?attrib=a[i].substring(x+1):attrib=a[i];if(attrib==="id"){hasIdOnly=true}else{hasIdOnly=false;break}}return hasIdOnly};function _isStyleSheetLink(ruleCtx){var attribs,ret;if(attribs=ruleCtx.tagNode.attribs){ret=attribs.rel===STYLESHEET}return ret?ret:false};function _inHeadSection(stack){var node,ret=false;if(stack&&stack.length){for(let i=stack.length-1;i>=0;i--){node=stack[i];if(node.type==="tag"){if(node.name==="head"){ret=true;break}if(node.name==="body"){break}}}}return ret};module.exports=Rule;
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const isValidAttr=require("./helpers/valid-attr");const RULE_NAME="oj-tsx-ojattr";const SHORT_DESCR="JET component attribute must be defined";const LONG_DESCR="JET component attribute must be a defined attribute for the component";const OJ_EVENT_PREFIX="onOj";const EVENT_PREFIX="on";const SLOT="slot";const ARIA_DASH="aria-";const DATA_DASH="data-";const KEY="key";const REF="ref";function Rule(){}Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT_DESCR};Rule.prototype.getDescription=function(){return LONG_DESCR};Rule.prototype.register=function(regCtx){this._metaLib=regCtx.utils.metaLib;this._tsxUtils=regCtx.utils.tsxUtils;return{TsxWebComponent:this._onWebComp}};Rule.prototype._onWebComp=function(ruleCtx,tsxComp){var props;if(props=tsxComp.properties){props.forEach(prop=>{this._checkProp(ruleCtx,tsxComp,prop)})}};Rule.prototype._checkProp=function(ruleCtx,tsxComp,tsxProp){let propName=tsxProp.name;let tagName=tsxComp.name;let origPropName,camelName;if(!propName||tsxProp.node.type==="JSXSpreadAttribute"){return}if(!isValidAttr(propName)){let issue=new ruleCtx.Issue(`<${tagName}> - invalid '${propName}' property`);this._tsxUtils.setIssuePosition(issue,tsxProp);issue.setMsgKey(RULE_NAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(_isPropAriaOrData(propName)){return}if(propName.includes("-")){camelName=this._tsxUtils.toCamelCase(propName);let issue=new ruleCtx.Issue(`For optimum performance, it is recommended that the <${tagName}> property '${camelName}' is set using that property name in vdom, rather than using the attribute form of the name '${propName}'`);this._tsxUtils.setIssuePosition(issue,tsxProp);issue.setSeverity("info");issue.setMsgKey(RULE_NAME+"_2");ruleCtx.reporter.addIssue(issue,ruleCtx)}if(this._tsxUtils.isCommonAttr(propName)||this._tsxUtils.isCommonEventAttr(propName)||propName===SLOT||propName===KEY||propName===REF||propName.startsWith(OJ_EVENT_PREFIX)||propName.startsWith(EVENT_PREFIX)){return}origPropName=propName;propName=camelName?camelName:propName;if(!this._metaLib.isTagAttr(tagName,propName)){if(!this._metaLib.isTagEvent(tagName,propName)){let issue=new ruleCtx.Issue(`<${tagName}> property '${origPropName}' is unknown`);this._tsxUtils.setIssuePosition(issue,tsxProp);ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _isPropAriaOrData(s){return s.startsWith(ARIA_DASH)||s.startsWith(DATA_DASH)}module.exports=Rule;
6
+ const isValidAttr=require("./helpers/valid-attr");const RULE_NAME="oj-tsx-ojattr";const SHORT_DESCR="JET component property must be defined";const LONG_DESCR="JET component properties must be defined properties for the component. "+"Additionally, kebab-case attributes are discouraged, and use of assignments "+"\"[[ . . .]]\" or \"{{ . . .}\" (which are coerced to a string value) should be "+"replaced with their vdom property names for performance and to avoid coercion.";const OJ_EVENT_PREFIX="onOj";const EVENT_PREFIX="on";const SLOT="slot";const ARIA_DASH="aria-";const DATA_DASH="data-";const KEY="key";const REF="ref";function Rule(){}Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT_DESCR};Rule.prototype.getDescription=function(){return LONG_DESCR};Rule.prototype.register=function(regCtx){this._metaLib=regCtx.utils.metaLib;this._tsxUtils=regCtx.utils.tsxUtils;return{TsxWebComponent:this._onWebComp}};Rule.prototype._onWebComp=function(ruleCtx,tsxComp){var props;if(props=tsxComp.properties){props.forEach(prop=>{this._checkProp(ruleCtx,tsxComp,prop)})}};Rule.prototype._checkProp=function(ruleCtx,tsxComp,tsxProp){let propName=tsxProp.name;let tagName=tsxComp.name;let origPropName,camelName;if(!propName||tsxProp.node.type==="JSXSpreadAttribute"){return}if(!isValidAttr(propName)){let issue=new ruleCtx.Issue(`<${tagName}> - invalid '${propName}' property`);this._tsxUtils.setIssuePosition(issue,tsxProp);issue.setMsgKey(RULE_NAME+"_1");ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(_isPropAriaOrData(propName)){return}if(propName.includes("-")){camelName=this._tsxUtils.toCamelCase(propName);let issue=new ruleCtx.Issue(`For optimum performance, it is recommended that the <${tagName}> property '${camelName}' is set using that property name in vdom, rather than using the attribute form of the name '${propName}'`);this._tsxUtils.setIssuePosition(issue,tsxProp);issue.setSeverity("critical");issue.setMsgKey(RULE_NAME+"_2");ruleCtx.reporter.addIssue(issue,ruleCtx)}if(this._tsxUtils.isCommonAttr(propName)||this._tsxUtils.isCommonEventAttr(propName)||propName===SLOT||propName===KEY||propName===REF||propName.startsWith(OJ_EVENT_PREFIX)||propName.startsWith(EVENT_PREFIX)){return}origPropName=propName;propName=camelName?camelName:propName;if(!this._metaLib.isTagAttr(tagName,propName)){if(!this._metaLib.isTagEvent(tagName,propName)){let issue=new ruleCtx.Issue(`<${tagName}> property '${origPropName}' is unknown`);this._tsxUtils.setIssuePosition(issue,tsxProp);ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _isPropAriaOrData(s){return s.startsWith(ARIA_DASH)||s.startsWith(DATA_DASH)}module.exports=Rule;