@@ -514,14 +514,17 @@ export function findTargetBraceNodesForHtml(ast: AST, options: ResolvedOptions):
514514 function recursion (
515515 node : unknown ,
516516 // biome-ignore lint/correctness/noUnusedFunctionParameters: Required for recursive calls.
517- parentNode ?: { type ?: unknown } ,
517+ parentNode ?: { kind : string ; type ?: undefined } | { kind ?: undefined ; type : string } ,
518518 ) : void {
519- if ( ! isTypeof ( node , z . object ( { type : z . string ( ) } ) ) ) {
519+ if (
520+ ! isTypeof ( node , z . object ( { kind : z . string ( ) } ) ) &&
521+ ! isTypeof ( node , z . object ( { type : z . string ( ) } ) )
522+ ) {
520523 return ;
521524 }
522525
523526 Object . entries ( node ) . forEach ( ( [ key , value ] ) => {
524- if ( key === 'type' ) {
527+ if ( key === 'kind' || key === ' type') {
525528 return ;
526529 }
527530
@@ -553,16 +556,18 @@ export function findTargetBraceNodesForHtml(ast: AST, options: ResolvedOptions):
553556 return ;
554557 }
555558
559+ const nodeType = isTypeof ( node , z . object ( { kind : z . string ( ) } ) ) ? node . kind : node . type ;
560+
556561 const [ currentNodeRangeStart , currentNodeRangeEnd ] = [
557562 node . sourceSpan . start . offset ,
558563 node . sourceSpan . end . offset ,
559564 ] ;
560565 const currentASTNode : ASTNode = {
561- type : node . type ,
566+ type : nodeType ,
562567 range : [ currentNodeRangeStart , currentNodeRangeEnd ] ,
563568 } ;
564569
565- switch ( node . type ) {
570+ switch ( nodeType ) {
566571 case 'angularControlFlowBlock' : {
567572 nonCommentNodes . push ( currentASTNode ) ;
568573
@@ -746,13 +751,19 @@ export function findTargetBraceNodesForVue(ast: AST, options: ResolvedOptions):
746751 */
747752 const braceNodes : BraceNode [ ] = [ ] ;
748753
749- function recursion ( node : unknown , parentNode ?: { type ?: unknown } ) : void {
750- if ( ! isTypeof ( node , z . object ( { type : z . string ( ) } ) ) ) {
754+ function recursion (
755+ node : unknown ,
756+ parentNode ?: { kind : string ; type ?: undefined } | { kind ?: undefined ; type : string } ,
757+ ) : void {
758+ if (
759+ ! isTypeof ( node , z . object ( { kind : z . string ( ) } ) ) &&
760+ ! isTypeof ( node , z . object ( { type : z . string ( ) } ) )
761+ ) {
751762 return ;
752763 }
753764
754765 Object . entries ( node ) . forEach ( ( [ key , value ] ) => {
755- if ( key === 'type' ) {
766+ if ( key === 'kind' || key === ' type') {
756767 return ;
757768 }
758769
@@ -784,16 +795,19 @@ export function findTargetBraceNodesForVue(ast: AST, options: ResolvedOptions):
784795 return ;
785796 }
786797
798+ const nodeType = isTypeof ( node , z . object ( { kind : z . string ( ) } ) ) ? node . kind : node . type ;
799+ const parentNodeType = parentNode ?. kind ?? parentNode ?. type ;
800+
787801 const [ currentNodeRangeStart , currentNodeRangeEnd ] = [
788802 node . sourceSpan . start . offset ,
789803 node . sourceSpan . end . offset ,
790804 ] ;
791805 const currentASTNode : ASTNode = {
792- type : node . type ,
806+ type : nodeType ,
793807 range : [ currentNodeRangeStart , currentNodeRangeEnd ] ,
794808 } ;
795809
796- switch ( node . type ) {
810+ switch ( nodeType ) {
797811 case 'attribute' : {
798812 nonCommentNodes . push ( currentASTNode ) ;
799813
@@ -811,7 +825,7 @@ export function findTargetBraceNodesForVue(ast: AST, options: ResolvedOptions):
811825 } ) ,
812826 } ) ,
813827 ) &&
814- parentNode . type === 'element' &&
828+ parentNodeType === 'element' &&
815829 isTypeof (
816830 node ,
817831 z . object ( {
0 commit comments