eslint-plugin-lodash
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -11,8 +11,18 @@ # Change Log | ||
[unreleased]: https://github.com/wix/eslint-plugin-lodash/compare/v2.0.0...HEAD | ||
[unreleased]: https://github.com/wix/eslint-plugin-lodash/compare/v2.1.0...HEAD | ||
## [2.1.0] - 2016-10-13 | ||
### Added | ||
- Added String.prototype methods to `prefer-lodash-method`. ([`6a44330`][6a44330]) | ||
### Fixed | ||
- Fixed schema for `prefer-lodash-method`. ([`a3eb338`][a3eb338]) | ||
[6a44330]: https://github.com/wix/eslint-plugin-lodash/commit/6a443301960f4e173b4e8911b2b4986066ed2eb2 | ||
[a3eb338]: https://github.com/wix/eslint-plugin-lodash/commit/a3eb3388e92c47ac8e182dd203133703ee6c426c | ||
[2.1.0]: https://github.com/wix/eslint-plugin-lodash/compare/v2.1.0...v2.0.0 | ||
## [2.0.0] - 2016-10-13 | ||
## Added | ||
### Added | ||
- Added support for single-method imports in all rules. ([`8a55217`][8a55217]) | ||
## Changed | ||
### Changed | ||
- Changed role of the `pragma` setting to be a hint instead of mandatory and removed the default pragma, `_`. ([`8a55217`][8a55217]) | ||
@@ -25,3 +35,3 @@ - Changed recommended config to be pragma-less and added the `canonical` config for use with the full lodash build's `_` pragma. ([`8a55217`][8a55217]) | ||
- Removed support for node 0.10. ([`8a55217`][8a55217]) | ||
## Fixed | ||
### Fixed | ||
- Fixed `prefer-lodash-typecheck` to warn on undefined checks of declared variables. ([`8ee071a`][8ee071a]) | ||
@@ -28,0 +38,0 @@ - Fixed case in `prefer-map` where the push is from a declared iteratee parameter. ([`fc5a592`][fc5a592]) |
@@ -17,3 +17,3 @@ /** | ||
properties: { | ||
methods: { | ||
ignoredMethods: { | ||
type: 'array', | ||
@@ -24,3 +24,3 @@ items: { | ||
}, | ||
objects: { | ||
ignoredObjects: { | ||
type: 'array', | ||
@@ -51,15 +51,13 @@ items: { | ||
var _map = ['get', 'includes', 'cond', 'matches', 'property', 'some', 'map'].map(function (m) { | ||
var _map = ['get', 'includes', 'matches', 'some', 'map'].map(function (m) { | ||
return require('lodash/' + m); | ||
}); | ||
var _map2 = _slicedToArray(_map, 7); | ||
var _map2 = _slicedToArray(_map, 5); | ||
var get = _map2[0]; | ||
var includes = _map2[1]; | ||
var cond = _map2[2]; | ||
var matches = _map2[3]; | ||
var property = _map2[4]; | ||
var some = _map2[5]; | ||
var map = _map2[6]; | ||
var matches = _map2[2]; | ||
var some = _map2[3]; | ||
var map = _map2[4]; | ||
@@ -84,9 +82,18 @@ var ignoredMethods = get(context, ['options', 0, 'ignoreMethods'], []); | ||
function isNativeStringMethodCall(node) { | ||
return includes(['endsWith', 'includes', 'padEnd', 'padStart', 'startsWith'], getMethodName(node)); | ||
} | ||
function canUseLodash(node) { | ||
return isNativeCollectionMethodCall(node) || isStaticNativeMethodCall(node); | ||
return isNativeCollectionMethodCall(node) || isStaticNativeMethodCall(node) || isNativeStringMethodCall(node); | ||
} | ||
var getTextOfNode = cond([[matches({ type: 'Identifier' }), property('name')], [property('type'), function (node) { | ||
return context.getSourceCode().getText(node); | ||
}]]); | ||
function getTextOfNode(node) { | ||
if (node) { | ||
if (node.type === 'Identifier') { | ||
return node.name; | ||
} | ||
return context.getSourceCode().getText(node); | ||
} | ||
} | ||
@@ -93,0 +100,0 @@ function someMatch(patterns, str) { |
{ | ||
"name": "eslint-plugin-lodash", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"author": "Omer Ganim <ganimomer@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Lodash specific linting rules for ESLint", |
@@ -10,2 +10,3 @@ ESLint-Plugin-Lodash | ||
For a detailed rundown of breaking changes and additions, you can check the [release notes](https://github.com/wix/eslint-plugin-lodash/wiki/Release-Notes). | ||
# Installation | ||
@@ -12,0 +13,0 @@ |
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
187089
3721
129