eslint-plugin-flowtype
Advanced tools
Comparing version 5.7.0 to 5.7.1
@@ -35,4 +35,5 @@ "use strict"; | ||
); | ||
}; | ||
}; // type Props = {| +foo: string |} | ||
const isReadOnlyObjectType = (node, { | ||
@@ -59,6 +60,17 @@ useImplicitExactTypes | ||
}); | ||
}; // type Props = {| +foo: string |} | {| +bar: number |} | ||
const isReadOnlyObjectUnionType = (node, options) => { | ||
if (!node || node.type !== 'UnionTypeAnnotation') { | ||
return false; | ||
} | ||
return node.types.every(type => { | ||
return isReadOnlyObjectType(type, options); | ||
}); | ||
}; | ||
const isReadOnlyType = (node, options) => { | ||
return node.right.id && reReadOnly.test(node.right.id.name) || isReadOnlyObjectType(node.right, options); | ||
return node.right.id && reReadOnly.test(node.right.id.name) || isReadOnlyObjectType(node.right, options) || isReadOnlyObjectUnionType(node.right, options); | ||
}; | ||
@@ -141,3 +153,3 @@ | ||
message: identifier.name + ' must be $ReadOnly', | ||
node | ||
node: identifier | ||
}); | ||
@@ -144,0 +156,0 @@ reportedFunctionalComponents.push(identifier); |
@@ -67,3 +67,3 @@ { | ||
}, | ||
"version": "5.7.0" | ||
"version": "5.7.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
309105
3942
6630