Skip to content

Commit

Permalink
Fix prop-shorthand breaking when using _.mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
ganimomer committed Dec 5, 2018
1 parent 69992b1 commit ca1faf4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/methodDataUtil.js
Expand Up @@ -66,7 +66,7 @@ function isCollectionMethod(version, method) {
function methodSupportsShorthand(version, method, shorthandType) {
const mainAlias = getMainAlias(version, method)
const methodShorthandData = _.get(getMethodData(version), [mainAlias, 'shorthand'])
return _.isBoolean(methodShorthandData) ? methodShorthandData : Boolean(shorthandType && methodShorthandData[shorthandType])
return _.isObject(methodShorthandData) ? Boolean(shorthandType && methodShorthandData[shorthandType]) : Boolean(methodShorthandData)
}

/**
Expand Down
1 change: 1 addition & 0 deletions tests/lib/rules/prop-shorthand.js
Expand Up @@ -27,6 +27,7 @@ ruleTester.run('prop-shorthand', rule, {
'var r = _.map([], function() { return React.PropTypes.object; })',
'var r = _.map([])',
'var r = _.map(results, result => result[result.length - 1]);',
'var x = _.mixedInMethod()',
{
code: 'var r = _.map([], function(x) { return x.id})',
options: ['never']
Expand Down

0 comments on commit ca1faf4

Please sign in to comment.