File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -99,12 +99,12 @@ const getUtils = (
99
99
} ;
100
100
101
101
utils . reportJSDoc = ( msg , tag , handler ) => {
102
- report ( msg , ( fixer ) => {
102
+ report ( msg , handler ? ( fixer ) => {
103
103
handler ( ) ;
104
104
const replacement = utils . stringify ( jsdoc ) ;
105
105
106
106
return fixer . replaceText ( jsdocNode , replacement ) ;
107
- } , tag ) ;
107
+ } : null , tag ) ;
108
108
} ;
109
109
110
110
utils . getFunctionParameterNames = ( ) => {
Original file line number Diff line number Diff line change @@ -63,16 +63,15 @@ export default iterateJsdoc(({
63
63
} ;
64
64
65
65
missingTags . forEach ( ( { functionParameterName} , index ) => {
66
- utils . reportJSDoc ( `Missing JSDoc @${ preferredTagName } "${ functionParameterName } " declaration.` , null , ( ) => {
66
+ // Fix all missing tags the first time.
67
+ const fixer = index > 0 ? null : ( ) => {
67
68
if ( ! jsdoc . tags ) {
68
69
jsdoc . tags = [ ] ;
69
70
}
70
71
71
- // Fix all missing tags at the first time.
72
- if ( index === 0 ) {
73
- fixAll ( missingTags , jsdoc . tags ) ;
74
- }
75
- } ) ;
72
+ fixAll ( missingTags , jsdoc . tags ) ;
73
+ } ;
74
+ utils . reportJSDoc ( `Missing JSDoc @${ preferredTagName } "${ functionParameterName } " declaration.` , null , fixer ) ;
76
75
} ) ;
77
76
} , {
78
77
meta : {
You can’t perform that action at this time.
0 commit comments