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 3.11.0 to 3.11.1

19

dist/rules/requireValidFileAnnotation.js

@@ -39,6 +39,11 @@ 'use strict';

var isFlowStrict = function isFlowStrict(comment) {
return (/@flow\sstrict\b/.test(comment)
return (/^@flow\sstrict\b/.test(comment)
);
};
var noFlowAnnotation = function noFlowAnnotation(comment) {
return (/^@noflow\b/.test(comment)
);
};
var schema = [{

@@ -99,11 +104,11 @@ enum: ['always', 'never'],

}
if ((0, _utilities.isFlowFileAnnotation)(potentialFlowFileAnnotation.value.trim())) {
var annotationValue = potentialFlowFileAnnotation.value.trim();
if ((0, _utilities.isFlowFileAnnotation)(annotationValue)) {
if (!isValidAnnotationStyle(potentialFlowFileAnnotation, style)) {
var str = style === 'line' ? '`// ' + potentialFlowFileAnnotation.value.trim() + '`' : '`/* ' + potentialFlowFileAnnotation.value.trim() + ' */`';
var str = style === 'line' ? '`// ' + annotationValue + '`' : '`/* ' + annotationValue + ' */`';
context.report(potentialFlowFileAnnotation, 'Flow file annotation style must be ' + str);
}
if (flowStrict) {
if (!isFlowStrict(potentialFlowFileAnnotation.value.trim())) {
if (!noFlowAnnotation(annotationValue) && flowStrict) {
if (!isFlowStrict(annotationValue)) {
var _str = style === 'line' ? '`// @flow strict`' : '`/* @flow strict */`';

@@ -117,3 +122,3 @@ context.report({

}
} else if (checkAnnotationSpelling(potentialFlowFileAnnotation.value.trim())) {
} else if (checkAnnotationSpelling(annotationValue)) {
context.report(potentialFlowFileAnnotation, 'Misspelled or malformed Flow file annotation.');

@@ -120,0 +125,0 @@ } else {

@@ -63,3 +63,3 @@ {

},
"version": "3.11.0"
"version": "3.11.1"
}

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