Merge pull request #3495 from overleaf/ae-prettier-2

Upgrade Prettier to v2

GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
Alf Eaton
2021-04-15 02:05:22 +00:00
committed by Copybot
parent 930d7ba028
commit 1ebc8a79cb
582 changed files with 20382 additions and 20374 deletions
@@ -19,9 +19,9 @@ const settings = require('settings-sharelatex')
module.exports = ChatApiHandler = {
_apiRequest(opts, callback) {
if (callback == null) {
callback = function(error, data) {}
callback = function (error, data) {}
}
return request(opts, function(error, response, data) {
return request(opts, function (error, response, data) {
if (error != null) {
return callback(error)
}
@@ -71,7 +71,7 @@ module.exports = ChatApiHandler = {
sendComment(project_id, thread_id, user_id, content, callback) {
if (callback == null) {
callback = function(error) {}
callback = function (error) {}
}
return ChatApiHandler._apiRequest(
{
@@ -85,7 +85,7 @@ module.exports = ChatApiHandler = {
getThreads(project_id, callback) {
if (callback == null) {
callback = function(error) {}
callback = function (error) {}
}
return ChatApiHandler._apiRequest(
{
@@ -99,7 +99,7 @@ module.exports = ChatApiHandler = {
resolveThread(project_id, thread_id, user_id, callback) {
if (callback == null) {
callback = function(error) {}
callback = function (error) {}
}
return ChatApiHandler._apiRequest(
{
@@ -113,7 +113,7 @@ module.exports = ChatApiHandler = {
reopenThread(project_id, thread_id, callback) {
if (callback == null) {
callback = function(error) {}
callback = function (error) {}
}
return ChatApiHandler._apiRequest(
{
@@ -126,7 +126,7 @@ module.exports = ChatApiHandler = {
deleteThread(project_id, thread_id, callback) {
if (callback == null) {
callback = function(error) {}
callback = function (error) {}
}
return ChatApiHandler._apiRequest(
{
@@ -139,7 +139,7 @@ module.exports = ChatApiHandler = {
editMessage(project_id, thread_id, message_id, content, callback) {
if (callback == null) {
callback = function(error) {}
callback = function (error) {}
}
return ChatApiHandler._apiRequest(
{
@@ -155,7 +155,7 @@ module.exports = ChatApiHandler = {
deleteMessage(project_id, thread_id, message_id, callback) {
if (callback == null) {
callback = function(error) {}
callback = function (error) {}
}
return ChatApiHandler._apiRequest(
{
@@ -36,25 +36,25 @@ module.exports = ChatController = {
project_id,
user_id,
content,
function(err, message) {
function (err, message) {
if (err != null) {
return next(err)
}
return UserInfoManager.getPersonalInfo(message.user_id, function(
err,
user
) {
if (err != null) {
return next(err)
return UserInfoManager.getPersonalInfo(
message.user_id,
function (err, user) {
if (err != null) {
return next(err)
}
message.user = UserInfoController.formatPersonalInfo(user)
EditorRealTimeController.emitToRoom(
project_id,
'new-chat-message',
message
)
return res.sendStatus(204)
}
message.user = UserInfoController.formatPersonalInfo(user)
EditorRealTimeController.emitToRoom(
project_id,
'new-chat-message',
message
)
return res.sendStatus(204)
})
)
}
)
},
@@ -66,13 +66,13 @@ module.exports = ChatController = {
project_id,
query.limit,
query.before,
function(err, messages) {
function (err, messages) {
if (err != null) {
return next(err)
}
return ChatController._injectUserInfoIntoThreads(
{ global: { messages } },
function(err) {
function (err) {
if (err != null) {
return next(err)
}
@@ -89,7 +89,7 @@ module.exports = ChatController = {
// user fields
let message, thread, thread_id, user_id
if (callback == null) {
callback = function(error, threads) {}
callback = function (error, threads) {}
}
const user_ids = {}
for (thread_id in threads) {
@@ -108,7 +108,7 @@ module.exports = ChatController = {
const _ = user_ids[user_id]
;(user_id =>
jobs.push(cb =>
UserInfoManager.getPersonalInfo(user_id, function(error, user) {
UserInfoManager.getPersonalInfo(user_id, function (error, user) {
if (error != null) return cb(error)
user = UserInfoController.formatPersonalInfo(user)
users[user_id] = user
@@ -117,7 +117,7 @@ module.exports = ChatController = {
))(user_id)
}
return async.series(jobs, function(error) {
return async.series(jobs, function (error) {
if (error != null) {
return callback(error)
}