@@ -1123,8 +1123,6 @@ import {
11231123 VariableLikeDeclaration,
11241124 VariableStatement,
11251125 VarianceFlags,
1126- Version,
1127- versionMajorMinor,
11281126 visitEachChild as visitEachChildWorker,
11291127 visitNode,
11301128 visitNodes,
@@ -48001,28 +47999,28 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4800147999 const pos = getNonModifierTokenPosOfNode(node);
4800248000 const span = getSpanOfTokenAtPosition(sourceFile, pos);
4800348001
48004- // Check if ignoreDeprecations should suppress this error
48005- const shouldSuppress = compilerOptions.ignoreDeprecations === "6.0";
48006-
48007- if (!shouldSuppress) {
48008- // Generate error for module keyword usage in namespace declarations
48009- const errorDiagnostic = createFileDiagnostic(
48010- sourceFile,
48011- span.start,
48012- span.length,
48013- Diagnostics.The_module_keyword_is_not_allowed_for_namespace_declarations_Use_the_namespace_keyword_instead,
48014- );
48015- diagnostics.add(errorDiagnostic);
48016- }
48017- else {
48018- // When suppressed by ignoreDeprecations, keep as suggestion
48019- const suggestionDiagnostic = createFileDiagnostic(
48020- sourceFile,
48021- span.start,
48022- span.length,
48023- Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead,
48024- );
48025- suggestionDiagnostics.add(suggestionDiagnostic);
48002+ // Check if ignoreDeprecations should suppress this error
48003+ const shouldSuppress = compilerOptions.ignoreDeprecations === "6.0";
48004+
48005+ if (!shouldSuppress) {
48006+ // Generate error for module keyword usage in namespace declarations
48007+ const errorDiagnostic = createFileDiagnostic(
48008+ sourceFile,
48009+ span.start,
48010+ span.length,
48011+ Diagnostics.The_module_keyword_is_not_allowed_for_namespace_declarations_Use_the_namespace_keyword_instead,
48012+ );
48013+ diagnostics.add(errorDiagnostic);
48014+ }
48015+ else {
48016+ // When suppressed by ignoreDeprecations, keep as suggestion
48017+ const suggestionDiagnostic = createFileDiagnostic(
48018+ sourceFile,
48019+ span.start,
48020+ span.length,
48021+ Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead,
48022+ );
48023+ suggestionDiagnostics.add(suggestionDiagnostic);
4802648024 }
4802748025 }
4802848026 }
0 commit comments