File tree Expand file tree Collapse file tree 3 files changed +13
-15
lines changed Expand file tree Collapse file tree 3 files changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -14,17 +14,15 @@ export default iterateJsdoc(({
14
14
return ;
15
15
}
16
16
17
- const options = context . options [ 0 ] || {
18
- avoidExampleOnConstructors : false
19
- } ;
17
+ const { avoidExampleOnConstructors = false } = context . options [ 0 ] || { } ;
20
18
21
19
const targetTagName = 'example' ;
22
20
23
21
const functionExamples = _ . filter ( jsdoc . tags , {
24
22
tag : targetTagName
25
23
} ) ;
26
24
27
- if ( options . avoidExampleOnConstructors && (
25
+ if ( avoidExampleOnConstructors && (
28
26
utils . hasATag ( [
29
27
'class' ,
30
28
'constructor'
Original file line number Diff line number Diff line change @@ -54,10 +54,10 @@ export default iterateJsdoc(({
54
54
return ;
55
55
}
56
56
57
- const options = context . options [ 0 ] || {
58
- forceRequireReturn : false ,
59
- forceReturnsWithAsync : false
60
- } ;
57
+ const {
58
+ forceRequireReturn = false ,
59
+ forceReturnsWithAsync = false
60
+ } = context . options [ 0 ] || { } ;
61
61
62
62
const tagName = utils . getPreferredTagName ( 'returns' ) ;
63
63
if ( ! tagName ) {
@@ -73,7 +73,7 @@ export default iterateJsdoc(({
73
73
const [ tag ] = tags ;
74
74
const missingReturnTag = typeof tag === 'undefined' || tag === null ;
75
75
if ( missingReturnTag &&
76
- ( ( utils . isAsync ( ) && ! utils . hasReturnValue ( true ) ? options . forceReturnsWithAsync : utils . hasReturnValue ( ) ) || options . forceRequireReturn )
76
+ ( ( utils . isAsync ( ) && ! utils . hasReturnValue ( true ) ? forceReturnsWithAsync : utils . hasReturnValue ( ) ) || forceRequireReturn )
77
77
) {
78
78
report ( `Missing JSDoc @${ tagName } declaration.` ) ;
79
79
}
Original file line number Diff line number Diff line change @@ -12,10 +12,10 @@ export default iterateJsdoc(({
12
12
} ) => {
13
13
warnRemovedSettings ( context , 'valid-types' ) ;
14
14
15
- const options = context . options [ 0 ] || {
16
- allowEmptyNamepaths : true ,
17
- checkSeesForNamepaths : false
18
- } ;
15
+ const {
16
+ allowEmptyNamepaths = true ,
17
+ checkSeesForNamepaths = false
18
+ } = context . options [ 0 ] || { } ;
19
19
20
20
if ( ! jsdoc . tags ) {
21
21
return ;
@@ -75,8 +75,8 @@ export default iterateJsdoc(({
75
75
76
76
validTypeParsing ( thatNamepath ) ;
77
77
}
78
- } else if ( utils . isNamepathTag ( tag . tag , options . checkSeesForNamepaths ) ) {
79
- if ( utils . passesEmptyNamepathCheck ( tag , options . allowEmptyNamepaths ) ) {
78
+ } else if ( utils . isNamepathTag ( tag . tag , checkSeesForNamepaths ) ) {
79
+ if ( utils . passesEmptyNamepathCheck ( tag , allowEmptyNamepaths ) ) {
80
80
return ;
81
81
}
82
82
validTypeParsing ( tag . name , tag . tag ) ;
You can’t perform that action at this time.
0 commit comments