File tree Expand file tree Collapse file tree 3 files changed +38
-6
lines changed Expand file tree Collapse file tree 3 files changed +38
-6
lines changed Original file line number Diff line number Diff line change @@ -2531,17 +2531,27 @@ function quux () {
25312531 */
25322532const quux = () => foo;
25332533
2534- /**
2534+ /**
2535+ * @returns {undefined} Foo.
2536+ */
2537+ function quux () {}
2538+
2539+ /**
2540+ * @returns { void } Foo.
2541+ */
2542+ function quux () {}
2543+
2544+ /**
25352545 * @returns {Promise<void>}
25362546 */
25372547async function quux () {}
25382548
2539- /**
2549+ /**
25402550 * @returns {Promise<void>}
25412551 */
25422552async () => {}
25432553
2544- /**
2554+ /**
25452555 * @returns Foo.
25462556 * @abstract
25472557 */
Original file line number Diff line number Diff line change @@ -37,6 +37,12 @@ export default iterateJsdoc(({
3737 return ;
3838 }
3939
40+ const returnsTagType = jsdocTags [ 0 ] . type && jsdocTags [ 0 ] . type . trim ( ) ;
41+
42+ if ( returnsTagType === 'void' || returnsTagType === 'undefined' ) {
43+ return ;
44+ }
45+
4046 // An abstract function is by definition incomplete
4147 // so it is perfectly fine if the return is missing
4248 // a subclass may inherits the doc an implements the
Original file line number Diff line number Diff line change @@ -125,7 +125,23 @@ export default {
125125 } ,
126126 {
127127 code : `
128- /**
128+ /**
129+ * @returns {undefined} Foo.
130+ */
131+ function quux () {}
132+ `
133+ } ,
134+ {
135+ code : `
136+ /**
137+ * @returns { void } Foo.
138+ */
139+ function quux () {}
140+ `
141+ } ,
142+ {
143+ code : `
144+ /**
129145 * @returns {Promise<void>}
130146 */
131147 async function quux() {}
@@ -136,7 +152,7 @@ export default {
136152 } ,
137153 {
138154 code : `
139- /**
155+ /**
140156 * @returns {Promise<void>}
141157 */
142158 async () => {}
@@ -147,7 +163,7 @@ export default {
147163 } ,
148164 {
149165 code : `
150- /**
166+ /**
151167 * @returns Foo.
152168 * @abstract
153169 */
You can’t perform that action at this time.
0 commit comments