@fimbul/mimir
Advanced tools
Comparing version 0.8.0-dev.20180419 to 0.8.0-dev.20180420
{ | ||
"name": "@fimbul/mimir", | ||
"version": "0.8.0-dev.20180419", | ||
"version": "0.8.0-dev.20180420", | ||
"description": "Core rules of the Fimbullinter project", | ||
@@ -5,0 +5,0 @@ "main": "recommended.yaml", |
@@ -7,3 +7,2 @@ import { TypedRule } from '@fimbul/ymir'; | ||
private checkNewExpression(node); | ||
private checkSignature(signature, declaration, node); | ||
private checkInferredTypeParameters(signature, typeParameters, node); | ||
@@ -10,0 +9,0 @@ private scannerFallback(signature, typeParameters, node); |
@@ -33,9 +33,15 @@ "use strict"; | ||
const signature = this.checker.getResolvedSignature(node); | ||
if (signature.declaration !== undefined) | ||
return this.checkSignature(signature, signature.declaration, node); | ||
if (signature.declaration !== undefined) { | ||
const typeParameters = getTypeParameters(signature.declaration); | ||
if (typeParameters !== undefined) | ||
return this.checkInferredTypeParameters(signature, typeParameters, node); | ||
} | ||
} | ||
checkNewExpression(node) { | ||
const signature = this.checker.getResolvedSignature(node); | ||
if (signature.declaration !== undefined) | ||
return this.checkSignature(signature, signature.declaration, node); | ||
if (signature.declaration !== undefined) { | ||
const typeParameters = getTypeParameters(signature.declaration); | ||
if (typeParameters !== undefined) | ||
return this.checkInferredTypeParameters(signature, typeParameters, node); | ||
} | ||
const { symbol } = this.checker.getTypeAtLocation(node.expression); | ||
@@ -45,3 +51,4 @@ if (symbol === undefined || symbol.declarations === undefined) | ||
const typeParameterResult = []; | ||
for (const { typeParameters } of symbol.declarations) { | ||
for (const declaration of symbol.declarations) { | ||
const typeParameters = getTypeParameters(declaration); | ||
if (typeParameters === undefined) | ||
@@ -56,11 +63,2 @@ continue; | ||
} | ||
checkSignature(signature, declaration, node) { | ||
const typeParameters = declaration.typeParameters !== undefined | ||
? declaration.typeParameters | ||
: declaration.flags & ts.NodeFlags.JavaScriptFile | ||
? getTemplateTags(declaration) | ||
: undefined; | ||
if (typeParameters !== undefined) | ||
return this.checkInferredTypeParameters(signature, typeParameters, node); | ||
} | ||
checkInferredTypeParameters(signature, typeParameters, node) { | ||
@@ -124,10 +122,9 @@ if (typescriptPre270) | ||
exports.Rule = Rule; | ||
function getTemplateTags(node) { | ||
for (const jsDoc of tsutils_1.getJsDoc(node)) | ||
if (jsDoc.tags !== undefined) | ||
for (const tag of jsDoc.tags) | ||
if (tag.kind === ts.SyntaxKind.JSDocTemplateTag) | ||
return tag.typeParameters; | ||
return; | ||
function getTypeParameters(node) { | ||
if (node.flags & ts.NodeFlags.JavaScriptFile) { | ||
const tag = ts.getJSDocTemplateTag(node); | ||
return tag && tag.typeParameters; | ||
} | ||
return node.typeParameters; | ||
} | ||
//# sourceMappingURL=no-inferred-empty-object.js.map |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
249698
2927