Repository: eslint/eslint
File: lib/rules/array-callback-return.js (JavaScript)

Code before:
                                messageId: "prependVoid",
                                fix(fixer) {
                                    return voidPrependFixer(sourceCode, node.argument, fixer);
                                }
                            }];
                        } else {
                            messageAndSuggestions.messageId = "expectedNoReturnValue";
                        }
                    }
                } else {

                    // if allowImplicit: false, should also check node.argument
                    if (!options.allowImplicit && !node.argument) {
                        messageAndSuggestions.messageId = "expectedReturnValue";
                    }
                }

                if (messageAndSuggestions.messageId) {
                    context.report({
                        node,
                        messageId: messageAndSuggestions.messageId,
                        data: {
                            name: astUtils.getFunctionNameWithKind(funcInfo.node),
                            arrayMethodName: fullMethodName(funcInfo.arrayMethodName)
                        },
                        suggest: messageAndSuggestions.suggest !== 0 ? messageAndSuggestions.suggest : null
                    });
                }
            },

            // Reports a given function if the last path is reachable.
            "FunctionExpression:exit": checkLastSegment,
            "ArrowFunctionExpression:exit": checkLastSegment
        };
    }
};


Review comment (suggestion):
```suggestion
                        suggest: messageAndSuggestions.suggest.length !== 0 ? messageAndSuggestions.suggest : null
```

Code after:
                                fix(fixer) {
                                    return voidPrependFixer(sourceCode, node.argument, fixer);
                                }
                            }];
                        } else {
                            messageAndSuggestions.messageId = "expectedNoReturnValue";
                        }
                    }
                } else {

                    // if allowImplicit: false, should also check node.argument
                    if (!options.allowImplicit && !node.argument) {
                        messageAndSuggestions.messageId = "expectedReturnValue";
                    }
                }

                if (messageAndSuggestions.messageId) {
                    context.report({
                        node,
                        messageId: messageAndSuggestions.messageId,
                        data: {
                            name: astUtils.getFunctionNameWithKind(funcInfo.node),
                            arrayMethodName: fullMethodName(funcInfo.arrayMethodName)
                        },
                        suggest: messageAndSuggestions.suggest.length !== 0 ? messageAndSuggestions.suggest : null
                    });
                }
            },

            // Reports a given function if the last path is reachable.
            "FunctionExpression:exit": checkLastSegment,
            "ArrowFunctionExpression:exit": checkLastSegment
        };
    }
};