1- /* @internal */
1+ /* @internal */
22namespace ts . codefix {
33 registerCodeFix ( {
44 errorCodes : getApplicableDiagnosticCodes ( ) ,
@@ -12,12 +12,12 @@ namespace ts.codefix {
1212 . map ( d => allDiagnostcs [ d ] . code ) ;
1313 }
1414
15- function getSuppressCommentLocationForLocation ( sourceFile : SourceFile , position : number , newLineCharacter : string ) {
16- let { line } = getLineAndCharacterOfPosition ( sourceFile , position ) ;
15+ function getIgnoreCommentLocationForLocation ( sourceFile : SourceFile , position : number , newLineCharacter : string ) {
16+ const { line } = getLineAndCharacterOfPosition ( sourceFile , position ) ;
1717 const lineStartPosition = getStartPositionOfLine ( line , sourceFile ) ;
1818 const startPosition = getFirstNonSpaceCharacterPosition ( sourceFile . text , lineStartPosition ) ;
1919
20- // First try to see if we can put the '// @ts-suppress ' on the previous line.
20+ // First try to see if we can put the '// @ts-ignore ' on the previous line.
2121 // We need to make sure that we are not in the middle of a string literal or a comment.
2222 // We also want to check if the previous line holds a comment for a node on the next line
2323 // if so, we do not want to separate the node from its comment if we can.
@@ -27,15 +27,15 @@ namespace ts.codefix {
2727 if ( ! tokenLeadingCommnets || ! tokenLeadingCommnets . length || tokenLeadingCommnets [ 0 ] . pos >= startPosition ) {
2828 return {
2929 span : { start : startPosition , length : 0 } ,
30- newText : `// @ts-suppress ${ newLineCharacter } `
30+ newText : `// @ts-ignore ${ newLineCharacter } `
3131 } ;
3232 }
3333 }
3434
3535 // If all fails, add an extra new line immediatlly before the error span.
3636 return {
3737 span : { start : position , length : 0 } ,
38- newText : `${ position === startPosition ? "" : newLineCharacter } // @ts-suppress ${ newLineCharacter } `
38+ newText : `${ position === startPosition ? "" : newLineCharacter } // @ts-ignore ${ newLineCharacter } `
3939 } ;
4040 }
4141
@@ -47,10 +47,10 @@ namespace ts.codefix {
4747 }
4848
4949 return [ {
50- description : getLocaleSpecificMessage ( Diagnostics . Suppress_this_error_message ) ,
50+ description : getLocaleSpecificMessage ( Diagnostics . Ignore_this_error_message ) ,
5151 changes : [ {
5252 fileName : sourceFile . fileName ,
53- textChanges : [ getSuppressCommentLocationForLocation ( sourceFile , span . start , newLineCharacter ) ]
53+ textChanges : [ getIgnoreCommentLocationForLocation ( sourceFile , span . start , newLineCharacter ) ]
5454 } ]
5555 } ,
5656 {
0 commit comments