Skip to content

Commit f45e2c7

Browse files
fix: invalid flatMap to map with reduce
1 parent 3265da7 commit f45e2c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/rules/boolean-prop-naming.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,8 @@ module.exports = {
385385
} else if (annotation.type === 'TSTypeReference') {
386386
propType = objectTypeAnnotations.get(annotation.typeName.name);
387387
} else if (annotation.type === 'TSIntersectionType') {
388-
propType = annotation.types.flatMap((type) => objectTypeAnnotations.get(type.typeName.name));
388+
propType = annotation.types.map((type) => objectTypeAnnotations.get(type.typeName.name))
389+
.reduce((prev, cur) => [...prev, ...cur], []);
389390
}
390391

391392
if (propType) {

0 commit comments

Comments
 (0)