eslint-plugin-lodash
Advanced tools
Comparing version 2.4.1 to 2.4.2
@@ -11,4 +11,11 @@ # Change Log | ||
[unreleased]: https://github.com/wix/eslint-plugin-lodash/compare/v2.4.1...HEAD | ||
[unreleased]: https://github.com/wix/eslint-plugin-lodash/compare/v2.4.2...HEAD | ||
## [2.4.2] - 2017-05-01 | ||
### Fixed | ||
- Fixed `prefer-lodash-method` warning on string methods not in the current version ([`401d28a`][401d28a]) | ||
[401d28a]: https://github.com/wix/eslint-plugin-lodash/commit/401d28aaee8d7fd23b2b388243739eecb07a2052 | ||
[2.4.2]: https://github.com/wix/eslint-plugin-lodash/compare/v2.4.2...v2.4.1 | ||
## [2.4.1] - 2017-04-26 | ||
@@ -15,0 +22,0 @@ ### Fixed |
@@ -41,2 +41,5 @@ /** | ||
var _require3 = require('../util/methodDataUtil'), | ||
methodExists = _require3.methodExists; | ||
var keys = require('lodash/keys'); | ||
@@ -84,3 +87,4 @@ var get = require('lodash/get'); | ||
function isNativeStringMethodCall(node) { | ||
return includes(keys(nativeStringMap), getMethodName(node)); | ||
var lodashFunction = nativeStringMap[getMethodName(node)]; | ||
return Boolean(lodashFunction) && methodExists(lodashContext.version, lodashFunction); | ||
} | ||
@@ -87,0 +91,0 @@ |
@@ -1148,9 +1148,2 @@ 'use strict'; | ||
}, | ||
replace: { | ||
aliases: [], | ||
wrapper: true, | ||
shorthand: false, | ||
chainable: false, | ||
iteratee: false | ||
}, | ||
rest: { | ||
@@ -1157,0 +1150,0 @@ aliases: ["tail"], |
@@ -148,2 +148,12 @@ 'use strict'; | ||
/** | ||
* Returns whether the method exists in the specified version | ||
* @param {number} version | ||
* @param {string} method | ||
* @returns {boolean} | ||
*/ | ||
function methodExists(version, method) { | ||
return Boolean(getMethodData(version)[method]); | ||
} | ||
module.exports = { | ||
@@ -159,3 +169,4 @@ isAliasOfMethod: isAliasOfMethod, | ||
getFunctionMaxArity: getFunctionMaxArity, | ||
getSideEffectIterationMethods: getSideEffectIterationMethods | ||
getSideEffectIterationMethods: getSideEffectIterationMethods, | ||
methodExists: methodExists | ||
}; | ||
@@ -162,0 +173,0 @@ |
{ | ||
"name": "eslint-plugin-lodash", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"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
266538
7554