Skip to content

Commit

Permalink
Avoid for..of
Browse files Browse the repository at this point in the history
Co-authored-by: Jordan Harband <ljharb@gmail.com>
  • Loading branch information
golopot and ljharb committed Dec 24, 2020
1 parent 8e6c3c1 commit 4ceebf0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rules/no-unused-prop-types.js
Expand Up @@ -65,7 +65,9 @@ module.exports = {
* @returns {Boolean} True if the prop is used, false if not.
*/
function isPropUsed(node, prop) {
for (const usedProp of node.usedPropTypes || []) {
const usedPropTypes = node.usedPropTypes || [];
for (let i = 0, l = usedPropTypes.length; i < l; i++) {
const usedProp = usedPropTypes[i];
if (
prop.type === 'shape'
|| prop.type === 'exact'
Expand Down

0 comments on commit 4ceebf0

Please sign in to comment.