Skip to content

Commit 6ef957a

Browse files
XhmikosRfisker
andauthored
Replace lodash.get() with a native solution (#1818)
Co-authored-by: fisker Cheung <[email protected]>
1 parent 7a2e1ab commit 6ef957a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

rules/no-array-reduce.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict';
2-
const {get} = require('lodash');
32
const {methodCallSelector} = require('./selectors/index.js');
43
const {arrayPrototypeMethodSelector, notFunctionSelector, matches} = require('./selectors/index.js');
54

@@ -54,7 +53,7 @@ const create = context => {
5453

5554
return {
5655
[selector](node) {
57-
const callback = get(node, 'parent.parent.arguments[0]', {});
56+
const callback = node.parent.parent?.arguments?.[0] ?? {};
5857
const problem = {
5958
node,
6059
messageId: MESSAGE_ID,

0 commit comments

Comments
 (0)