@@ -922,14 +922,14 @@ module m3 { }\
922
922
}
923
923
924
924
function verifyChangeToBlah ( atIndex : number , singleIgnore ?: true ) {
925
- const index = getIndexOfTsIgnoreComment ( atIndex ) + "// " . length ;
925
+ const index = getIndexOfTsIgnoreComment ( atIndex ) + tsIgnoreComment . indexOf ( "@" ) ;
926
926
const oldText = ScriptSnapshot . fromString ( textWithIgnoreCommentFrom ( textWithIgnoreComment , singleIgnore ) ) ;
927
927
const newTextAndChange = withChange ( oldText , index , 1 , "blah " ) ;
928
928
verifyCommentDirectives ( oldText , newTextAndChange ) ;
929
929
}
930
930
931
931
function verifyChangeBackToDirective ( atIndex : number , singleIgnore ?: true ) {
932
- const index = getIndexOfTsIgnoreComment ( atIndex ) + "// " . length ;
932
+ const index = getIndexOfTsIgnoreComment ( atIndex ) + tsIgnoreComment . indexOf ( "@" ) ;
933
933
const source = textWithIgnoreCommentFrom ( textWithIgnoreComment . slice ( 0 , index ) + "blah " + textWithIgnoreComment . slice ( index + 1 ) , singleIgnore ) ;
934
934
const oldText = ScriptSnapshot . fromString ( source ) ;
935
935
const newTextAndChange = withChange ( oldText , index , "blah " . length , "@" ) ;
@@ -938,15 +938,15 @@ module m3 { }\
938
938
939
939
function verifyDeletingBlah ( atIndex : number , singleIgnore ?: true ) {
940
940
const tsIgnoreIndex = getIndexOfTsIgnoreComment ( atIndex ) ;
941
- const index = tsIgnoreIndex + "// " . length ;
941
+ const index = tsIgnoreIndex + tsIgnoreComment . indexOf ( "@" ) ;
942
942
const source = textWithIgnoreCommentFrom ( textWithIgnoreComment . slice ( 0 , index ) + "blah " + textWithIgnoreComment . slice ( index + 1 ) , singleIgnore ) ;
943
943
const oldText = ScriptSnapshot . fromString ( source ) ;
944
944
const newTextAndChange = withDelete ( oldText , tsIgnoreIndex , tsIgnoreComment . length + "blah" . length ) ;
945
945
verifyCommentDirectives ( oldText , newTextAndChange ) ;
946
946
}
947
947
948
948
function verifyChangeDirectiveType ( atIndex : number , singleIgnore ?: true ) {
949
- const index = getIndexOfTsIgnoreComment ( atIndex ) + "// @ts-" . length ;
949
+ const index = getIndexOfTsIgnoreComment ( atIndex ) + tsIgnoreComment . indexOf ( "ignore" ) ;
950
950
const oldText = ScriptSnapshot . fromString ( textWithIgnoreCommentFrom ( textWithIgnoreComment , singleIgnore ) ) ;
951
951
const newTextAndChange = withChange ( oldText , index , "ignore" . length , "expect-error" ) ;
952
952
verifyCommentDirectives ( oldText , newTextAndChange ) ;
@@ -956,21 +956,21 @@ module m3 { }\
956
956
const source = `const x = 10;
957
957
function foo1() {
958
958
const x1 = 10;
959
- // @ts-ignore
959
+ ${ tsIgnoreComment }
960
960
let y0: string = x;
961
961
let y1: string = x;
962
962
return y1;
963
963
}
964
964
function foo2() {
965
965
const x2 = 10;
966
- // @ts-ignore
966
+ ${ tsIgnoreComment }
967
967
let y0: string = x;
968
968
let y2: string = x;
969
969
return y2;
970
970
}
971
971
function foo3() {
972
972
const x3 = 10;
973
- // @ts-ignore
973
+ ${ tsIgnoreComment }
974
974
let y0: string = x;
975
975
let y3: string = x;
976
976
return y3;
0 commit comments