eslint-plugin-flowtype
Advanced tools
Comparing version 2.30.4 to 2.31.0
@@ -27,2 +27,6 @@ 'use strict'; | ||
var _noTypesMissingFileAnnotation = require('./rules/noTypesMissingFileAnnotation'); | ||
var _noTypesMissingFileAnnotation2 = _interopRequireDefault(_noTypesMissingFileAnnotation); | ||
var _requireParameterType = require('./rules/requireParameterType'); | ||
@@ -113,2 +117,3 @@ | ||
'no-primitive-constructor-types': _noPrimitiveConstructorTypes2.default, | ||
'no-types-missing-file-annotation': _noTypesMissingFileAnnotation2.default, | ||
'no-weak-types': _noWeakTypes2.default, | ||
@@ -135,3 +140,3 @@ 'object-type-delimiter': _objectTypeDelimiter2.default, | ||
}, | ||
rules: _lodash2.default.mapValues(rules, function (rule) { | ||
rules: _lodash2.default.mapValues(rules, function (rule, key) { | ||
// Support current and deprecated rule formats | ||
@@ -144,2 +149,6 @@ if (_lodash2.default.isPlainObject(rule)) { | ||
if (key === 'no-types-missing-file-annotation') { | ||
return rule; | ||
} | ||
return _lodash2.default.partial(_utilities.checkFlowFileAnnotation, rule); | ||
@@ -146,0 +155,0 @@ }), |
@@ -13,3 +13,13 @@ 'use strict'; | ||
/* eslint-disable flowtype/require-valid-file-annotation */ | ||
/** | ||
* Checks whether a file has an @flow or @noflow annotation. | ||
* @param context | ||
* @param [strict] - By default, the function returns true if the file starts with @flow but not if it | ||
* starts by @noflow. When the strict flag is set to false, the function returns true if the flag has @noflow also. | ||
*/ | ||
/* eslint-enable flowtype/require-valid-file-annotation */ | ||
exports.default = function (context) { | ||
var strict = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; | ||
var comments = context.getAllComments(); | ||
@@ -23,5 +33,5 @@ | ||
return (0, _isFlowFileAnnotation2.default)(firstComment.value) && !/no/.test(firstComment.value); | ||
return (0, _isFlowFileAnnotation2.default)(firstComment.value) && !(strict && /no/.test(firstComment.value)); | ||
}; | ||
module.exports = exports['default']; |
@@ -54,3 +54,3 @@ { | ||
}, | ||
"version": "2.30.4" | ||
"version": "2.31.0" | ||
} |
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
169629
48
1843