eslint-plugin-lodash
Advanced tools
Comparing version 1.0.6 to 1.1.0
@@ -11,7 +11,20 @@ # Change Log | ||
[unreleased]: https://github.com/wix/eslint-plugin-lodash/compare/v1.0.6...HEAD | ||
[unreleased]: https://github.com/wix/eslint-plugin-lodash/compare/v1.1.0...HEAD | ||
## [1.1.0] - 2016-02-21 | ||
### Added | ||
- Added rule [`identity-shorthand`][identity-shorthand]. ([`e1e5ee3`][e1e5ee3]) | ||
- Added fixer for rule `preferred-alias`. ([`0ea186e`][0ea186e]) | ||
- Added fixer for rule `no-double-unwrap`. ([`105e873`][105e873]) | ||
[0ea186e]: https://github.com/wix/eslint-plugin-lodash/commit/0ea186e90c5cdac73a64813167761e5ee0ea6f91 | ||
[105e873]: https://github.com/wix/eslint-plugin-lodash/commit/105e8739f23fd32be5cc3d3c042d44deca259ecd | ||
[e1e5ee3]: https://github.com/wix/eslint-plugin-lodash/commit/e1e5ee310a473f92ef19391a4cd9793cd10dbf6b | ||
[1.1.0]: https://github.com/wix/eslint-plugin-lodash/compare/v1.1.0...v1.0.6 | ||
## [1.0.6] - 2016-02-18 | ||
### Added | ||
- Added rule [`path-style`][path-style]. ([`7166adc`][7166adc] | ||
- Added rule [`path-style`][path-style]. ([`7166adc`][7166adc]) | ||
- Added rule [`no-extra-args`][no-extra-args]. ([`b11e566`][b11e566]) | ||
@@ -106,2 +119,3 @@ | ||
[no-extra-args]: docs/rules/no-extra-args.md | ||
[identity-shorthand]: docs/rules/identity-shorthand.md | ||
@@ -108,0 +122,0 @@ <!-- |
@@ -22,3 +22,10 @@ /** | ||
if (astUtil.isMethodCall(node) && !lodashUtil.isChainable(caller, settings.version)) { | ||
context.report(node, 'Do not use .value() after chain-ending method {{method}}', {method: astUtil.getMethodName(caller)}); | ||
context.report({ | ||
node: node, | ||
message: 'Do not use .value() after chain-ending method {{method}}', | ||
data: {method: astUtil.getMethodName(caller)}, | ||
fix: function (fixer) { | ||
return fixer.removeRange([caller.range[1], node.range[1]]); | ||
} | ||
}); | ||
} | ||
@@ -25,0 +32,0 @@ } |
/** | ||
* @fileoverview Rule to disallow using _.prototype.commit. | ||
* @fileoverview Rule to make sure lodash method calls don't use superfluous arguments | ||
*/ | ||
@@ -4,0 +4,0 @@ 'use strict'; |
@@ -31,5 +31,12 @@ /** | ||
if (_.has(expandedAliases, methodName)) { | ||
context.report(node.callee.property, "Method '{{old}}' is an alias, for consistency prefer using '{{new}}'", { | ||
old: methodName, | ||
new: expandedAliases[methodName] | ||
context.report({ | ||
node: node.callee.property, | ||
message: "Method '{{old}}' is an alias, for consistency prefer using '{{new}}'", | ||
data: { | ||
old: methodName, | ||
new: expandedAliases[methodName] | ||
}, | ||
fix: function (fixer) { | ||
return fixer.replaceText(node.callee.property, expandedAliases[methodName]); | ||
} | ||
}); | ||
@@ -36,0 +43,0 @@ } |
@@ -243,4 +243,3 @@ 'use strict'; | ||
sortedIndex: 2, | ||
sortedLastIndex: 2, | ||
uniq: 2 | ||
sortedLastIndex: 2 | ||
} | ||
@@ -247,0 +246,0 @@ }, |
{ | ||
"name": "eslint-plugin-lodash", | ||
"version": "1.0.6", | ||
"version": "1.1.0", | ||
"author": "Omer Ganim <ganimomer@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Lodash specific linting rules for ESLint", |
@@ -82,4 +82,5 @@ ESLint-Plugin-Lodash | ||
"rules": { | ||
"lodash/prop-shorthand": 2, | ||
"lodash/prop-shorthand": [2, "always"], | ||
"lodash/matches-shorthand": [2, "always", 3], | ||
"lodash/identity-shorthand": [2, "always"], | ||
"lodash/matches-prop-shorthand": [2, "always"], | ||
@@ -123,3 +124,3 @@ "lodash/prefer-chain": [2, 3], | ||
* [unwrap](docs/rules/unwrap.md): Prevent chaining without evaluation via `value()` or non-chainable methods like `max()`., | ||
* [no-double-unwrap](docs/rules/no-double-unwrap.md): Do not use `.value()` on chains that have already ended (e.g. with `max()` or `reduce()`) | ||
* [no-double-unwrap](docs/rules/no-double-unwrap.md): Do not use `.value()` on chains that have already ended (e.g. with `max()` or `reduce()`) (fixable) | ||
* [collection-return](docs/rules/collection-return.md): Always return a value in iteratees of Lodash collection methods that aren't `forEach`. | ||
@@ -133,3 +134,4 @@ * [no-extra-args](docs/rules/no-extra-args.md): Do not use superfluous arguments on Lodash methods with a specified arity. | ||
* [matches-shorthand](docs/rules/matches-shorthand.md): Prefer matches shorthand syntax | ||
* [preferred-alias](docs/rules/preferred-alias.md): Prefer using main method names instead of aliases | ||
* [identity-shorthand](docs/rules/identity-shorthand.md): Prefer identity shorthand syntax | ||
* [preferred-alias](docs/rules/preferred-alias.md): Prefer using main method names instead of aliases. (fixable) | ||
* [prefer-chain](docs/rules/prefer-chain.md): Prefer a Lodash chain over nested Lodash calls | ||
@@ -136,0 +138,0 @@ * [no-single-chain](docs/rules/no-single-chain.md): Prevent chaining syntax for single method, e.g. `_(x).map().value()` |
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
116204
43
2780
183