eslint-plugin-lodash
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -11,4 +11,13 @@ # Change Log | ||
[unreleased]: https://github.com/wix/eslint-plugin-lodash/compare/v1.1.0...HEAD | ||
[unreleased]: https://github.com/wix/eslint-plugin-lodash/compare/v1.1.1...HEAD | ||
## [1.1.1] - 2016-02-22 | ||
### Fixed | ||
- Fixed error where `prefer-times` crashes when using destructuring. ([`926a449`][926a449]) | ||
[926a449]: https://github.com/wix/eslint-plugin-lodash/commit/926a449043a074ec906854f4c6b3981702e91882 | ||
[1.1.1]: https://github.com/wix/eslint-plugin-lodash/compare/v1.1.1...v1.1.0 | ||
## [1.1.0] - 2016-02-21 | ||
@@ -15,0 +24,0 @@ ### Added |
@@ -15,11 +15,27 @@ /** | ||
var settings = require('../util/settingsUtil').getSettings(context); | ||
function getParamName(paramNode) { | ||
return paramNode.name || paramNode.left.name; | ||
function getObjectPatternProperties(node) { | ||
return _.flatMap(node.properties, function (prop) { | ||
if (prop.shorthand) { | ||
return prop.key.name; | ||
} | ||
if (prop.value.type === 'Identifier') { | ||
return prop.value.name; | ||
} | ||
return getObjectPatternProperties(prop.value); | ||
}); | ||
} | ||
var getParamNames = _.cond([ | ||
[_.matches({type: 'Identifier'}), _.property('name')], | ||
[_.matches({type: 'ObjectPattern'}), getObjectPatternProperties] | ||
]); | ||
function handleFunctionExpression(node) { | ||
if (lodashUtil.isCallToMethod(node.parent, settings.version, 'map') && (lodashUtil.isLodashCall(node.parent, settings.pragma) || lodashUtil.isLodashWrapper(node.parent, settings.pragma, settings.version))) { | ||
callStack.push({func: node, params: _.map(node.params, getParamName), anyUsed: false}); | ||
callStack.push({func: node, params: _.flatMap(node.params, getParamNames), anyUsed: false}); | ||
} | ||
} | ||
function handleExitFunctionExpression(node) { | ||
@@ -26,0 +42,0 @@ var state = _.last(callStack); |
{ | ||
"name": "eslint-plugin-lodash", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"author": "Omer Ganim <ganimomer@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Lodash specific linting rules for ESLint", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
116978
2792