@@ -7088,7 +7088,7 @@ namespace ts {
7088
7088
7089
7089
let jsxElementClassType: Type = undefined;
7090
7090
function getJsxGlobalElementClassType(): Type {
7091
- if(!jsxElementClassType) {
7091
+ if (!jsxElementClassType) {
7092
7092
jsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass);
7093
7093
}
7094
7094
return jsxElementClassType;
@@ -7107,7 +7107,7 @@ namespace ts {
7107
7107
}
7108
7108
7109
7109
if (jsxElementType === undefined) {
7110
- if(compilerOptions.noImplicitAny) {
7110
+ if (compilerOptions.noImplicitAny) {
7111
7111
error(errorNode, Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist);
7112
7112
}
7113
7113
}
@@ -7119,6 +7119,15 @@ namespace ts {
7119
7119
7120
7120
let targetAttributesType = getJsxElementAttributesType(node);
7121
7121
7122
+ if (getNodeLinks(node).jsxFlags & JsxFlags.ClassElement) {
7123
+ if (node.tagName.kind === SyntaxKind.Identifier) {
7124
+ checkIdentifier(<Identifier>node.tagName);
7125
+ }
7126
+ else {
7127
+ checkQualifiedName(<QualifiedName>node.tagName);
7128
+ }
7129
+ }
7130
+
7122
7131
let nameTable: Map<boolean> = {};
7123
7132
// Process this array in right-to-left order so we know which
7124
7133
// attributes (mostly from spreads) are being overwritten and
@@ -7131,7 +7140,7 @@ namespace ts {
7131
7140
else {
7132
7141
Debug.assert(node.attributes[i].kind === SyntaxKind.JsxSpreadAttribute);
7133
7142
let spreadType = checkJsxSpreadAttribute(<JsxSpreadAttribute>(node.attributes[i]), targetAttributesType, nameTable);
7134
- if(isTypeAny(spreadType)) {
7143
+ if (isTypeAny(spreadType)) {
7135
7144
sawSpreadedAny = true;
7136
7145
}
7137
7146
}
@@ -12336,7 +12345,7 @@ namespace ts {
12336
12345
}
12337
12346
12338
12347
function checkTypePredicate(node: TypePredicateNode) {
12339
- if(!isInLegalTypePredicatePosition(node)) {
12348
+ if (!isInLegalTypePredicatePosition(node)) {
12340
12349
error(node, Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);
12341
12350
}
12342
12351
}
0 commit comments