Skip to content

Commit

Permalink
object name could be underscore or lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemao committed Jul 2, 2016
1 parent 2933a1e commit 4652fdd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rules/all.js
Expand Up @@ -39,7 +39,7 @@ const errorMessages = {
module.exports = {
create (context) {
function checkForUnneededLibraryFunctions (node) {
const functionName = getUnderscoreFunctionName(node);
const functionName = get_FunctionName(node);
const errorMessage = errorMessages[functionName];

if (errorMessage) {
Expand All @@ -56,7 +56,7 @@ module.exports = {
}
};

function getUnderscoreFunctionName (node) {
function get_FunctionName (node) {
const callee = node.callee;
return callee && callee.object && callee.object.name === '_' && callee.property && callee.property.name;
return callee && callee.object && (callee.object.name === '_' || callee.object.name === 'lodash' || callee.object.name === 'underscore') && callee.property && callee.property.name;
}

0 comments on commit 4652fdd

Please sign in to comment.