@@ -4,13 +4,13 @@ const getDocsUrl = require('./utils/get-docs-url');
44
55// Matches `someObj.then([FunctionExpression | ArrowFunctionExpression])`
66function isLintablePromiseCatch ( node ) {
7- const callee = node . callee ;
7+ const { callee} = node ;
88
99 if ( callee . type !== 'MemberExpression' ) {
1010 return false ;
1111 }
1212
13- const property = callee . property ;
13+ const { property} = callee ;
1414
1515 if ( property . type !== 'Identifier' || property . name !== 'catch' ) {
1616 return false ;
@@ -20,7 +20,7 @@ function isLintablePromiseCatch(node) {
2020 return false ;
2121 }
2222
23- const arg0 = node . arguments [ 0 ] ;
23+ const [ arg0 ] = node . arguments ;
2424
2525 return arg0 . type === 'FunctionExpression' || arg0 . type === 'ArrowFunctionExpression' ;
2626}
@@ -42,7 +42,7 @@ const create = context => {
4242 caughtErrorsIgnorePattern : '^_$'
4343 } , context . options [ 0 ] ) ;
4444
45- const name = options . name ;
45+ const { name} = options ;
4646 const caughtErrorsIgnorePattern = new RegExp ( options . caughtErrorsIgnorePattern ) ;
4747 const stack = [ ] ;
4848
@@ -68,7 +68,7 @@ const create = context => {
6868 return {
6969 CallExpression : node => {
7070 if ( isLintablePromiseCatch ( node ) ) {
71- const params = node . arguments [ 0 ] . params ;
71+ const { params} = node . arguments [ 0 ] ;
7272
7373 if ( params . length > 0 && params [ 0 ] . name === '_' ) {
7474 push ( ! astUtils . containsIdentifier ( '_' , node . arguments [ 0 ] . body ) ) ;
0 commit comments