Skip to content

Commit 7946b04

Browse files
uforicgajus
authored andcommitted
fix: noDupeKeys ignores ObjectTypeSpreadProperty (#325)
1 parent d7ccd0d commit 7946b04

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rules/noDupeKeys.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ const create = (context) => {
5959

6060
const checkForDuplicates = (node) => {
6161
const haystack = [];
62+
// filter out complex object types, like ObjectTypeSpreadProperty
63+
const identifierNodes = _.filter(node.properties, {type: 'ObjectTypeProperty'});
6264

63-
_.forEach(node.properties, (identifierNode) => {
65+
_.forEach(identifierNodes, (identifierNode) => {
6466
const needle = {name: getParameterName(identifierNode, context)};
6567

6668
if (identifierNode.value.type === 'FunctionTypeAnnotation') {

0 commit comments

Comments
 (0)