@@ -1123,8 +1123,6 @@ import {
1123
1123
VariableLikeDeclaration,
1124
1124
VariableStatement,
1125
1125
VarianceFlags,
1126
- Version,
1127
- versionMajorMinor,
1128
1126
visitEachChild as visitEachChildWorker,
1129
1127
visitNode,
1130
1128
visitNodes,
@@ -48001,28 +47999,28 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
48001
47999
const pos = getNonModifierTokenPosOfNode(node);
48002
48000
const span = getSpanOfTokenAtPosition(sourceFile, pos);
48003
48001
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);
48026
48024
}
48027
48025
}
48028
48026
}
0 commit comments