@@ -383,6 +383,7 @@ export default createRule("no-unused-capturing-group", {
383383 return
384384 }
385385 if ( ! typeTracer . isString ( node . callee . object ) ) {
386+ capturingData . markAsCannotTrack ( )
386387 return
387388 }
388389 if ( capturingData . flags . includes ( "g" ) ) {
@@ -401,6 +402,7 @@ export default createRule("no-unused-capturing-group", {
401402 return
402403 }
403404 if ( ! typeTracer . isString ( node . callee . object ) ) {
405+ capturingData . markAsCannotTrack ( )
404406 return
405407 }
406408 // String.prototype.search()
@@ -424,6 +426,7 @@ export default createRule("no-unused-capturing-group", {
424426 return
425427 }
426428 if ( ! typeTracer . isString ( node . callee . object ) ) {
429+ capturingData . markAsCannotTrack ( )
427430 return
428431 }
429432 const replacementNode = node . arguments [ 1 ]
@@ -535,6 +538,7 @@ export default createRule("no-unused-capturing-group", {
535538 return
536539 }
537540 if ( ! typeTracer . isString ( node . callee . object ) ) {
541+ capturingData . markAsCannotTrack ( )
538542 return
539543 }
540544 capturingData . markAsUsed ( )
@@ -629,6 +633,7 @@ export default createRule("no-unused-capturing-group", {
629633 return
630634 }
631635 if ( ! typeTracer . isString ( node . callee . object ) ) {
636+ capturingData . markAsCannotTrack ( )
632637 return
633638 }
634639 capturingData . markAsUsed ( )
0 commit comments