Skip to content

Commit f80d956

Browse files
committed
Update based on code review feedback
1 parent 0933216 commit f80d956

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ You should also specify settings that will be shared across all the plugin rules
4242
"version": "15.0", // React version, default to the latest React stable release
4343
"flowVersion": "0.53" // Flow version
4444
},
45-
"propWrapperFunctions": [ // The names of any functions used to wrap the
46-
"forbidExtraProps", // propTypesObject, e.g. `forbidExtraProps`
47-
{"property": "freeze", "object": "Object"} // If this isn't set, any propTypes wrapped in
48-
{"property": "myFavoriteWrapper"} // a function will be skipped.
45+
"propWrapperFunctions": [
46+
// The names of any function used to wrap propTypes, e.g. `forbidExtraProps`. If this isn't set, any propTypes wrapped in a function will be skipped.
47+
"forbidExtraProps",
48+
{"property": "freeze", "object": "Object"}
49+
{"property": "myFavoriteWrapper"}
4950
]
5051
}
5152
}

lib/util/propWrapper.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ function getPropWrapperFunctions(context) {
1010
function isPropWrapperFunction(context, name) {
1111
const propWrapperFunctions = getPropWrapperFunctions(context);
1212
const splitName = name.split('.');
13-
const found = Array.from(propWrapperFunctions).find(func => {
13+
return Array.from(propWrapperFunctions).some(func => {
1414
if (splitName.length === 2 && func.object === splitName[0] && func.property === splitName[1]) {
1515
return true;
1616
}
1717
return name === func || func.property === name;
1818
});
19-
return Boolean(found);
2019
}
2120

2221
module.exports = {

0 commit comments

Comments
 (0)