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.30.4 to 2.31.0

dist/rules/noTypesMissingFileAnnotation.js

11

dist/index.js

@@ -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'];

2

package.json

@@ -54,3 +54,3 @@ {

},
"version": "2.30.4"
"version": "2.31.0"
}
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