@@ -4,13 +4,13 @@ const getDocsUrl = require('./utils/get-docs-url');
4
4
5
5
// Matches `someObj.then([FunctionExpression | ArrowFunctionExpression])`
6
6
function isLintablePromiseCatch ( node ) {
7
- const callee = node . callee ;
7
+ const { callee} = node ;
8
8
9
9
if ( callee . type !== 'MemberExpression' ) {
10
10
return false ;
11
11
}
12
12
13
- const property = callee . property ;
13
+ const { property} = callee ;
14
14
15
15
if ( property . type !== 'Identifier' || property . name !== 'catch' ) {
16
16
return false ;
@@ -20,7 +20,7 @@ function isLintablePromiseCatch(node) {
20
20
return false ;
21
21
}
22
22
23
- const arg0 = node . arguments [ 0 ] ;
23
+ const [ arg0 ] = node . arguments ;
24
24
25
25
return arg0 . type === 'FunctionExpression' || arg0 . type === 'ArrowFunctionExpression' ;
26
26
}
@@ -42,7 +42,7 @@ const create = context => {
42
42
caughtErrorsIgnorePattern : '^_$'
43
43
} , context . options [ 0 ] ) ;
44
44
45
- const name = options . name ;
45
+ const { name} = options ;
46
46
const caughtErrorsIgnorePattern = new RegExp ( options . caughtErrorsIgnorePattern ) ;
47
47
const stack = [ ] ;
48
48
@@ -68,7 +68,7 @@ const create = context => {
68
68
return {
69
69
CallExpression : node => {
70
70
if ( isLintablePromiseCatch ( node ) ) {
71
- const params = node . arguments [ 0 ] . params ;
71
+ const { params} = node . arguments [ 0 ] ;
72
72
73
73
if ( params . length > 0 && params [ 0 ] . name === '_' ) {
74
74
push ( ! astUtils . containsIdentifier ( '_' , node . arguments [ 0 ] . body ) ) ;
0 commit comments