eslint-plugin-lodash
Advanced tools
Comparing version 2.3.0 to 2.3.1
@@ -11,4 +11,11 @@ # Change Log | ||
[unreleased]: https://github.com/wix/eslint-plugin-lodash/compare/v2.3.0...HEAD | ||
[unreleased]: https://github.com/wix/eslint-plugin-lodash/compare/v2.3.1...HEAD | ||
## [2.3.1] - 2017-01-17 | ||
### Fixed | ||
- Allowed asterisk import in `import-scope` in `full` config ([`4c0335e`][4c0335e]) | ||
[4c0335e]: https://github.com/wix/eslint-plugin-lodash/commit/4c0335ec3b5d593b032a7876105bd2cacf2737c9 | ||
[2.3.1]: https://github.com/wix/eslint-plugin-lodash/compare/v2.3.1...v2.3.0 | ||
## [2.3.0] - 2017-01-16 | ||
@@ -15,0 +22,0 @@ ### Added |
@@ -20,2 +20,3 @@ /** | ||
var every = require('lodash/every'); | ||
var includes = require('lodash/includes'); | ||
@@ -25,9 +26,9 @@ var messages = { | ||
member: 'Import members from the full Lodash module.', | ||
full: 'Use the full Lodash module' | ||
full: 'Use the full Lodash module.' | ||
}; | ||
var importNodeTypes = { | ||
method: 'ImportDefaultSpecifier', | ||
member: 'ImportSpecifier', | ||
full: 'ImportDefaultSpecifier' | ||
method: ['ImportDefaultSpecifier'], | ||
member: ['ImportSpecifier'], | ||
full: ['ImportDefaultSpecifier', 'ImportNamespaceSpecifier'] | ||
}; | ||
@@ -38,2 +39,7 @@ | ||
}; | ||
var allImportsAreOfType = function allImportsAreOfType(node, types) { | ||
return every(node.specifiers, function (specifier) { | ||
return includes(types, specifier.type); | ||
}); | ||
}; | ||
@@ -55,4 +61,3 @@ module.exports = { | ||
} else { | ||
var type = importNodeTypes[importType]; | ||
if (!every(node.specifiers, { type: type })) { | ||
if (!allImportsAreOfType(node, importNodeTypes[importType])) { | ||
context.report(node, messages[importType]); | ||
@@ -59,0 +64,0 @@ } |
{ | ||
"name": "eslint-plugin-lodash", | ||
"version": "2.3.0", | ||
"version": "2.3.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
198956
3918