/*
 * 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-prop-ko-binding";const DESCRIPTION="When components are used in VDOM, properties should be using the appropriate "+"VDOM style of binding syntax which uses single curly braces. Knockout style "+"binding syntax using string values with pairs of square brackets or curly "+"braces will be simply treated as a literal strings and this is likely to have "+"unexpected effects on the operation of the component.";const SHORT_DESCRIPTION="Knockout style bindings should not be used for components in VDOM pages.";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"AssignmentExpression":this._onAssign}}_onAssign(ruleCtx,node){var isSquare,right;if((right=node.right)&&right.type==="Literal"&&typeof right.value==="string"){let val;if(val=right.value.trim()){if((isSquare=val.startsWith("[["))||val.startsWith("{{")){if(val.endsWith(isSquare?"]]":"}}")){this._emitIssue(ruleCtx,node)}}}}}_emitIssue(ruleCtx,node){var issue,loc,range;loc=node.right.loc.start;range=node.right.range;issue=new ruleCtx.Issue("Knockout style binding detected - use VDOM binding syntax style.");issue.setPosition(loc.line,loc.column,range[0],range[1]);ruleCtx.reporter.addIssue(issue,ruleCtx)}}module.exports=Rule;