Enable ESLint `function-paren-newline` `multiline`

Per discussion.
This commit is contained in:
Daniel Gasienica 2018-02-15 17:12:18 -05:00
parent b660b6bc8e
commit 799c881763
3 changed files with 29 additions and 29 deletions

View File

@ -21,7 +21,7 @@ module.exports = {
}],
// putting params on their own line helps stay within line length limit
'function-paren-newline': ['error', 'consistent'],
'function-paren-newline': ['error', 'multiline'],
// 90 characters allows three+ side-by-side screens on a standard-size monitor
'max-len': ['error', {

View File

@ -497,18 +497,19 @@
/* eslint-enable */
/* jshint ignore:start */
function createMessageHandler(
{ createMessage, getMessageDescriptor, handleProfileUpdate }
) {
function createMessageHandler({
createMessage,
getMessageDescriptor,
handleProfileUpdate,
}) {
return async (event) => {
const { data, confirm } = event;
const messageDescriptor = getMessageDescriptor(data);
const isProfileUpdate = Boolean(
// eslint-disable-next-line no-bitwise
data.message.flags & textsecure.protobuf.DataMessage.Flags.PROFILE_KEY_UPDATE
);
const { PROFILE_KEY_UPDATE } = textsecure.protobuf.DataMessage.Flags;
// eslint-disable-next-line no-bitwise
const isProfileUpdate = Boolean(data.message.flags & PROFILE_KEY_UPDATE);
if (isProfileUpdate) {
return handleProfileUpdate({ data, confirm, messageDescriptor });
}
@ -522,7 +523,8 @@
const upgradedMessage = await Message.upgradeSchema(data.message);
await ConversationController.getOrCreateAndWait(
messageDescriptor.id, messageDescriptor.type
messageDescriptor.id,
messageDescriptor.type
);
return message.handleDataMessage(
upgradedMessage,
@ -533,9 +535,11 @@
}
// Received:
async function handleMessageReceivedProfileUpdate(
{ data, confirm, messageDescriptor }
) {
async function handleMessageReceivedProfileUpdate({
data,
confirm,
messageDescriptor,
}) {
const profileKey = data.message.profileKey.toArrayBuffer();
const sender = await ConversationController.getOrCreateAndWait(
messageDescriptor.id,
@ -552,11 +556,10 @@
});
// Sent:
async function handleMessageSentProfileUpdate(
{ confirm, messageDescriptor }
) {
async function handleMessageSentProfileUpdate({ confirm, messageDescriptor }) {
const conversation = await ConversationController.getOrCreateAndWait(
messageDescriptor.id, messageDescriptor.type
messageDescriptor.id,
messageDescriptor.type
);
await conversation.save({ profileSharing: true });
return confirm();

View File

@ -617,9 +617,8 @@
now
);
const upgradedAttachments = await Promise.all(
attachments.map(Attachment.upgradeSchema)
);
const upgradedAttachments =
await Promise.all(attachments.map(Attachment.upgradeSchema));
const message = this.messageCollection.add({
body,
conversationId: this.id,
@ -658,16 +657,14 @@
profileKey = storage.get('profileKey');
}
message.send(
sendFunc(
this.get('id'),
body,
upgradedAttachments,
now,
this.get('expireTimer'),
profileKey
)
);
message.send(sendFunc(
this.get('id'),
body,
upgradedAttachments,
now,
this.get('expireTimer'),
profileKey
));
});
},
/* jshint ignore:end */