eslint-plugin-you-dont-need-lodash-underscore
Advanced tools
Comparing version 6.7.1 to 6.7.2
@@ -28,3 +28,3 @@ 'use strict'; | ||
const callee = node.callee; | ||
const objectName = callee.name || (callee.object && callee.object.name) || (callee.object.callee && callee.object.callee.name); | ||
const objectName = callee.name || (callee.object && callee.object.name) || (callee.object && callee.object.callee && callee.object.callee.name); | ||
@@ -31,0 +31,0 @@ if (objectName === 'require' && node.arguments.length === 1) { |
{ | ||
"name": "eslint-plugin-you-dont-need-lodash-underscore", | ||
"version": "6.7.1", | ||
"version": "6.7.2", | ||
"description": "Check methods you can use natively without lodash/underscore", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -113,1 +113,31 @@ 'use strict'; | ||
}); | ||
ruleTester.run('_.isUndefined', rules['is-undefined'], { | ||
valid: [ | ||
'2 === undefined' | ||
], | ||
invalid: [{ | ||
code: '_.isUndefined(2)', | ||
errors: ['Consider using the native value === undefined'] | ||
},{ | ||
code: '_(2).isUndefined()', | ||
errors: ['Consider using the native value === undefined'] | ||
}] | ||
}); | ||
/*This is to make sure that You-Dont-Need-Lodash can handle the | ||
evaluation of nested functions that had caused an error noted in the comments of | ||
Pull Request #219*/ | ||
ruleTester.run('Nested functions', rules['is-undefined'], { | ||
valid: [ | ||
`function myNestedFunction(firstInput) { | ||
return (secondInput) => { | ||
return firstInput + secondInput | ||
} | ||
} | ||
myNestedFunction(2)(2)` | ||
], | ||
invalid: [] | ||
}); | ||
Sorry, the diff of this file is too big to display
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
172566
14
1103
2664