mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 12:32:08 -06:00
Fix lint errors by removing unused imports and apply formatting
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
This commit is contained in:
parent
0ebcdd1967
commit
e6ee96d357
@ -1123,8 +1123,6 @@ import {
|
||||
VariableLikeDeclaration,
|
||||
VariableStatement,
|
||||
VarianceFlags,
|
||||
Version,
|
||||
versionMajorMinor,
|
||||
visitEachChild as visitEachChildWorker,
|
||||
visitNode,
|
||||
visitNodes,
|
||||
@ -48001,28 +47999,28 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
const pos = getNonModifierTokenPosOfNode(node);
|
||||
const span = getSpanOfTokenAtPosition(sourceFile, pos);
|
||||
|
||||
// Check if ignoreDeprecations should suppress this error
|
||||
const shouldSuppress = compilerOptions.ignoreDeprecations === "6.0";
|
||||
|
||||
if (!shouldSuppress) {
|
||||
// Generate error for module keyword usage in namespace declarations
|
||||
const errorDiagnostic = createFileDiagnostic(
|
||||
sourceFile,
|
||||
span.start,
|
||||
span.length,
|
||||
Diagnostics.The_module_keyword_is_not_allowed_for_namespace_declarations_Use_the_namespace_keyword_instead,
|
||||
);
|
||||
diagnostics.add(errorDiagnostic);
|
||||
}
|
||||
else {
|
||||
// When suppressed by ignoreDeprecations, keep as suggestion
|
||||
const suggestionDiagnostic = createFileDiagnostic(
|
||||
sourceFile,
|
||||
span.start,
|
||||
span.length,
|
||||
Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead,
|
||||
);
|
||||
suggestionDiagnostics.add(suggestionDiagnostic);
|
||||
// Check if ignoreDeprecations should suppress this error
|
||||
const shouldSuppress = compilerOptions.ignoreDeprecations === "6.0";
|
||||
|
||||
if (!shouldSuppress) {
|
||||
// Generate error for module keyword usage in namespace declarations
|
||||
const errorDiagnostic = createFileDiagnostic(
|
||||
sourceFile,
|
||||
span.start,
|
||||
span.length,
|
||||
Diagnostics.The_module_keyword_is_not_allowed_for_namespace_declarations_Use_the_namespace_keyword_instead,
|
||||
);
|
||||
diagnostics.add(errorDiagnostic);
|
||||
}
|
||||
else {
|
||||
// When suppressed by ignoreDeprecations, keep as suggestion
|
||||
const suggestionDiagnostic = createFileDiagnostic(
|
||||
sourceFile,
|
||||
span.start,
|
||||
span.length,
|
||||
Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead,
|
||||
);
|
||||
suggestionDiagnostics.add(suggestionDiagnostic);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1820,11 +1820,11 @@
|
||||
"category": "Error",
|
||||
"code": 1539
|
||||
},
|
||||
"A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.": {
|
||||
"category": "Suggestion",
|
||||
"code": 1540,
|
||||
"reportsDeprecated": true
|
||||
},
|
||||
"A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.": {
|
||||
"category": "Suggestion",
|
||||
"code": 1540,
|
||||
"reportsDeprecated": true
|
||||
},
|
||||
"Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute.": {
|
||||
"category": "Error",
|
||||
"code": 1541
|
||||
@ -1845,15 +1845,15 @@
|
||||
"category": "Error",
|
||||
"code": 1545
|
||||
},
|
||||
"'await using' declarations are not allowed in ambient contexts.": {
|
||||
"category": "Error",
|
||||
"code": 1546
|
||||
},
|
||||
"The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.": {
|
||||
"category": "Error",
|
||||
"code": 1547
|
||||
},
|
||||
|
||||
"'await using' declarations are not allowed in ambient contexts.": {
|
||||
"category": "Error",
|
||||
"code": 1546
|
||||
},
|
||||
"The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.": {
|
||||
"category": "Error",
|
||||
"code": 1547
|
||||
},
|
||||
|
||||
"The types of '{0}' are incompatible between these types.": {
|
||||
"category": "Error",
|
||||
"code": 2200
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user