eslint-plugin-flowtype
Advanced tools
Comparing version 3.11.0 to 3.11.1
@@ -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
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
259794
3342
5257