Socket
Socket
Sign inDemoInstall

eslint-plugin-flowtype

Package Overview
Dependencies
Maintainers
1
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-flowtype - npm Package Compare versions

Comparing version 2.29.2 to 2.30.0

8

CHANGELOG.md

@@ -5,4 +5,4 @@ # Change Log

<a name="2.29.2"></a>
## [2.29.2](https://github.com/gajus/eslint-plugin-flowtype/compare/v2.29.1...v2.29.2) (2016-12-29)
<a name="2.30.0"></a>
# [2.30.0](https://github.com/gajus/eslint-plugin-flowtype/compare/v2.29.1...v2.30.0) (2017-01-15)

@@ -14,4 +14,8 @@

### Features
* `require-return-type` include / exclude filter support ([3f4b947](https://github.com/gajus/eslint-plugin-flowtype/commit/3f4b947))
<a name="2.29.1"></a>

@@ -18,0 +22,0 @@ ## [2.29.1](https://github.com/gajus/eslint-plugin-flowtype/compare/v2.29.0...v2.29.1) (2016-12-01)

@@ -18,2 +18,9 @@ 'use strict';

var makeRegExp = function makeRegExp(str) {
return new RegExp(str);
};
var excludeMatching = _lodash2.default.get(context, 'options[1].excludeMatching', []).map(makeRegExp);
var includeOnlyMatching = _lodash2.default.get(context, 'options[1].includeOnlyMatching', []).map(makeRegExp);
var targetNodes = [];

@@ -38,2 +45,21 @@

var shouldFilterNode = function shouldFilterNode(functionNode) {
var isArrow = functionNode.type === 'ArrowFunctionExpression';
var identiferName = _lodash2.default.get(functionNode, isArrow ? 'parent.id.name' : 'id.name');
var checkRegExp = function checkRegExp(regex) {
return regex.test(identiferName);
};
if (excludeMatching.length && _lodash2.default.some(excludeMatching, checkRegExp)) {
return true;
}
if (includeOnlyMatching.length && !_lodash2.default.some(includeOnlyMatching, checkRegExp)) {
return true;
}
return false;
};
var evaluateFunction = function evaluateFunction(functionNode) {

@@ -61,3 +87,3 @@ var targetNode = targetNodes.pop();

} else if (!isFunctionReturnUndefined && !isReturnTypeAnnotationUndefined) {
if (annotateReturn && !functionNode.returnType) {
if (annotateReturn && !functionNode.returnType && !shouldFilterNode(functionNode)) {
context.report(functionNode, 'Missing return type annotation.');

@@ -64,0 +90,0 @@ }

{
"name": "eslint-plugin-flowtype",
"description": "Flowtype linting rules for ESLint.",
"version": "2.29.2",
"version": "2.30.0",
"main": "./dist/index.js",

@@ -6,0 +6,0 @@ "repository": {

Sorry, the diff of this file is too big to display

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