Skip to content

Commit

Permalink
fix: different flatMap import
Browse files Browse the repository at this point in the history
  • Loading branch information
eltonio450 committed Jun 9, 2020
1 parent cf7f4ff commit bc73891
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/propTypes.js
Expand Up @@ -290,7 +290,7 @@ module.exports = function propTypesInstructions(context, components, utils) {
}
// the game here is to find the type declaration in the code
const candidateTypes = context.getSourceCode().ast.body.filter((item) => item.type === 'VariableDeclaration' && item.kind === 'type');
const declarations = Array.prototype.flatMap(candidateTypes, (type) => type.declarations);
const declarations = flatMap(candidateTypes, (type) => type.declarations);

// we tried to find either an interface or a type with the TypeReference name
const typeDeclaration = declarations.find((dec) => dec.id.name === typeName);
Expand Down

0 comments on commit bc73891

Please sign in to comment.