@@ -48,10 +48,14 @@ const curryUtils = (
4848 return jsdocUtils . getFunctionParameterNames ( functionNode ) ;
4949 } ;
5050
51- utils . getFunctionSourceCode = function ( ) {
51+ utils . getFunctionSourceCode = ( ) => {
5252 return sourceCode . getText ( functionNode ) ;
5353 } ;
5454
55+ utils . isConstructor = ( ) => {
56+ return functionNode . parent && functionNode . parent . kind === 'constructor' ;
57+ } ;
58+
5559 utils . getJsdocParameterNamesDeep = ( ) => {
5660 return jsdocUtils . getJsdocParameterNamesDeep ( jsdoc , utils . getPreferredTagName ( 'param' ) ) ;
5761 } ;
@@ -80,6 +84,10 @@ const curryUtils = (
8084 return jsdocUtils . isValidTag ( name , additionalTagNames ) ;
8185 } ;
8286
87+ utils . hasATag = ( name ) => {
88+ return jsdocUtils . hasATag ( jsdoc , name ) ;
89+ } ;
90+
8391 utils . hasTag = ( name ) => {
8492 return jsdocUtils . hasTag ( jsdoc , name ) ;
8593 } ;
@@ -124,20 +132,28 @@ const curryUtils = (
124132 return allowAugmentsExtendsWithoutParam ;
125133 } ;
126134
127- utils . classHasTag = ( tagName ) => {
135+ utils . getClassJsdocNode = ( ) => {
128136 const greatGrandParent = ancestors . slice ( - 3 ) [ 0 ] ;
129137 const greatGrandParentValue = greatGrandParent && sourceCode . getFirstToken ( greatGrandParent ) . value ;
130138
131139 if ( greatGrandParentValue === 'class' ) {
132140 const classJsdocNode = sourceCode . getJSDocComment ( greatGrandParent ) ;
133141
134- if ( classJsdocNode ) {
135- const indent = _ . repeat ( ' ' , classJsdocNode . loc . start . column ) ;
136- const classJsdoc = parseComment ( classJsdocNode , indent ) ;
142+ return classJsdocNode ;
143+ }
137144
138- if ( jsdocUtils . hasTag ( classJsdoc , tagName ) ) {
139- return true ;
140- }
145+ return false ;
146+ } ;
147+
148+ utils . classHasTag = ( tagName ) => {
149+ const classJsdocNode = utils . getClassJsdocNode ( ) ;
150+
151+ if ( classJsdocNode ) {
152+ const indent = _ . repeat ( ' ' , classJsdocNode . loc . start . column ) ;
153+ const classJsdoc = parseComment ( classJsdocNode , indent ) ;
154+
155+ if ( jsdocUtils . hasTag ( classJsdoc , tagName ) ) {
156+ return true ;
141157 }
142158 }
143159
0 commit comments