New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@magicspace/tslint-rules

Package Overview
Dependencies
Maintainers
2
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@magicspace/tslint-rules - npm Package Compare versions

Comparing version 0.1.14 to 0.1.15

bld/utils/function.js

23

bld/rules/explicitReturnTypeRule.js

@@ -7,2 +7,3 @@ "use strict";

const failure_manager_1 = require("../utils/failure-manager");
const function_1 = require("../utils/function");
const ERROR_MESSAGE_EXPLICIT_RETURN_TYPE_REQUIRED = 'This function requires explicit return type.';

@@ -123,3 +124,3 @@ exports.BASE_TYPE_STRING_SET = new Set([

// class Foo {bar: Bar = () => {};}
tsutils_1.isPropertyDeclaration(parent)) {
typescript_1.isPropertyDeclaration(parent)) {
return !!parent.type;

@@ -143,5 +144,12 @@ }

// return () => {};
let block = parent.parent;
let functionLike = block.parent;
return this.checkReturnType(functionLike);
let functionLikeParent = function_1.getFunctionLikeParent(parent);
if (functionLikeParent &&
isReturnTypeRelatedFunctionLikeDeclaration(functionLikeParent)) {
return this.checkReturnType(functionLikeParent);
}
else {
// Actually return statement should be invalid here in setter and
// constructor.
return true;
}
}

@@ -151,2 +159,9 @@ return this.checkExpressionType(parent);

}
function isReturnTypeRelatedFunctionLikeDeclaration(node) {
return (typescript_1.isFunctionDeclaration(node) ||
typescript_1.isFunctionExpression(node) ||
typescript_1.isArrowFunction(node) ||
typescript_1.isMethodDeclaration(node) ||
typescript_1.isGetAccessorDeclaration(node));
}
//# sourceMappingURL=explicitReturnTypeRule.js.map

2

package.json
{
"name": "@magicspace/tslint-rules",
"version": "0.1.14",
"version": "0.1.15",
"description": "Custom TSLint rules for MagicSpace.",

@@ -5,0 +5,0 @@ "repository": "https://github.com/makeflow/magicspace.git",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc