We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
lodash.get()
1 parent 7a2e1ab commit 6ef957aCopy full SHA for 6ef957a
rules/no-array-reduce.js
@@ -1,5 +1,4 @@
1
'use strict';
2
-const {get} = require('lodash');
3
const {methodCallSelector} = require('./selectors/index.js');
4
const {arrayPrototypeMethodSelector, notFunctionSelector, matches} = require('./selectors/index.js');
5
@@ -54,7 +53,7 @@ const create = context => {
54
53
55
return {
56
[selector](node) {
57
- const callback = get(node, 'parent.parent.arguments[0]', {});
+ const callback = node.parent.parent?.arguments?.[0] ?? {};
58
const problem = {
59
node,
60
messageId: MESSAGE_ID,
0 commit comments