File tree 1 file changed +8
-12
lines changed
packages/eslint-plugin/src/util
1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -225,15 +225,11 @@ function isValidFunctionExpressionReturnType(
225
225
}
226
226
227
227
// https://github.com/typescript-eslint/typescript-eslint/issues/653
228
- if (
229
- options . allowDirectConstAssertionInArrowFunctions &&
228
+ return (
229
+ options . allowDirectConstAssertionInArrowFunctions === true &&
230
230
node . type === AST_NODE_TYPES . ArrowFunctionExpression &&
231
231
returnsConstAssertionDirectly ( node )
232
- ) {
233
- return true ;
234
- }
235
-
236
- return false ;
232
+ ) ;
237
233
}
238
234
239
235
/**
@@ -250,11 +246,11 @@ function isValidFunctionReturnType(
250
246
return true ;
251
247
}
252
248
253
- if ( node . returnType || isConstructor ( node . parent ) || isSetter ( node . parent ) ) {
254
- return true ;
255
- }
256
-
257
- return false ;
249
+ return (
250
+ node . returnType != null ||
251
+ isConstructor ( node . parent ) ||
252
+ isSetter ( node . parent )
253
+ ) ;
258
254
}
259
255
260
256
/**
You can’t perform that action at this time.
0 commit comments