diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 14aeb35dc89..a56f1004d28 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1,4 +1,4 @@ -/// +/// /// namespace ts { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 0aed8bf2be1..983e128ec7f 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3484,7 +3484,7 @@ "category": "Message", "code": 90018 }, - "Suppress this error message.": { + "Ignore this error message.": { "category": "Message", "code": 90019 }, diff --git a/src/compiler/program.ts b/src/compiler/program.ts index b4b93c0d21b..31fc665649a 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1,10 +1,10 @@ -/// +/// /// /// namespace ts { const emptyArray: any[] = []; - const suppressDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-suppress)?)/; + const ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName = "tsconfig.json"): string { while (true) { @@ -926,7 +926,7 @@ namespace ts { } /** - * Skip errors if previous line start with '// @ts-suppress' comment, not counting non-empty non-comment lines + * Skip errors if previous line start with '// @ts-ignore' comment, not counting non-empty non-comment lines */ function shouldReportDiagnostic(diagnostic: Diagnostic) { const { file, start } = diagnostic; @@ -934,13 +934,13 @@ namespace ts { let { line } = computeLineAndCharacterOfPosition(lineStarts, start); while (line > 0) { const previousLineText = file.text.slice(lineStarts[line - 1], lineStarts[line]); - const result = suppressDiagnosticCommentRegEx.exec(previousLineText); + const result = ignoreDiagnosticCommentRegEx.exec(previousLineText); if (!result) { // non-empty line return true; } if (result[3]) { - // @ts-suppress + // @ts-ignore return false; } line--; diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 0285cdc51fe..aa07407b0f2 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1,4 +1,4 @@ -// +// // Copyright (c) Microsoft Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/services/codefixes/disableJsDiagnostics.ts b/src/services/codefixes/disableJsDiagnostics.ts index 621555cf84b..7fa5c5bf23f 100644 --- a/src/services/codefixes/disableJsDiagnostics.ts +++ b/src/services/codefixes/disableJsDiagnostics.ts @@ -1,4 +1,4 @@ -/* @internal */ +/* @internal */ namespace ts.codefix { registerCodeFix({ errorCodes: getApplicableDiagnosticCodes(), @@ -12,12 +12,12 @@ namespace ts.codefix { .map(d => allDiagnostcs[d].code); } - function getSuppressCommentLocationForLocation(sourceFile: SourceFile, position: number, newLineCharacter: string) { - let { line } = getLineAndCharacterOfPosition(sourceFile, position); + function getIgnoreCommentLocationForLocation(sourceFile: SourceFile, position: number, newLineCharacter: string) { + const { line } = getLineAndCharacterOfPosition(sourceFile, position); const lineStartPosition = getStartPositionOfLine(line, sourceFile); const startPosition = getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); - // First try to see if we can put the '// @ts-suppress' on the previous line. + // First try to see if we can put the '// @ts-ignore' on the previous line. // We need to make sure that we are not in the middle of a string literal or a comment. // We also want to check if the previous line holds a comment for a node on the next line // if so, we do not want to separate the node from its comment if we can. @@ -27,7 +27,7 @@ namespace ts.codefix { if (!tokenLeadingCommnets || !tokenLeadingCommnets.length || tokenLeadingCommnets[0].pos >= startPosition) { return { span: { start: startPosition, length: 0 }, - newText: `// @ts-suppress${newLineCharacter}` + newText: `// @ts-ignore${newLineCharacter}` }; } } @@ -35,7 +35,7 @@ namespace ts.codefix { // If all fails, add an extra new line immediatlly before the error span. return { span: { start: position, length: 0 }, - newText: `${position === startPosition ? "" : newLineCharacter}// @ts-suppress${newLineCharacter}` + newText: `${position === startPosition ? "" : newLineCharacter}// @ts-ignore${newLineCharacter}` }; } @@ -47,10 +47,10 @@ namespace ts.codefix { } return [{ - description: getLocaleSpecificMessage(Diagnostics.Suppress_this_error_message), + description: getLocaleSpecificMessage(Diagnostics.Ignore_this_error_message), changes: [{ fileName: sourceFile.fileName, - textChanges: [getSuppressCommentLocationForLocation(sourceFile, span.start, newLineCharacter)] + textChanges: [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)] }] }, { diff --git a/src/services/codefixes/fixAddMissingMember.ts b/src/services/codefixes/fixAddMissingMember.ts index 765ffa818b6..1934de11f35 100644 --- a/src/services/codefixes/fixAddMissingMember.ts +++ b/src/services/codefixes/fixAddMissingMember.ts @@ -1,4 +1,4 @@ -/* @internal */ +/* @internal */ namespace ts.codefix { registerCodeFix({ errorCodes: [Diagnostics.Property_0_does_not_exist_on_type_1.code], diff --git a/tests/baselines/reference/checkJsFiles_skipDiagnostics.symbols b/tests/baselines/reference/checkJsFiles_skipDiagnostics.symbols index a0f2200048f..eb2afaf4361 100644 --- a/tests/baselines/reference/checkJsFiles_skipDiagnostics.symbols +++ b/tests/baselines/reference/checkJsFiles_skipDiagnostics.symbols @@ -4,15 +4,15 @@ var x = 0; >x : Symbol(x, Decl(a.js, 1, 3)) -/// @ts-suppress +/// @ts-ignore x(); >x : Symbol(x, Decl(a.js, 1, 3)) -/// @ts-suppress +/// @ts-ignore x(); >x : Symbol(x, Decl(a.js, 1, 3)) -/// @ts-suppress +/// @ts-ignore x( >x : Symbol(x, Decl(a.js, 1, 3)) @@ -21,7 +21,7 @@ x( -// @ts-suppress +// @ts-ignore // come comment // some other comment @@ -32,7 +32,7 @@ x(); -// @ts-suppress: no call signature +// @ts-ignore: no call signature x(); >x : Symbol(x, Decl(a.js, 1, 3)) diff --git a/tests/baselines/reference/checkJsFiles_skipDiagnostics.types b/tests/baselines/reference/checkJsFiles_skipDiagnostics.types index 69105a3112a..aa24f1f0541 100644 --- a/tests/baselines/reference/checkJsFiles_skipDiagnostics.types +++ b/tests/baselines/reference/checkJsFiles_skipDiagnostics.types @@ -5,17 +5,17 @@ var x = 0; >0 : 0 -/// @ts-suppress +/// @ts-ignore x(); >x() : any >x : number -/// @ts-suppress +/// @ts-ignore x(); >x() : any >x : number -/// @ts-suppress +/// @ts-ignore x( >x( 2, 3) : any >x : number @@ -28,7 +28,7 @@ x( -// @ts-suppress +// @ts-ignore // come comment // some other comment @@ -40,7 +40,7 @@ x(); -// @ts-suppress: no call signature +// @ts-ignore: no call signature x(); >x() : any >x : number diff --git a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json index 5918c273ce5..97f59dea8ea 100644 --- a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json @@ -5,6 +5,7 @@ "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ // "lib": [], /* Specify library files to be included in the compilation: */ // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ // "declaration": true, /* Generates corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json index 38c4542b407..b90e3fc6c58 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json @@ -5,6 +5,7 @@ "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ // "lib": [], /* Specify library files to be included in the compilation: */ // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ // "declaration": true, /* Generates corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json index d948b648153..482cfa6a9d5 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json @@ -5,6 +5,7 @@ "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ // "lib": [], /* Specify library files to be included in the compilation: */ // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ "jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ // "declaration": true, /* Generates corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json index 70870f296e1..c6a26629dab 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json @@ -5,6 +5,7 @@ "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ // "lib": [], /* Specify library files to be included in the compilation: */ // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ // "declaration": true, /* Generates corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json index 3eabb0894f1..72289dd1787 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json @@ -5,6 +5,7 @@ "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ "lib": ["es5","es2015.promise"], /* Specify library files to be included in the compilation: */ // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ // "declaration": true, /* Generates corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json index 5918c273ce5..97f59dea8ea 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json @@ -5,6 +5,7 @@ "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ // "lib": [], /* Specify library files to be included in the compilation: */ // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ // "declaration": true, /* Generates corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json index b88ac604c14..1ac7c8c54da 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json @@ -5,6 +5,7 @@ "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ "lib": ["es5","es2015.core"], /* Specify library files to be included in the compilation: */ // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ // "declaration": true, /* Generates corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json index db838e21d2f..33a9ecc5cd4 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json @@ -5,6 +5,7 @@ "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ // "lib": [], /* Specify library files to be included in the compilation: */ // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ // "declaration": true, /* Generates corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ diff --git a/tests/cases/compiler/checkJsFiles_skipDiagnostics.ts b/tests/cases/compiler/checkJsFiles_skipDiagnostics.ts index bcbcc815e7c..48364c6a592 100644 --- a/tests/cases/compiler/checkJsFiles_skipDiagnostics.ts +++ b/tests/cases/compiler/checkJsFiles_skipDiagnostics.ts @@ -6,20 +6,20 @@ var x = 0; -/// @ts-suppress +/// @ts-ignore x(); -/// @ts-suppress +/// @ts-ignore x(); -/// @ts-suppress +/// @ts-ignore x( 2, 3); -// @ts-suppress +// @ts-ignore // come comment // some other comment @@ -29,5 +29,5 @@ x(); -// @ts-suppress: no call signature +// @ts-ignore: no call signature x(); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile3.ts b/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile3.ts index f486a7e171b..5cace444859 100644 --- a/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile3.ts +++ b/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile3.ts @@ -10,5 +10,5 @@ // Disable checking for next line verify.rangeAfterCodeFix(`var x = ""; -// @ts-suppress +// @ts-ignore x = 1;`, /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); diff --git a/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile4.ts b/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile4.ts index cadbda2c273..1319325a3d2 100644 --- a/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile4.ts +++ b/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile4.ts @@ -13,6 +13,6 @@ // Disable checking for next line verify.rangeAfterCodeFix(`"test \\ "; -// @ts-suppress +// @ts-ignore x = 1;`, /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); diff --git a/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile5.ts b/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile5.ts index 56b9fbf20d9..3a4b619a7fa 100644 --- a/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile5.ts +++ b/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile5.ts @@ -12,6 +12,6 @@ // Disable checking for next line verify.rangeAfterCodeFix(`/** comment */ -// @ts-suppress +// @ts-ignore x = 1;`, /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); diff --git a/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile6.ts b/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile6.ts index a0497b4deb9..5b93f4953d1 100644 --- a/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile6.ts +++ b/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile6.ts @@ -12,6 +12,6 @@ ////} // Disable checking for next line -verify.rangeAfterCodeFix(`// @ts-suppress +verify.rangeAfterCodeFix(`// @ts-ignore f(x());`, /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); diff --git a/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile7.ts b/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile7.ts index ad8377e129d..767fa984304 100644 --- a/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile7.ts +++ b/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile7.ts @@ -12,6 +12,6 @@ ////} // Disable checking for next line -verify.rangeAfterCodeFix(`// @ts-suppress +verify.rangeAfterCodeFix(`// @ts-ignore x();`, /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); diff --git a/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile8.ts b/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile8.ts index 8ec350479af..3df5864f198 100644 --- a/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile8.ts +++ b/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile8.ts @@ -14,6 +14,6 @@ // Disable checking for next line verify.rangeAfterCodeFix(`f( - // @ts-suppress + // @ts-ignore x());`, /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0);