ReturnStatement(node) {
          const argument = node.argument;
          let hasReturnValue = Boolean(argument);

          if (treatUndefinedAsUnspecified && hasReturnValue) {
              hasReturnValue = !isIdentifier(argument, "undefined") && argument.operator !== "void";
          }

          if (!funcInfo.hasReturn) {
              funcInfo.hasReturn = true;
              funcInfo.hasReturnValue = hasReturnValue;
              funcInfo.message = "{{name}} expected {{which}} return value.";
              funcInfo.data = {
                  name: funcInfo.node.type === "Program"
                      ? "Program"
                      : upperFirst(astUtils.getFunctionNameWithKind(funcInfo.node)),
                  which: hasReturnValue ? "a" : "no"
              };
          } else if (funcInfo.hasReturnValue !== hasReturnValue) {
              context.report({
                  node,
                  message: funcInfo.message,
                  data: funcInfo.data
              });
          }
      }
// Reports a given return statement if it's inconsistent.
Reports a given return statement if it's inconsistent.
Reports a given return statement if it ' s inconsistent .
ReturnStatement(node) {
          const argument = node.argument;
          let hasReturnValue = Boolean(argument);
          if (treatUndefinedAsUnspecified && hasReturnValue) {
              hasReturnValue = !isIdentifier(argument, "undefined") && argument.operator !== "void";
          }
          if (!funcInfo.hasReturn) {
              funcInfo.hasReturn = true;
              funcInfo.hasReturnValue = hasReturnValue;
              funcInfo.message = "{{name}} expected {{which}} return value.";
              funcInfo.data = {
                  name: funcInfo.node.type === "Program"
                      ? "Program"
                      : upperFirst(astUtils.getFunctionNameWithKind(funcInfo.node)),
                  which: hasReturnValue ? "a" : "no"
              };
          } else if (funcInfo.hasReturnValue !== hasReturnValue) {
              context.report({
                  node,
                  message: funcInfo.message,
                  data: funcInfo.data
              });
          }
      }
ReturnStatement ( node ) { const argument = node . argument ; let hasReturnValue = Boolean ( argument ) ; if ( treatUndefinedAsUnspecified && hasReturnValue ) { hasReturnValue = ! isIdentifier ( argument , "undefined" ) && argument . operator !== "void" ; } if ( ! funcInfo . hasReturn ) { funcInfo . hasReturn = true ; funcInfo . hasReturnValue = hasReturnValue ; funcInfo . message = "{{name}} expected {{which}} return value." ; funcInfo . data = { name : funcInfo . node . type === "Program" ? "Program" : upperFirst ( astUtils . getFunctionNameWithKind ( funcInfo . node ) ) , which : hasReturnValue ? "a" : "no" } ; } else if ( funcInfo . hasReturnValue !== hasReturnValue ) { context . report ( { node , message : funcInfo . message , data : funcInfo . data } ) ; } }
Reports a given return statement if it's inconsistent.
Reports a given return statement if it ' s inconsistent .