/*
 * Copyright (c) 2018, 2026, 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-tsx-rating-gauge-track-resize";const DESCRIPTION="The use of the <oj-rating-gauge> 'track-resize' attribute is a Redwood theme anti-pattern. "+"This attribute is only needed if the 'size' attribute is set to 'fit', however, 'fit' is a "+"Redwood theme anti-pattern.";const SHORT_DESCRIPTION="Do not use <oj-rating-gauge> with the 'trackResize' property set to 'on' in Redwood";const JSX_SPREAD_ATTRIBUTE="JSXSpreadAttribute";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._tsxUtils=regCtx.utils.tsxUtils;return{"Tsx<oj-rating-gauge trackResize=>":this._onTrackResize}}_onTrackResize(ruleCtx,tsxProp){if(tsxProp.node.type===JSX_SPREAD_ATTRIBUTE){return}let propVal=tsxProp.valueRaw;if(propVal.substring(1,propVal.length-1)==="on"){let issue=new ruleCtx.Issue(`<oj-rating-gauge> property 'trackResize' value of 'on' is an anti-pattern in Redwood.`);this._tsxUtils.setIssuePropValuePosition(issue,tsxProp);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;