@@ -15,7 +15,10 @@ const getDocsUrl = require('./lib/get-docs-url')
15
15
* @typedef { (FunctionExpression | ArrowFunctionExpression) & { parent: CallExpression } } InlineThenFunctionExpression
16
16
*/
17
17
18
- /** @param {Node } node */
18
+ /**
19
+ * @param {Node } node
20
+ * @returns {boolean }
21
+ */
19
22
function isFunctionWithBlockStatement ( node ) {
20
23
if ( node . type === 'FunctionExpression' ) {
21
24
return true
@@ -41,7 +44,10 @@ function isMemberCall(memberName, node) {
41
44
)
42
45
}
43
46
44
- /** @param {Node } node */
47
+ /**
48
+ * @param {Node } node
49
+ * @returns {boolean }
50
+ */
45
51
function isFirstArgument ( node ) {
46
52
return Boolean (
47
53
node . parent && node . parent . arguments && node . parent . arguments [ 0 ] === node ,
@@ -62,7 +68,9 @@ function isInlineThenFunctionExpression(node) {
62
68
63
69
/**
64
70
* Checks whether the given node is the last `then()` callback in a promise chain.
71
+ *
65
72
* @param {InlineThenFunctionExpression } node
73
+ * @returns {boolean }
66
74
*/
67
75
function isLastCallback ( node ) {
68
76
/** @type {Node } */
@@ -124,7 +132,7 @@ function peek(arr) {
124
132
return arr [ arr . length - 1 ]
125
133
}
126
134
127
- module . exports = {
135
+ module . exports = /** @satisfies { import('eslint').Rule.RuleModule } */ ( {
128
136
meta : {
129
137
type : 'problem' ,
130
138
docs : {
@@ -156,7 +164,6 @@ module.exports = {
156
164
* executing branches ("codePathSegment"s) within the given function
157
165
* @property {Record<string, BranchInfo | undefined> } branchInfoMap This is an object representing information
158
166
* about all branches within the given function
159
- *
160
167
* @typedef {object } BranchInfo
161
168
* @property {boolean } good This is a boolean representing whether
162
169
* the given branch explicitly `return`s or `throw`s. It starts as `false`
@@ -168,24 +175,25 @@ module.exports = {
168
175
169
176
/**
170
177
* funcInfoStack is a stack representing the stack of currently executing
171
- * functions
178
+ * functions
172
179
* example:
173
- * funcInfoStack = [ { branchIDStack: [ 's1_1' ],
174
- * branchInfoMap:
175
- * { s1_1:
176
- * { good: false,
177
- * loc: <loc> } } },
178
- * { branchIDStack: ['s2_1', 's2_4'],
179
- * branchInfoMap:
180
- * { s2_1:
181
- * { good: false,
182
- * loc: <loc> },
183
- * s2_2:
184
- * { good: true,
185
- * loc: <loc> },
186
- * s2_4:
187
- * { good: false,
188
- * loc: <loc> } } } ]
180
+ * funcInfoStack = [ { branchIDStack: [ 's1_1' ],
181
+ * branchInfoMap:
182
+ * { s1_1:
183
+ * { good: false,
184
+ * loc: <loc> } } },
185
+ * { branchIDStack: ['s2_1', 's2_4'],
186
+ * branchInfoMap:
187
+ * { s2_1:
188
+ * { good: false,
189
+ * loc: <loc> },
190
+ * s2_2:
191
+ * { good: true,
192
+ * loc: <loc> },
193
+ * s2_4:
194
+ * { good: false,
195
+ * loc: <loc> } } } ]
196
+ *
189
197
* @type {FuncInfo[] }
190
198
*/
191
199
const funcInfoStack = [ ]
@@ -257,4 +265,4 @@ module.exports = {
257
265
} ,
258
266
}
259
267
} ,
260
- }
268
+ } )
0 commit comments