@magicspace/tslint-rules
Advanced tools
Comparing version 0.1.20 to 0.1.21
@@ -21,2 +21,3 @@ "use strict"; | ||
tsutils_1.isLabeledStatement, | ||
isMultilineReturnStatement, | ||
tsutils_1.isFunctionDeclaration, | ||
@@ -53,3 +54,3 @@ tsutils_1.isClassDeclaration, | ||
if (tsutils_1.isConstructorDeclaration(node)) { | ||
this.walkContructorDeclaration(node); | ||
this.walkConstructorDeclaration(node); | ||
} | ||
@@ -83,3 +84,3 @@ else if (tsutils_1.isFunctionDeclaration(node) || tsutils_1.isMethodDeclaration(node)) { | ||
} | ||
walkContructorDeclaration(node) { | ||
walkConstructorDeclaration(node) { | ||
if (node.body) { | ||
@@ -188,2 +189,8 @@ let firstSignature = getConstructorFirstSignature(node); | ||
} | ||
function isMultilineReturnStatement(node) { | ||
if (tsutils_1.isReturnStatement(node) && node.getText().indexOf('\n') !== -1) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
function getParentSyntaxList(node) { | ||
@@ -190,0 +197,0 @@ let parent = node.parent; |
@@ -130,2 +130,4 @@ "use strict"; | ||
typescript_1.isTemplateSpan(parent) || | ||
// new Foo(() => {}) | ||
typescript_1.isNewExpression(parent) || | ||
// foo.bar = () => {}; | ||
@@ -132,0 +134,0 @@ (typescript_1.isBinaryExpression(parent) && |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const Path = tslib_1.__importStar(require("path")); | ||
const resolve_1 = tslib_1.__importDefault(require("resolve")); | ||
const tslint_1 = require("tslint"); | ||
const tsutils_1 = require("tsutils"); | ||
const TypeScript = tslib_1.__importStar(require("typescript")); | ||
const match_1 = require("../utils/match"); | ||
const path_1 = require("../utils/path"); | ||
@@ -16,22 +15,4 @@ const string_1 = require("../utils/string"); | ||
const BUILT_IN_MODULE_GROUP_TESTER_DICT = { | ||
'$node-core'(path) { | ||
try { | ||
return require.resolve(path) === path; | ||
} | ||
catch (error) { | ||
return false; | ||
} | ||
}, | ||
'$node-modules'(modulePath, sourceFilePath) { | ||
let basedir = Path.dirname(sourceFilePath); | ||
let resolvedPath; | ||
try { | ||
resolvedPath = resolve_1.default.sync(modulePath, { basedir }); | ||
} | ||
catch (error) { | ||
return false; | ||
} | ||
let relativePath = Path.relative(basedir, resolvedPath); | ||
return /[\\/]node_modules[\\/]/.test(relativePath); | ||
}, | ||
'$node-core': match_1.matchNodeCore, | ||
'$node-modules': match_1.matchNodeModules, | ||
}; | ||
@@ -38,0 +19,0 @@ class ModuleGroup { |
{ | ||
"name": "@magicspace/tslint-rules", | ||
"version": "0.1.20", | ||
"version": "0.1.21", | ||
"description": "Custom TSLint rules for MagicSpace.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/makeflow/magicspace.git", |
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
51570
15
1335
5