title: Firebase Cloud functions: warning
body: <p>I am an android developer and I am trying to use cloud functions in firebase.I set up the entire thing without understanding much of the script apart from the basic structure.</p>
  
  <p><strong>Most importantly I want to know how I can remove those warnings because I don't want it to stop working if something gets deprecated.</strong></p>
  
  <p>The warnings from the interface:</p>
  
  <pre><code>  24:13  warning  Unexpected function expression  prefer-arrow-callback
    28:16  warning  Unexpected function expression  prefer-arrow-callback
    60:11  warning  Avoid nesting promises          promise/no-nesting
    60:11  warning  Avoid nesting promises          promise/no-nesting
    61:13  warning  Unexpected function expression  prefer-arrow-callback
    65:16  warning  Unexpected function expression  prefer-arrow-callback
  
  ✖ 6 problems (0 errors, 6 warnings)
    0 errors and 4 warnings potentially fixable with the `--fix` option
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>let functions = require('firebase-functions');
  
  let admin = require('firebase-admin');
  
  admin.initializeApp();
  
  exports.sendNotification = functions.database.ref("Notifications").onWrite((change, context) =&gt; {
            const afterData = change.after.val(); // data after the write
            console.log("after: ", afterData.topic);
            console.log("after: ", afterData.msg);    
  
  
              const payload = {
                  data: {
                      data_type: "direct_message",
                      title: "New Message  " ,
                      message: afterData.msg,
                  }
              };
  
              return admin.messaging().sendToTopic(afterData.topic, payload)
                          .then(function(response) {
                              console.log("Successfully sent message:", response);
                              return;
                            })
                            .catch(function(error) {
                              console.log("Error sending message:", error);
                              return;
                            });
          });
  
  exports.sendToOne = functions.database.ref("messages").onWrite((change, context) =&gt; {
  
       const afterData = change.after.val(); // data after the write
       const message = afterData.message;
       const receiverid = afterData.id;
            console.log("receiver id : ", receiverid);    
            console.log("receiver message : ", message);  
  
  
      return admin.database().ref("/users/"+receiverid).once('value').then(snap =&gt; {
          const senderName = snap.child("name").val();
          const token = snap.child("token").val();
          console.log("receiver name: ", senderName);
          console.log("receiver token: ", token);
  
  
              console.log("Construction the notification message.");
              const payload = {
                  data: {
                      data_type: "direct_message",
                      title: "New Message",
                      message: message
                  }
              };
  
              return admin.messaging().sendToDevice(token, payload)
                          .then(function(response) {
                              console.log("Successfully sent message:", response);
                              return;
                            })
                            .catch(function(error) {
                              console.log("Error sending message:", error);
                            return;
                            });
          });
      });
  </code></pre>
  
  <p>How do I remove these warnings, please help. </p>