/*
 * 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 RULENAME="oj-js-noconsole";const DESCRIPTION="All uses of console.log() should be removed before general release";const SHORT_DESCRIPTION="console.log() should be removed before general release";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{CallExpression:this._onCall}}_onCall(ruleCtx,node){if(node.callee&&node.callee.object&&node.callee.object.name==="console"){let meth=node.callee.property&&node.callee.property.type==="Identifier"?": method "+node.callee.property.name+"()":"";let issue=new ruleCtx.Issue(`Use of console object found ${meth} - strip before shipping!`);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;