File tree 3 files changed +56
-21
lines changed 3 files changed +56
-21
lines changed Original file line number Diff line number Diff line change @@ -20446,6 +20446,22 @@ export function readFixture(path: string): void;
20446
20446
export function readFixture(path: string);
20447
20447
// "jsdoc/require-returns": ["error"|"warn", {"forceRequireReturn":true}]
20448
20448
// Message: Missing JSDoc @returns declaration.
20449
+
20450
+ /**
20451
+ * @param {array} a
20452
+ */
20453
+ async function foo(a) {
20454
+ return Promise.all(a);
20455
+ }
20456
+ // Message: Missing JSDoc @returns declaration.
20457
+
20458
+ /**
20459
+ * Description.
20460
+ */
20461
+ export default async function demo() {
20462
+ return true;
20463
+ }
20464
+ // Message: Missing JSDoc @returns declaration.
20449
20465
````
20450
20466
20451
20467
The following patterns are not considered problems:
@@ -20930,13 +20946,6 @@ async function foo() {
20930
20946
return new Promise(resolve => resolve());
20931
20947
}
20932
20948
20933
- /**
20934
- * @param {array} a
20935
- */
20936
- async function foo(a) {
20937
- return Promise.all(a);
20938
- }
20939
-
20940
20949
/**
20941
20950
* @param ms time in millis
20942
20951
*/
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ export default iterateJsdoc(({
90
90
return true ;
91
91
}
92
92
93
- return ! isAsync && iteratingFunction && utils . hasValueOrExecutorHasNonEmptyResolveValue (
93
+ return iteratingFunction && utils . hasValueOrExecutorHasNonEmptyResolveValue (
94
94
forceReturnsWithAsync ,
95
95
) ;
96
96
} ;
Original file line number Diff line number Diff line change @@ -1726,6 +1726,45 @@ export default {
1726
1726
] ,
1727
1727
parser : require . resolve ( '@typescript-eslint/parser' ) ,
1728
1728
} ,
1729
+ {
1730
+ code : `
1731
+ /**
1732
+ * @param {array} a
1733
+ */
1734
+ async function foo(a) {
1735
+ return Promise.all(a);
1736
+ }
1737
+ ` ,
1738
+ errors : [
1739
+ {
1740
+ line : 2 ,
1741
+ message : 'Missing JSDoc @returns declaration.' ,
1742
+ } ,
1743
+ ] ,
1744
+ parserOptions : {
1745
+ ecmaVersion : 8 ,
1746
+ } ,
1747
+ } ,
1748
+ {
1749
+ code : `
1750
+ /**
1751
+ * Description.
1752
+ */
1753
+ export default async function demo() {
1754
+ return true;
1755
+ }
1756
+ ` ,
1757
+ errors : [
1758
+ {
1759
+ line : 2 ,
1760
+ message : 'Missing JSDoc @returns declaration.' ,
1761
+ } ,
1762
+ ] ,
1763
+ parserOptions : {
1764
+ ecmaVersion : 8 ,
1765
+ sourceType : 'module' ,
1766
+ } ,
1767
+ } ,
1729
1768
] ,
1730
1769
valid : [
1731
1770
{
@@ -2562,19 +2601,6 @@ export default {
2562
2601
] ,
2563
2602
parser : require . resolve ( '@typescript-eslint/parser' ) ,
2564
2603
} ,
2565
- {
2566
- code : `
2567
- /**
2568
- * @param {array} a
2569
- */
2570
- async function foo(a) {
2571
- return Promise.all(a);
2572
- }
2573
- ` ,
2574
- parserOptions : {
2575
- ecmaVersion : 8 ,
2576
- } ,
2577
- } ,
2578
2604
{
2579
2605
code : `
2580
2606
/**
You can’t perform that action at this time.
0 commit comments