Skip to content

Commit

Permalink
fix: noDupeKeys ignores ObjectTypeSpreadProperty (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
uforic authored and gajus committed Apr 14, 2018
1 parent d7ccd0d commit 7946b04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rules/noDupeKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ const create = (context) => {

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

_.forEach(node.properties, (identifierNode) => {
_.forEach(identifierNodes, (identifierNode) => {
const needle = {name: getParameterName(identifierNode, context)};

if (identifierNode.value.type === 'FunctionTypeAnnotation') {
Expand Down

0 comments on commit 7946b04

Please sign in to comment.