diff --git a/lib/rules/style-prop-object.js b/lib/rules/style-prop-object.js index da401273b5..7d27fd1755 100644 --- a/lib/rules/style-prop-object.js +++ b/lib/rules/style-prop-object.js @@ -35,7 +35,7 @@ module.exports = { }, create: function(context) { - const allowed = context.options.length > 0 && context.options[0].allow || []; + const allowed = context.options.length > 0 && new Set(context.options[0].allow || []); /** * @param {object} node An Identifier node @@ -72,7 +72,7 @@ module.exports = { const componentName = node.arguments[0].name; // allowed list contains the name - if (allowed.indexOf(componentName) > -1) { + if (allowed.has(componentName)) { // abort operation return; }