Преглед изворни кода

decaf cleanup: remove unnecessary code created because of implicit returns

GitOrigin-RevId: 9717a14d34a662c9740aa50446d0699c6afd3222
Tim Alby пре 4 година
родитељ
комит
0a0722a8f8

+ 1 - 2
services/chat/app.js

@@ -1,6 +1,5 @@
 /*
 /*
  * decaffeinate suggestions:
  * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
  * DS103: Rewrite code to no longer use __guard__
  * DS103: Rewrite code to no longer use __guard__
  * DS207: Consider shorter variations of null checks
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
@@ -31,7 +30,7 @@ if (!module.parent) {
           logger.fatal({ err }, `Cannot bind to ${host}:${port}. Exiting.`)
           logger.fatal({ err }, `Cannot bind to ${host}:${port}. Exiting.`)
           process.exit(1)
           process.exit(1)
         }
         }
-        return logger.info(`Chat starting up, listening on ${host}:${port}`)
+        logger.info(`Chat starting up, listening on ${host}:${port}`)
       })
       })
     })
     })
     .catch(err => {
     .catch(err => {

+ 0 - 1
services/chat/app/js/Features/Messages/MessageFormatter.js

@@ -3,7 +3,6 @@
 /*
 /*
  * decaffeinate suggestions:
  * decaffeinate suggestions:
  * DS101: Remove unnecessary use of Array.from
  * DS101: Remove unnecessary use of Array.from
- * DS102: Remove unnecessary code created because of implicit returns
  * DS207: Consider shorter variations of null checks
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  */
  */

+ 33 - 48
services/chat/app/js/Features/Messages/MessageHttpController.js

@@ -2,7 +2,6 @@
 // Fix any style issues and re-enable lint.
 // Fix any style issues and re-enable lint.
 /*
 /*
  * decaffeinate suggestions:
  * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
  * DS207: Consider shorter variations of null checks
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  */
  */
@@ -18,7 +17,7 @@ module.exports = MessageHttpController = {
   MAX_MESSAGE_LENGTH: 10 * 1024, // 10kb, about 1,500 words
   MAX_MESSAGE_LENGTH: 10 * 1024, // 10kb, about 1,500 words
 
 
   getGlobalMessages(req, res, next) {
   getGlobalMessages(req, res, next) {
-    return MessageHttpController._getMessages(
+    MessageHttpController._getMessages(
       ThreadManager.GLOBAL_THREAD,
       ThreadManager.GLOBAL_THREAD,
       req,
       req,
       res,
       res,
@@ -27,7 +26,7 @@ module.exports = MessageHttpController = {
   },
   },
 
 
   sendGlobalMessage(req, res, next) {
   sendGlobalMessage(req, res, next) {
-    return MessageHttpController._sendMessage(
+    MessageHttpController._sendMessage(
       ThreadManager.GLOBAL_THREAD,
       ThreadManager.GLOBAL_THREAD,
       req,
       req,
       res,
       res,
@@ -36,23 +35,18 @@ module.exports = MessageHttpController = {
   },
   },
 
 
   sendThreadMessage(req, res, next) {
   sendThreadMessage(req, res, next) {
-    return MessageHttpController._sendMessage(
-      req.params.threadId,
-      req,
-      res,
-      next
-    )
+    MessageHttpController._sendMessage(req.params.threadId, req, res, next)
   },
   },
 
 
   getAllThreads(req, res, next) {
   getAllThreads(req, res, next) {
     const { projectId } = req.params
     const { projectId } = req.params
     logger.log({ projectId }, 'getting all threads')
     logger.log({ projectId }, 'getting all threads')
-    return ThreadManager.findAllThreadRooms(projectId, function (error, rooms) {
+    ThreadManager.findAllThreadRooms(projectId, function (error, rooms) {
       if (error != null) {
       if (error != null) {
         return next(error)
         return next(error)
       }
       }
       const roomIds = rooms.map(r => r._id)
       const roomIds = rooms.map(r => r._id)
-      return MessageManager.findAllMessagesInRooms(
+      MessageManager.findAllMessagesInRooms(
         roomIds,
         roomIds,
         function (error, messages) {
         function (error, messages) {
           if (error != null) {
           if (error != null) {
@@ -62,7 +56,7 @@ module.exports = MessageHttpController = {
             rooms,
             rooms,
             messages
             messages
           )
           )
-          return res.json(threads)
+          res.json(threads)
         }
         }
       )
       )
     })
     })
@@ -72,62 +66,53 @@ module.exports = MessageHttpController = {
     const { projectId, threadId } = req.params
     const { projectId, threadId } = req.params
     const { user_id: userId } = req.body
     const { user_id: userId } = req.body
     logger.log({ userId, projectId, threadId }, 'marking thread as resolved')
     logger.log({ userId, projectId, threadId }, 'marking thread as resolved')
-    return ThreadManager.resolveThread(
-      projectId,
-      threadId,
-      userId,
-      function (error) {
-        if (error != null) {
-          return next(error)
-        }
-        return res.sendStatus(204)
+    ThreadManager.resolveThread(projectId, threadId, userId, function (error) {
+      if (error != null) {
+        return next(error)
       }
       }
-    )
+      res.sendStatus(204)
+    })
   }, // No content
   }, // No content
 
 
   reopenThread(req, res, next) {
   reopenThread(req, res, next) {
     const { projectId, threadId } = req.params
     const { projectId, threadId } = req.params
     logger.log({ projectId, threadId }, 'reopening thread')
     logger.log({ projectId, threadId }, 'reopening thread')
-    return ThreadManager.reopenThread(projectId, threadId, function (error) {
+    ThreadManager.reopenThread(projectId, threadId, function (error) {
       if (error != null) {
       if (error != null) {
         return next(error)
         return next(error)
       }
       }
-      return res.sendStatus(204)
+      res.sendStatus(204)
     })
     })
   }, // No content
   }, // No content
 
 
   deleteThread(req, res, next) {
   deleteThread(req, res, next) {
     const { projectId, threadId } = req.params
     const { projectId, threadId } = req.params
     logger.log({ projectId, threadId }, 'deleting thread')
     logger.log({ projectId, threadId }, 'deleting thread')
-    return ThreadManager.deleteThread(
-      projectId,
-      threadId,
-      function (error, roomId) {
+    ThreadManager.deleteThread(projectId, threadId, function (error, roomId) {
+      if (error != null) {
+        return next(error)
+      }
+      MessageManager.deleteAllMessagesInRoom(roomId, function (error) {
         if (error != null) {
         if (error != null) {
           return next(error)
           return next(error)
         }
         }
-        return MessageManager.deleteAllMessagesInRoom(roomId, function (error) {
-          if (error != null) {
-            return next(error)
-          }
-          return res.sendStatus(204)
-        })
-      }
-    )
+        res.sendStatus(204)
+      })
+    })
   }, // No content
   }, // No content
 
 
   editMessage(req, res, next) {
   editMessage(req, res, next) {
     const { content } = req != null ? req.body : undefined
     const { content } = req != null ? req.body : undefined
     const { projectId, threadId, messageId } = req.params
     const { projectId, threadId, messageId } = req.params
     logger.log({ projectId, threadId, messageId, content }, 'editing message')
     logger.log({ projectId, threadId, messageId, content }, 'editing message')
-    return ThreadManager.findOrCreateThread(
+    ThreadManager.findOrCreateThread(
       projectId,
       projectId,
       threadId,
       threadId,
       function (error, room) {
       function (error, room) {
         if (error != null) {
         if (error != null) {
           return next(error)
           return next(error)
         }
         }
-        return MessageManager.updateMessage(
+        MessageManager.updateMessage(
           room._id,
           room._id,
           messageId,
           messageId,
           content,
           content,
@@ -136,7 +121,7 @@ module.exports = MessageHttpController = {
             if (error != null) {
             if (error != null) {
               return next(error)
               return next(error)
             }
             }
-            return res.sendStatus(204)
+            res.sendStatus(204)
           }
           }
         )
         )
       }
       }
@@ -146,21 +131,21 @@ module.exports = MessageHttpController = {
   deleteMessage(req, res, next) {
   deleteMessage(req, res, next) {
     const { projectId, threadId, messageId } = req.params
     const { projectId, threadId, messageId } = req.params
     logger.log({ projectId, threadId, messageId }, 'deleting message')
     logger.log({ projectId, threadId, messageId }, 'deleting message')
-    return ThreadManager.findOrCreateThread(
+    ThreadManager.findOrCreateThread(
       projectId,
       projectId,
       threadId,
       threadId,
       function (error, room) {
       function (error, room) {
         if (error != null) {
         if (error != null) {
           return next(error)
           return next(error)
         }
         }
-        return MessageManager.deleteMessage(
+        MessageManager.deleteMessage(
           room._id,
           room._id,
           messageId,
           messageId,
           function (error, message) {
           function (error, message) {
             if (error != null) {
             if (error != null) {
               return next(error)
               return next(error)
             }
             }
-            return res.sendStatus(204)
+            res.sendStatus(204)
           }
           }
         )
         )
       }
       }
@@ -185,14 +170,14 @@ module.exports = MessageHttpController = {
       { clientThreadId, projectId, userId, content },
       { clientThreadId, projectId, userId, content },
       'new message received'
       'new message received'
     )
     )
-    return ThreadManager.findOrCreateThread(
+    ThreadManager.findOrCreateThread(
       projectId,
       projectId,
       clientThreadId,
       clientThreadId,
       function (error, thread) {
       function (error, thread) {
         if (error != null) {
         if (error != null) {
           return next(error)
           return next(error)
         }
         }
-        return MessageManager.createMessage(
+        MessageManager.createMessage(
           thread._id,
           thread._id,
           userId,
           userId,
           content,
           content,
@@ -203,7 +188,7 @@ module.exports = MessageHttpController = {
             }
             }
             message = MessageFormatter.formatMessageForClientSide(message)
             message = MessageFormatter.formatMessageForClientSide(message)
             message.room_id = projectId
             message.room_id = projectId
-            return res.status(201).send(message)
+            res.status(201).send(message)
           }
           }
         )
         )
       }
       }
@@ -227,7 +212,7 @@ module.exports = MessageHttpController = {
       { limit, before, projectId, clientThreadId },
       { limit, before, projectId, clientThreadId },
       'get message request received'
       'get message request received'
     )
     )
-    return ThreadManager.findOrCreateThread(
+    ThreadManager.findOrCreateThread(
       projectId,
       projectId,
       clientThreadId,
       clientThreadId,
       function (error, thread) {
       function (error, thread) {
@@ -239,7 +224,7 @@ module.exports = MessageHttpController = {
           { limit, before, projectId, clientThreadId, threadObjectId },
           { limit, before, projectId, clientThreadId, threadObjectId },
           'found or created thread'
           'found or created thread'
         )
         )
-        return MessageManager.getMessages(
+        MessageManager.getMessages(
           threadObjectId,
           threadObjectId,
           limit,
           limit,
           before,
           before,
@@ -249,7 +234,7 @@ module.exports = MessageHttpController = {
             }
             }
             messages = MessageFormatter.formatMessagesForClientSide(messages)
             messages = MessageFormatter.formatMessagesForClientSide(messages)
             logger.log({ projectId, messages }, 'got messages')
             logger.log({ projectId, messages }, 'got messages')
-            return res.status(200).send(messages)
+            res.status(200).send(messages)
           }
           }
         )
         )
       }
       }

+ 0 - 1
services/chat/app/js/Features/Messages/MessageManager.js

@@ -2,7 +2,6 @@
 // Fix any style issues and re-enable lint.
 // Fix any style issues and re-enable lint.
 /*
 /*
  * decaffeinate suggestions:
  * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
  * DS207: Consider shorter variations of null checks
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  */
  */

+ 2 - 3
services/chat/app/js/Features/Threads/ThreadManager.js

@@ -2,7 +2,6 @@
 // Fix any style issues and re-enable lint.
 // Fix any style issues and re-enable lint.
 /*
 /*
  * decaffeinate suggestions:
  * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
  * DS207: Consider shorter variations of null checks
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  */
  */
@@ -117,7 +116,7 @@ module.exports = ThreadManager = {
     if (callback == null) {
     if (callback == null) {
       callback = function () {}
       callback = function () {}
     }
     }
-    return this.findOrCreateThread(projectId, threadId, function (error, room) {
+    this.findOrCreateThread(projectId, threadId, function (error, room) {
       if (error != null) {
       if (error != null) {
         return callback(error)
         return callback(error)
       }
       }
@@ -129,7 +128,7 @@ module.exports = ThreadManager = {
           if (error != null) {
           if (error != null) {
             return callback(error)
             return callback(error)
           }
           }
-          return callback(null, room._id)
+          callback(null, room._id)
         }
         }
       )
       )
     })
     })

+ 5 - 12
services/chat/app/js/router.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Fix any style issues and re-enable lint.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
- */
 const MessageHttpController = require('./Features/Messages/MessageHttpController')
 const MessageHttpController = require('./Features/Messages/MessageHttpController')
 const { ObjectId } = require('./mongodb')
 const { ObjectId } = require('./mongodb')
 
 
@@ -12,17 +5,17 @@ module.exports = {
   route(app) {
   route(app) {
     app.param('projectId', function (req, res, next, projectId) {
     app.param('projectId', function (req, res, next, projectId) {
       if (ObjectId.isValid(projectId)) {
       if (ObjectId.isValid(projectId)) {
-        return next()
+        next()
       } else {
       } else {
-        return res.status(400).send('Invalid projectId')
+        res.status(400).send('Invalid projectId')
       }
       }
     })
     })
 
 
     app.param('threadId', function (req, res, next, threadId) {
     app.param('threadId', function (req, res, next, threadId) {
       if (ObjectId.isValid(threadId)) {
       if (ObjectId.isValid(threadId)) {
-        return next()
+        next()
       } else {
       } else {
-        return res.status(400).send('Invalid threadId')
+        res.status(400).send('Invalid threadId')
       }
       }
     })
     })
 
 
@@ -73,6 +66,6 @@ module.exports = {
       MessageHttpController.deleteThread
       MessageHttpController.deleteThread
     )
     )
 
 
-    return app.get('/status', (req, res, next) => res.send('chat is alive'))
+    app.get('/status', (req, res, next) => res.send('chat is alive'))
   },
   },
 }
 }

+ 0 - 7
services/chat/app/js/server.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Fix any style issues and re-enable lint.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
- */
 const metrics = require('@overleaf/metrics')
 const metrics = require('@overleaf/metrics')
 metrics.initialize('chat')
 metrics.initialize('chat')
 const logger = require('@overleaf/logger')
 const logger = require('@overleaf/logger')

+ 13 - 23
services/chat/test/acceptance/js/DeletingAMessageTests.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Fix any style issues and re-enable lint.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
- */
 const { ObjectId } = require('../../../app/js/mongodb')
 const { ObjectId } = require('../../../app/js/mongodb')
 const { expect } = require('chai')
 const { expect } = require('chai')
 
 
@@ -16,12 +9,12 @@ describe('Deleting a message', function () {
     this.project_id = ObjectId().toString()
     this.project_id = ObjectId().toString()
     this.user_id = ObjectId().toString()
     this.user_id = ObjectId().toString()
     this.thread_id = ObjectId().toString()
     this.thread_id = ObjectId().toString()
-    return ChatApp.ensureRunning(done)
+    ChatApp.ensureRunning(done)
   })
   })
 
 
-  return describe('in a thread', function () {
+  describe('in a thread', function () {
     before(function (done) {
     before(function (done) {
-      return ChatClient.sendMessage(
+      ChatClient.sendMessage(
         this.project_id,
         this.project_id,
         this.thread_id,
         this.thread_id,
         this.user_id,
         this.user_id,
@@ -30,7 +23,7 @@ describe('Deleting a message', function () {
           this.message = message
           this.message = message
           expect(error).to.be.null
           expect(error).to.be.null
           expect(response.statusCode).to.equal(201)
           expect(response.statusCode).to.equal(201)
-          return ChatClient.sendMessage(
+          ChatClient.sendMessage(
             this.project_id,
             this.project_id,
             this.thread_id,
             this.thread_id,
             this.user_id,
             this.user_id,
@@ -39,14 +32,14 @@ describe('Deleting a message', function () {
               this.message = message1
               this.message = message1
               expect(error).to.be.null
               expect(error).to.be.null
               expect(response.statusCode).to.equal(201)
               expect(response.statusCode).to.equal(201)
-              return ChatClient.deleteMessage(
+              ChatClient.deleteMessage(
                 this.project_id,
                 this.project_id,
                 this.thread_id,
                 this.thread_id,
                 this.message.id,
                 this.message.id,
                 (error, response, body) => {
                 (error, response, body) => {
                   expect(error).to.be.null
                   expect(error).to.be.null
                   expect(response.statusCode).to.equal(204)
                   expect(response.statusCode).to.equal(204)
-                  return done()
+                  done()
                 }
                 }
               )
               )
             }
             }
@@ -55,16 +48,13 @@ describe('Deleting a message', function () {
       )
       )
     })
     })
 
 
-    return it('should then remove the message from the threads', function (done) {
-      return ChatClient.getThreads(
-        this.project_id,
-        (error, response, threads) => {
-          expect(error).to.be.null
-          expect(response.statusCode).to.equal(200)
-          expect(threads[this.thread_id].messages.length).to.equal(1)
-          return done()
-        }
-      )
+    it('should then remove the message from the threads', function (done) {
+      ChatClient.getThreads(this.project_id, (error, response, threads) => {
+        expect(error).to.be.null
+        expect(response.statusCode).to.equal(200)
+        expect(threads[this.thread_id].messages.length).to.equal(1)
+        done()
+      })
     })
     })
   })
   })
 })
 })

+ 12 - 22
services/chat/test/acceptance/js/DeletingAThreadTests.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Fix any style issues and re-enable lint.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
- */
 const { ObjectId } = require('../../../app/js/mongodb')
 const { ObjectId } = require('../../../app/js/mongodb')
 const { expect } = require('chai')
 const { expect } = require('chai')
 
 
@@ -15,14 +8,14 @@ describe('Deleting a thread', function () {
   before(function (done) {
   before(function (done) {
     this.project_id = ObjectId().toString()
     this.project_id = ObjectId().toString()
     this.user_id = ObjectId().toString()
     this.user_id = ObjectId().toString()
-    return ChatApp.ensureRunning(done)
+    ChatApp.ensureRunning(done)
   })
   })
 
 
-  return describe('with a thread that is deleted', function () {
+  describe('with a thread that is deleted', function () {
     before(function (done) {
     before(function (done) {
       this.thread_id = ObjectId().toString()
       this.thread_id = ObjectId().toString()
       this.content = 'deleted thread message'
       this.content = 'deleted thread message'
-      return ChatClient.sendMessage(
+      ChatClient.sendMessage(
         this.project_id,
         this.project_id,
         this.thread_id,
         this.thread_id,
         this.user_id,
         this.user_id,
@@ -30,29 +23,26 @@ describe('Deleting a thread', function () {
         (error, response, body) => {
         (error, response, body) => {
           expect(error).to.be.null
           expect(error).to.be.null
           expect(response.statusCode).to.equal(201)
           expect(response.statusCode).to.equal(201)
-          return ChatClient.deleteThread(
+          ChatClient.deleteThread(
             this.project_id,
             this.project_id,
             this.thread_id,
             this.thread_id,
             (error, response, body) => {
             (error, response, body) => {
               expect(error).to.be.null
               expect(error).to.be.null
               expect(response.statusCode).to.equal(204)
               expect(response.statusCode).to.equal(204)
-              return done()
+              done()
             }
             }
           )
           )
         }
         }
       )
       )
     })
     })
 
 
-    return it('should then not list the thread for the project', function (done) {
-      return ChatClient.getThreads(
-        this.project_id,
-        (error, response, threads) => {
-          expect(error).to.be.null
-          expect(response.statusCode).to.equal(200)
-          expect(Object.keys(threads).length).to.equal(0)
-          return done()
-        }
-      )
+    it('should then not list the thread for the project', function (done) {
+      ChatClient.getThreads(this.project_id, (error, response, threads) => {
+        expect(error).to.be.null
+        expect(response.statusCode).to.equal(200)
+        expect(Object.keys(threads).length).to.equal(0)
+        done()
+      })
     })
     })
   })
   })
 })
 })

+ 15 - 25
services/chat/test/acceptance/js/EditingAMessageTests.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Fix any style issues and re-enable lint.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
- */
 const { ObjectId } = require('../../../app/js/mongodb')
 const { ObjectId } = require('../../../app/js/mongodb')
 const { expect } = require('chai')
 const { expect } = require('chai')
 
 
@@ -16,14 +9,14 @@ describe('Editing a message', function () {
     this.project_id = ObjectId().toString()
     this.project_id = ObjectId().toString()
     this.user_id = ObjectId().toString()
     this.user_id = ObjectId().toString()
     this.thread_id = ObjectId().toString()
     this.thread_id = ObjectId().toString()
-    return ChatApp.ensureRunning(done)
+    ChatApp.ensureRunning(done)
   })
   })
 
 
-  return describe('in a thread', function () {
+  describe('in a thread', function () {
     before(function (done) {
     before(function (done) {
       this.content = 'thread message'
       this.content = 'thread message'
       this.new_content = 'updated thread message'
       this.new_content = 'updated thread message'
-      return ChatClient.sendMessage(
+      ChatClient.sendMessage(
         this.project_id,
         this.project_id,
         this.thread_id,
         this.thread_id,
         this.user_id,
         this.user_id,
@@ -34,7 +27,7 @@ describe('Editing a message', function () {
           expect(response.statusCode).to.equal(201)
           expect(response.statusCode).to.equal(201)
           expect(this.message.id).to.exist
           expect(this.message.id).to.exist
           expect(this.message.content).to.equal(this.content)
           expect(this.message.content).to.equal(this.content)
-          return ChatClient.editMessage(
+          ChatClient.editMessage(
             this.project_id,
             this.project_id,
             this.thread_id,
             this.thread_id,
             this.message.id,
             this.message.id,
@@ -43,26 +36,23 @@ describe('Editing a message', function () {
               this.new_message = newMessage
               this.new_message = newMessage
               expect(error).to.be.null
               expect(error).to.be.null
               expect(response.statusCode).to.equal(204)
               expect(response.statusCode).to.equal(204)
-              return done()
+              done()
             }
             }
           )
           )
         }
         }
       )
       )
     })
     })
 
 
-    return it('should then list the updated message in the threads', function (done) {
-      return ChatClient.getThreads(
-        this.project_id,
-        (error, response, threads) => {
-          expect(error).to.be.null
-          expect(response.statusCode).to.equal(200)
-          expect(threads[this.thread_id].messages.length).to.equal(1)
-          expect(threads[this.thread_id].messages[0].content).to.equal(
-            this.new_content
-          )
-          return done()
-        }
-      )
+    it('should then list the updated message in the threads', function (done) {
+      ChatClient.getThreads(this.project_id, (error, response, threads) => {
+        expect(error).to.be.null
+        expect(response.statusCode).to.equal(200)
+        expect(threads[this.thread_id].messages.length).to.equal(1)
+        expect(threads[this.thread_id].messages[0].content).to.equal(
+          this.new_content
+        )
+        done()
+      })
     })
     })
   })
   })
 })
 })

+ 25 - 35
services/chat/test/acceptance/js/GettingMessagesTests.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Fix any style issues and re-enable lint.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
- */
 const { ObjectId } = require('../../../app/js/mongodb')
 const { ObjectId } = require('../../../app/js/mongodb')
 const { expect } = require('chai')
 const { expect } = require('chai')
 const async = require('async')
 const async = require('async')
@@ -18,13 +11,13 @@ describe('Getting messages', function () {
     this.user_id2 = ObjectId().toString()
     this.user_id2 = ObjectId().toString()
     this.content1 = 'foo bar'
     this.content1 = 'foo bar'
     this.content2 = 'hello world'
     this.content2 = 'hello world'
-    return ChatApp.ensureRunning(done)
+    ChatApp.ensureRunning(done)
   })
   })
 
 
   describe('globally', function () {
   describe('globally', function () {
     before(function (done) {
     before(function (done) {
       this.project_id = ObjectId().toString()
       this.project_id = ObjectId().toString()
-      return async.series(
+      async.series(
         [
         [
           cb =>
           cb =>
             ChatClient.sendGlobalMessage(
             ChatClient.sendGlobalMessage(
@@ -45,8 +38,8 @@ describe('Getting messages', function () {
       )
       )
     })
     })
 
 
-    return it('should contain the messages and populated users when getting the messages', function (done) {
-      return ChatClient.getGlobalMessages(
+    it('should contain the messages and populated users when getting the messages', function (done) {
+      ChatClient.getGlobalMessages(
         this.project_id,
         this.project_id,
         (error, response, messages) => {
         (error, response, messages) => {
           if (error) return done(error)
           if (error) return done(error)
@@ -56,18 +49,18 @@ describe('Getting messages', function () {
           expect(messages[0].user_id).to.equal(this.user_id1)
           expect(messages[0].user_id).to.equal(this.user_id1)
           expect(messages[1].content).to.equal(this.content2)
           expect(messages[1].content).to.equal(this.content2)
           expect(messages[1].user_id).to.equal(this.user_id2)
           expect(messages[1].user_id).to.equal(this.user_id2)
-          return done()
+          done()
         }
         }
       )
       )
     })
     })
   })
   })
 
 
-  return describe('from all the threads', function () {
+  describe('from all the threads', function () {
     before(function (done) {
     before(function (done) {
       this.project_id = ObjectId().toString()
       this.project_id = ObjectId().toString()
       this.thread_id1 = ObjectId().toString()
       this.thread_id1 = ObjectId().toString()
       this.thread_id2 = ObjectId().toString()
       this.thread_id2 = ObjectId().toString()
-      return async.series(
+      async.series(
         [
         [
           cb =>
           cb =>
             ChatClient.sendMessage(
             ChatClient.sendMessage(
@@ -106,29 +99,26 @@ describe('Getting messages', function () {
       )
       )
     })
     })
 
 
-    return it('should contain a dictionary of threads with messages with populated users', function (done) {
-      return ChatClient.getThreads(
-        this.project_id,
-        (error, response, threads) => {
-          if (error) return done(error)
-          expect(Object.keys(threads).length).to.equal(2)
-          const thread1 = threads[this.thread_id1]
-          expect(thread1.messages.length).to.equal(2)
-          const thread2 = threads[this.thread_id2]
-          expect(thread2.messages.length).to.equal(2)
+    it('should contain a dictionary of threads with messages with populated users', function (done) {
+      ChatClient.getThreads(this.project_id, (error, response, threads) => {
+        if (error) return done(error)
+        expect(Object.keys(threads).length).to.equal(2)
+        const thread1 = threads[this.thread_id1]
+        expect(thread1.messages.length).to.equal(2)
+        const thread2 = threads[this.thread_id2]
+        expect(thread2.messages.length).to.equal(2)
 
 
-          expect(thread1.messages[0].content).to.equal('one')
-          expect(thread1.messages[0].user_id).to.equal(this.user_id1)
-          expect(thread1.messages[1].content).to.equal('three')
-          expect(thread1.messages[1].user_id).to.equal(this.user_id1)
+        expect(thread1.messages[0].content).to.equal('one')
+        expect(thread1.messages[0].user_id).to.equal(this.user_id1)
+        expect(thread1.messages[1].content).to.equal('three')
+        expect(thread1.messages[1].user_id).to.equal(this.user_id1)
 
 
-          expect(thread2.messages[0].content).to.equal('two')
-          expect(thread2.messages[0].user_id).to.equal(this.user_id2)
-          expect(thread2.messages[1].content).to.equal('four')
-          expect(thread2.messages[1].user_id).to.equal(this.user_id2)
-          return done()
-        }
-      )
+        expect(thread2.messages[0].content).to.equal('two')
+        expect(thread2.messages[0].user_id).to.equal(this.user_id2)
+        expect(thread2.messages[1].content).to.equal('four')
+        expect(thread2.messages[1].user_id).to.equal(this.user_id2)
+        done()
+      })
     })
     })
   })
   })
 })
 })

+ 37 - 53
services/chat/test/acceptance/js/ResolvingAThreadTests.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Fix any style issues and re-enable lint.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
- */
 const { ObjectId } = require('../../../app/js/mongodb')
 const { ObjectId } = require('../../../app/js/mongodb')
 const { expect } = require('chai')
 const { expect } = require('chai')
 
 
@@ -15,14 +8,14 @@ describe('Resolving a thread', function () {
   before(function (done) {
   before(function (done) {
     this.project_id = ObjectId().toString()
     this.project_id = ObjectId().toString()
     this.user_id = ObjectId().toString()
     this.user_id = ObjectId().toString()
-    return ChatApp.ensureRunning(done)
+    ChatApp.ensureRunning(done)
   })
   })
 
 
   describe('with a resolved thread', function () {
   describe('with a resolved thread', function () {
     before(function (done) {
     before(function (done) {
       this.thread_id = ObjectId().toString()
       this.thread_id = ObjectId().toString()
       this.content = 'resolved message'
       this.content = 'resolved message'
-      return ChatClient.sendMessage(
+      ChatClient.sendMessage(
         this.project_id,
         this.project_id,
         this.thread_id,
         this.thread_id,
         this.user_id,
         this.user_id,
@@ -30,35 +23,32 @@ describe('Resolving a thread', function () {
         (error, response, body) => {
         (error, response, body) => {
           expect(error).to.be.null
           expect(error).to.be.null
           expect(response.statusCode).to.equal(201)
           expect(response.statusCode).to.equal(201)
-          return ChatClient.resolveThread(
+          ChatClient.resolveThread(
             this.project_id,
             this.project_id,
             this.thread_id,
             this.thread_id,
             this.user_id,
             this.user_id,
             (error, response, body) => {
             (error, response, body) => {
               expect(error).to.be.null
               expect(error).to.be.null
               expect(response.statusCode).to.equal(204)
               expect(response.statusCode).to.equal(204)
-              return done()
+              done()
             }
             }
           )
           )
         }
         }
       )
       )
     })
     })
 
 
-    return it('should then list the thread as resolved', function (done) {
-      return ChatClient.getThreads(
-        this.project_id,
-        (error, response, threads) => {
-          expect(error).to.be.null
-          expect(response.statusCode).to.equal(200)
-          expect(threads[this.thread_id].resolved).to.equal(true)
-          expect(threads[this.thread_id].resolved_by_user_id).to.equal(
-            this.user_id
-          )
-          const resolvedAt = new Date(threads[this.thread_id].resolved_at)
-          expect(new Date() - resolvedAt).to.be.below(1000)
-          return done()
-        }
-      )
+    it('should then list the thread as resolved', function (done) {
+      ChatClient.getThreads(this.project_id, (error, response, threads) => {
+        expect(error).to.be.null
+        expect(response.statusCode).to.equal(200)
+        expect(threads[this.thread_id].resolved).to.equal(true)
+        expect(threads[this.thread_id].resolved_by_user_id).to.equal(
+          this.user_id
+        )
+        const resolvedAt = new Date(threads[this.thread_id].resolved_at)
+        expect(new Date() - resolvedAt).to.be.below(1000)
+        done()
+      })
     })
     })
   })
   })
 
 
@@ -66,7 +56,7 @@ describe('Resolving a thread', function () {
     before(function (done) {
     before(function (done) {
       this.thread_id = ObjectId().toString()
       this.thread_id = ObjectId().toString()
       this.content = 'open message'
       this.content = 'open message'
-      return ChatClient.sendMessage(
+      ChatClient.sendMessage(
         this.project_id,
         this.project_id,
         this.thread_id,
         this.thread_id,
         this.user_id,
         this.user_id,
@@ -74,29 +64,26 @@ describe('Resolving a thread', function () {
         (error, response, body) => {
         (error, response, body) => {
           expect(error).to.be.null
           expect(error).to.be.null
           expect(response.statusCode).to.equal(201)
           expect(response.statusCode).to.equal(201)
-          return done()
+          done()
         }
         }
       )
       )
     })
     })
 
 
-    return it('should not list the thread as resolved', function (done) {
-      return ChatClient.getThreads(
-        this.project_id,
-        (error, response, threads) => {
-          expect(error).to.be.null
-          expect(response.statusCode).to.equal(200)
-          expect(threads[this.thread_id].resolved).to.be.undefined
-          return done()
-        }
-      )
+    it('should not list the thread as resolved', function (done) {
+      ChatClient.getThreads(this.project_id, (error, response, threads) => {
+        expect(error).to.be.null
+        expect(response.statusCode).to.equal(200)
+        expect(threads[this.thread_id].resolved).to.be.undefined
+        done()
+      })
     })
     })
   })
   })
 
 
-  return describe('when a thread is resolved then reopened', function () {
+  describe('when a thread is resolved then reopened', function () {
     before(function (done) {
     before(function (done) {
       this.thread_id = ObjectId().toString()
       this.thread_id = ObjectId().toString()
       this.content = 'resolved message'
       this.content = 'resolved message'
-      return ChatClient.sendMessage(
+      ChatClient.sendMessage(
         this.project_id,
         this.project_id,
         this.thread_id,
         this.thread_id,
         this.user_id,
         this.user_id,
@@ -104,20 +91,20 @@ describe('Resolving a thread', function () {
         (error, response, body) => {
         (error, response, body) => {
           expect(error).to.be.null
           expect(error).to.be.null
           expect(response.statusCode).to.equal(201)
           expect(response.statusCode).to.equal(201)
-          return ChatClient.resolveThread(
+          ChatClient.resolveThread(
             this.project_id,
             this.project_id,
             this.thread_id,
             this.thread_id,
             this.user_id,
             this.user_id,
             (error, response, body) => {
             (error, response, body) => {
               expect(error).to.be.null
               expect(error).to.be.null
               expect(response.statusCode).to.equal(204)
               expect(response.statusCode).to.equal(204)
-              return ChatClient.reopenThread(
+              ChatClient.reopenThread(
                 this.project_id,
                 this.project_id,
                 this.thread_id,
                 this.thread_id,
                 (error, response, body) => {
                 (error, response, body) => {
                   expect(error).to.be.null
                   expect(error).to.be.null
                   expect(response.statusCode).to.equal(204)
                   expect(response.statusCode).to.equal(204)
-                  return done()
+                  done()
                 }
                 }
               )
               )
             }
             }
@@ -126,16 +113,13 @@ describe('Resolving a thread', function () {
       )
       )
     })
     })
 
 
-    return it('should not list the thread as resolved', function (done) {
-      return ChatClient.getThreads(
-        this.project_id,
-        (error, response, threads) => {
-          expect(error).to.be.null
-          expect(response.statusCode).to.equal(200)
-          expect(threads[this.thread_id].resolved).to.be.undefined
-          return done()
-        }
-      )
+    it('should not list the thread as resolved', function (done) {
+      ChatClient.getThreads(this.project_id, (error, response, threads) => {
+        expect(error).to.be.null
+        expect(response.statusCode).to.equal(200)
+        expect(threads[this.thread_id].resolved).to.be.undefined
+        done()
+      })
     })
     })
   })
   })
 })
 })

+ 38 - 48
services/chat/test/acceptance/js/SendingAMessageTests.js

@@ -1,10 +1,3 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Fix any style issues and re-enable lint.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
- */
 const { ObjectId } = require('../../../app/js/mongodb')
 const { ObjectId } = require('../../../app/js/mongodb')
 const { expect } = require('chai')
 const { expect } = require('chai')
 
 
@@ -13,7 +6,7 @@ const ChatApp = require('./helpers/ChatApp')
 
 
 describe('Sending a message', function () {
 describe('Sending a message', function () {
   before(function (done) {
   before(function (done) {
-    return ChatApp.ensureRunning(done)
+    ChatApp.ensureRunning(done)
   })
   })
 
 
   describe('globally', function () {
   describe('globally', function () {
@@ -21,7 +14,7 @@ describe('Sending a message', function () {
       this.project_id = ObjectId().toString()
       this.project_id = ObjectId().toString()
       this.user_id = ObjectId().toString()
       this.user_id = ObjectId().toString()
       this.content = 'global message'
       this.content = 'global message'
-      return ChatClient.sendGlobalMessage(
+      ChatClient.sendGlobalMessage(
         this.project_id,
         this.project_id,
         this.user_id,
         this.user_id,
         this.content,
         this.content,
@@ -31,20 +24,20 @@ describe('Sending a message', function () {
           expect(body.content).to.equal(this.content)
           expect(body.content).to.equal(this.content)
           expect(body.user_id).to.equal(this.user_id)
           expect(body.user_id).to.equal(this.user_id)
           expect(body.room_id).to.equal(this.project_id)
           expect(body.room_id).to.equal(this.project_id)
-          return done()
+          done()
         }
         }
       )
       )
     })
     })
 
 
-    return it('should then list the message in the project messages', function (done) {
-      return ChatClient.getGlobalMessages(
+    it('should then list the message in the project messages', function (done) {
+      ChatClient.getGlobalMessages(
         this.project_id,
         this.project_id,
         (error, response, messages) => {
         (error, response, messages) => {
           expect(error).to.be.null
           expect(error).to.be.null
           expect(response.statusCode).to.equal(200)
           expect(response.statusCode).to.equal(200)
           expect(messages.length).to.equal(1)
           expect(messages.length).to.equal(1)
           expect(messages[0].content).to.equal(this.content)
           expect(messages[0].content).to.equal(this.content)
-          return done()
+          done()
         }
         }
       )
       )
     })
     })
@@ -56,7 +49,7 @@ describe('Sending a message', function () {
       this.user_id = ObjectId().toString()
       this.user_id = ObjectId().toString()
       this.thread_id = ObjectId().toString()
       this.thread_id = ObjectId().toString()
       this.content = 'thread message'
       this.content = 'thread message'
-      return ChatClient.sendMessage(
+      ChatClient.sendMessage(
         this.project_id,
         this.project_id,
         this.thread_id,
         this.thread_id,
         this.user_id,
         this.user_id,
@@ -67,49 +60,46 @@ describe('Sending a message', function () {
           expect(body.content).to.equal(this.content)
           expect(body.content).to.equal(this.content)
           expect(body.user_id).to.equal(this.user_id)
           expect(body.user_id).to.equal(this.user_id)
           expect(body.room_id).to.equal(this.project_id)
           expect(body.room_id).to.equal(this.project_id)
-          return done()
+          done()
         }
         }
       )
       )
     })
     })
 
 
     it('should then list the message in the threads', function (done) {
     it('should then list the message in the threads', function (done) {
-      return ChatClient.getThreads(
-        this.project_id,
-        (error, response, threads) => {
-          expect(error).to.be.null
-          expect(response.statusCode).to.equal(200)
-          expect(threads[this.thread_id].messages.length).to.equal(1)
-          expect(threads[this.thread_id].messages[0].content).to.equal(
-            this.content
-          )
-          return done()
-        }
-      )
+      ChatClient.getThreads(this.project_id, (error, response, threads) => {
+        expect(error).to.be.null
+        expect(response.statusCode).to.equal(200)
+        expect(threads[this.thread_id].messages.length).to.equal(1)
+        expect(threads[this.thread_id].messages[0].content).to.equal(
+          this.content
+        )
+        done()
+      })
     })
     })
 
 
-    return it('should not appear in the global messages', function (done) {
-      return ChatClient.getGlobalMessages(
+    it('should not appear in the global messages', function (done) {
+      ChatClient.getGlobalMessages(
         this.project_id,
         this.project_id,
         (error, response, messages) => {
         (error, response, messages) => {
           expect(error).to.be.null
           expect(error).to.be.null
           expect(response.statusCode).to.equal(200)
           expect(response.statusCode).to.equal(200)
           expect(messages.length).to.equal(0)
           expect(messages.length).to.equal(0)
-          return done()
+          done()
         }
         }
       )
       )
     })
     })
   })
   })
 
 
-  return describe('failure cases', function () {
+  describe('failure cases', function () {
     before(function () {
     before(function () {
       this.project_id = ObjectId().toString()
       this.project_id = ObjectId().toString()
       this.user_id = ObjectId().toString()
       this.user_id = ObjectId().toString()
-      return (this.thread_id = ObjectId().toString())
+      this.thread_id = ObjectId().toString()
     })
     })
 
 
     describe('with a malformed user_id', function () {
     describe('with a malformed user_id', function () {
-      return it('should return a graceful error', function (done) {
-        return ChatClient.sendMessage(
+      it('should return a graceful error', function (done) {
+        ChatClient.sendMessage(
           this.project_id,
           this.project_id,
           this.thread_id,
           this.thread_id,
           'malformed-user',
           'malformed-user',
@@ -118,15 +108,15 @@ describe('Sending a message', function () {
             if (error) return done(error)
             if (error) return done(error)
             expect(response.statusCode).to.equal(400)
             expect(response.statusCode).to.equal(400)
             expect(body).to.equal('Invalid userId')
             expect(body).to.equal('Invalid userId')
-            return done()
+            done()
           }
           }
         )
         )
       })
       })
     })
     })
 
 
     describe('with a malformed project_id', function () {
     describe('with a malformed project_id', function () {
-      return it('should return a graceful error', function (done) {
-        return ChatClient.sendMessage(
+      it('should return a graceful error', function (done) {
+        ChatClient.sendMessage(
           'malformed-project',
           'malformed-project',
           this.thread_id,
           this.thread_id,
           this.user_id,
           this.user_id,
@@ -135,15 +125,15 @@ describe('Sending a message', function () {
             if (error) return done(error)
             if (error) return done(error)
             expect(response.statusCode).to.equal(400)
             expect(response.statusCode).to.equal(400)
             expect(body).to.equal('Invalid projectId')
             expect(body).to.equal('Invalid projectId')
-            return done()
+            done()
           }
           }
         )
         )
       })
       })
     })
     })
 
 
     describe('with a malformed thread_id', function () {
     describe('with a malformed thread_id', function () {
-      return it('should return a graceful error', function (done) {
-        return ChatClient.sendMessage(
+      it('should return a graceful error', function (done) {
+        ChatClient.sendMessage(
           this.project_id,
           this.project_id,
           'malformed-thread-id',
           'malformed-thread-id',
           this.user_id,
           this.user_id,
@@ -152,15 +142,15 @@ describe('Sending a message', function () {
             if (error) return done(error)
             if (error) return done(error)
             expect(response.statusCode).to.equal(400)
             expect(response.statusCode).to.equal(400)
             expect(body).to.equal('Invalid threadId')
             expect(body).to.equal('Invalid threadId')
-            return done()
+            done()
           }
           }
         )
         )
       })
       })
     })
     })
 
 
     describe('with no content', function () {
     describe('with no content', function () {
-      return it('should return a graceful error', function (done) {
-        return ChatClient.sendMessage(
+      it('should return a graceful error', function (done) {
+        ChatClient.sendMessage(
           this.project_id,
           this.project_id,
           this.thread_id,
           this.thread_id,
           this.user_id,
           this.user_id,
@@ -169,16 +159,16 @@ describe('Sending a message', function () {
             if (error) return done(error)
             if (error) return done(error)
             expect(response.statusCode).to.equal(400)
             expect(response.statusCode).to.equal(400)
             expect(body).to.equal('No content provided')
             expect(body).to.equal('No content provided')
-            return done()
+            done()
           }
           }
         )
         )
       })
       })
     })
     })
 
 
-    return describe('with very long content', function () {
-      return it('should return a graceful error', function (done) {
+    describe('with very long content', function () {
+      it('should return a graceful error', function (done) {
         const content = '-'.repeat(10 * 1024 + 1)
         const content = '-'.repeat(10 * 1024 + 1)
-        return ChatClient.sendMessage(
+        ChatClient.sendMessage(
           this.project_id,
           this.project_id,
           this.thread_id,
           this.thread_id,
           this.user_id,
           this.user_id,
@@ -187,7 +177,7 @@ describe('Sending a message', function () {
             if (error) return done(error)
             if (error) return done(error)
             expect(response.statusCode).to.equal(400)
             expect(response.statusCode).to.equal(400)
             expect(body).to.equal('Content too long (> 10240 bytes)')
             expect(body).to.equal('Content too long (> 10240 bytes)')
-            return done()
+            done()
           }
           }
         )
         )
       })
       })

+ 1 - 2
services/chat/test/acceptance/js/helpers/ChatApp.js

@@ -3,7 +3,6 @@
 /*
 /*
  * decaffeinate suggestions:
  * decaffeinate suggestions:
  * DS101: Remove unnecessary use of Array.from
  * DS101: Remove unnecessary use of Array.from
- * DS102: Remove unnecessary code created because of implicit returns
  * DS205: Consider reworking code to avoid use of IIFEs
  * DS205: Consider reworking code to avoid use of IIFEs
  * DS207: Consider shorter variations of null checks
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
@@ -27,7 +26,7 @@ module.exports = {
     this.initing = true
     this.initing = true
     this.callbacks.push(callback)
     this.callbacks.push(callback)
     waitForDb().then(() => {
     waitForDb().then(() => {
-      return app.listen(3010, 'localhost', error => {
+      app.listen(3010, 'localhost', error => {
         if (error != null) {
         if (error != null) {
           throw error
           throw error
         }
         }

+ 9 - 16
services/chat/test/acceptance/js/helpers/ChatClient.js

@@ -1,17 +1,10 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Fix any style issues and re-enable lint.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
- */
 const request = require('request').defaults({
 const request = require('request').defaults({
   baseUrl: 'http://localhost:3010',
   baseUrl: 'http://localhost:3010',
 })
 })
 
 
 module.exports = {
 module.exports = {
   sendGlobalMessage(projectId, userId, content, callback) {
   sendGlobalMessage(projectId, userId, content, callback) {
-    return request.post(
+    request.post(
       {
       {
         url: `/project/${projectId}/messages`,
         url: `/project/${projectId}/messages`,
         json: {
         json: {
@@ -24,7 +17,7 @@ module.exports = {
   },
   },
 
 
   getGlobalMessages(projectId, callback) {
   getGlobalMessages(projectId, callback) {
-    return request.get(
+    request.get(
       {
       {
         url: `/project/${projectId}/messages`,
         url: `/project/${projectId}/messages`,
         json: true,
         json: true,
@@ -34,7 +27,7 @@ module.exports = {
   },
   },
 
 
   sendMessage(projectId, threadId, userId, content, callback) {
   sendMessage(projectId, threadId, userId, content, callback) {
-    return request.post(
+    request.post(
       {
       {
         url: `/project/${projectId}/thread/${threadId}/messages`,
         url: `/project/${projectId}/thread/${threadId}/messages`,
         json: {
         json: {
@@ -47,7 +40,7 @@ module.exports = {
   },
   },
 
 
   getThreads(projectId, callback) {
   getThreads(projectId, callback) {
-    return request.get(
+    request.get(
       {
       {
         url: `/project/${projectId}/threads`,
         url: `/project/${projectId}/threads`,
         json: true,
         json: true,
@@ -57,7 +50,7 @@ module.exports = {
   },
   },
 
 
   resolveThread(projectId, threadId, userId, callback) {
   resolveThread(projectId, threadId, userId, callback) {
-    return request.post(
+    request.post(
       {
       {
         url: `/project/${projectId}/thread/${threadId}/resolve`,
         url: `/project/${projectId}/thread/${threadId}/resolve`,
         json: {
         json: {
@@ -69,7 +62,7 @@ module.exports = {
   },
   },
 
 
   reopenThread(projectId, threadId, callback) {
   reopenThread(projectId, threadId, callback) {
-    return request.post(
+    request.post(
       {
       {
         url: `/project/${projectId}/thread/${threadId}/reopen`,
         url: `/project/${projectId}/thread/${threadId}/reopen`,
       },
       },
@@ -78,7 +71,7 @@ module.exports = {
   },
   },
 
 
   deleteThread(projectId, threadId, callback) {
   deleteThread(projectId, threadId, callback) {
-    return request.del(
+    request.del(
       {
       {
         url: `/project/${projectId}/thread/${threadId}`,
         url: `/project/${projectId}/thread/${threadId}`,
       },
       },
@@ -87,7 +80,7 @@ module.exports = {
   },
   },
 
 
   editMessage(projectId, threadId, messageId, content, callback) {
   editMessage(projectId, threadId, messageId, content, callback) {
-    return request.post(
+    request.post(
       {
       {
         url: `/project/${projectId}/thread/${threadId}/messages/${messageId}/edit`,
         url: `/project/${projectId}/thread/${threadId}/messages/${messageId}/edit`,
         json: {
         json: {
@@ -99,7 +92,7 @@ module.exports = {
   },
   },
 
 
   deleteMessage(projectId, threadId, messageId, callback) {
   deleteMessage(projectId, threadId, messageId, callback) {
-    return request.del(
+    request.del(
       {
       {
         url: `/project/${projectId}/thread/${threadId}/messages/${messageId}`,
         url: `/project/${projectId}/thread/${threadId}/messages/${messageId}`,
       },
       },