@magicspace/tslint-rules
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -30,5 +30,2 @@ "use strict"; | ||
let cb = (node) => { | ||
if (tsutils_1.isCallExpression(node)) { | ||
return; | ||
} | ||
if ((tsutils_1.isArrowFunction(node) || | ||
@@ -38,3 +35,3 @@ tsutils_1.isFunctionDeclaration(node) || | ||
tsutils_1.isMethodDeclaration(node)) && | ||
!this.printType(node)) { | ||
!this.missingType(node)) { | ||
this.failureManager.append({ | ||
@@ -50,3 +47,3 @@ node, | ||
} | ||
printType(node) { | ||
missingType(node) { | ||
let { type } = node; | ||
@@ -57,3 +54,15 @@ if (type) { | ||
else if (node.parent) { | ||
return this.printType(node.parent); | ||
let parent = node.parent; | ||
if (tsutils_1.isCallExpression(parent)) { | ||
return true; | ||
} | ||
else if (parent.type) { | ||
return true; | ||
} | ||
else if (tsutils_1.isReturnStatement(parent)) { | ||
return this.missingType(parent); | ||
} | ||
else { | ||
return false; | ||
} | ||
} | ||
@@ -60,0 +69,0 @@ else { |
@@ -11,3 +11,3 @@ "use strict"; | ||
const RELATIVE_PATH = /^(?:\.{1,2}[\\/])+/; | ||
const ERROR_MESSAGE_BANNED_PARENT_IMPORT = 'Importing from parent directory is not allowed.'; | ||
const ERROR_MESSAGE_BANNED_PARENT_IMPORT = 'this module can not be imported, because it is imported from parent directory.'; | ||
class Rule extends tslint_1.Rules.AbstractRule { | ||
@@ -20,3 +20,3 @@ apply(sourceFile) { | ||
ruleName: 'no-parent-import', | ||
description: '', | ||
description: 'No additional parameters are required', | ||
optionsDescription: '', | ||
@@ -23,0 +23,0 @@ options: undefined, |
@@ -35,3 +35,3 @@ "use strict"; | ||
ruleName: 'scoped-modules', | ||
description: '', | ||
description: 'No additional parameters are required', | ||
optionsDescription: '', | ||
@@ -38,0 +38,0 @@ options: undefined, |
{ | ||
"name": "@magicspace/tslint-rules", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Custom TSLint rules for MagicSpace.", | ||
@@ -13,5 +13,2 @@ "repository": "https://github.com/makeflow/magicspace.git", | ||
}, | ||
"files": [ | ||
"bld/**/*.js" | ||
], | ||
"peerDependencies": { | ||
@@ -18,0 +15,0 @@ "tslint": "*", |
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
80166
39
1598