/*
 * Copyright (c) 2018, 2025, Oracle and/or its affiliates.
 * Licensed under The Universal Permissive License (UPL), Version 1.0
 * as shown at https://oss.oracle.com/licenses/upl/
 */
const Utils=require("../jetwc-lib/jetwcutils-componentAuditUtils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwc-component-type"};ruleDef.prototype.getShortDescription=function(){return"Check component has an explicit type defined"};ruleDef.prototype.getDescription=function(){return"This rule checks that the component explicitly defines a type attribute rather than relying on the original fallback behavior and assuming composite"};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){let issue;const meta=context.suppData.obj;if(!meta.hasOwnProperty("type")){issue=new context.Issue(`type for component should be explicitly defined rather than assuming the default`);context.reporter.addIssue(issue,context)}}};module.exports=ruleDef;