diff --git a/.eslintrc.js b/.eslintrc.js index f4db62c1e5..2eea27ec8d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -37,5 +37,7 @@ module.exports = { // though we have a logger, we still remap console to log to disk 'no-console': 'off', + + 'operator-linebreak': ["error", "after", { "overrides": { '?': 'before', ':': 'before' } }] } }; diff --git a/app/logging.js b/app/logging.js index bad52467ab..52bf2cc04f 100644 --- a/app/logging.js +++ b/app/logging.js @@ -117,8 +117,8 @@ function eliminateOutOfDateFiles(logPath, date) { const file = { path: target, start: isLineAfterDate(start, date), - end: isLineAfterDate(end[end.length - 1], date) - || isLineAfterDate(end[end.length - 2], date), + end: isLineAfterDate(end[end.length - 1], date) || + isLineAfterDate(end[end.length - 2], date), }; if (!file.start && !file.end) { diff --git a/js/background.js b/js/background.js index 96fdbf4c2f..51c1eb1a02 100644 --- a/js/background.js +++ b/js/background.js @@ -518,9 +518,9 @@ return ev.confirm(); } - const { type, id } = data.message.group ? - { type: 'group', id: data.message.group.id } : - { type: 'private', id: data.source }; + const { type, id } = data.message.group + ? { type: 'group', id: data.message.group.id } + : { type: 'private', id: data.source }; const processedMessage = await Message.process(data.message); diff --git a/js/views/file_input_view.js b/js/views/file_input_view.js index a676e95bca..3cec2c9a24 100644 --- a/js/views/file_input_view.js +++ b/js/views/file_input_view.js @@ -206,9 +206,9 @@ if (file === undefined) { return Promise.resolve(); } - const attachmentFlags = this.isVoiceNote ? - textsecure.protobuf.AttachmentPointer.Flags.VOICE_MESSAGE : - null; + const attachmentFlags = this.isVoiceNote + ? textsecure.protobuf.AttachmentPointer.Flags.VOICE_MESSAGE + : null; const setFlags = flags => (attachment) => { const newAttachment = Object.assign({}, attachment); diff --git a/main.js b/main.js index 6bb2c400e7..584c92d1b0 100644 --- a/main.js +++ b/main.js @@ -157,10 +157,10 @@ function isVisible(window, bounds) { const topClearOfUpperBound = window.y >= boundsY; const topClearOfLowerBound = (window.y <= (boundsY + boundsHeight) - BOUNDS_BUFFER); - return rightSideClearOfLeftBound - && leftSideClearOfRightBound - && topClearOfUpperBound - && topClearOfLowerBound; + return rightSideClearOfLeftBound && + leftSideClearOfRightBound && + topClearOfUpperBound && + topClearOfLowerBound; } function createWindow() { @@ -277,8 +277,8 @@ function createWindow() { // Emitted when the window is about to be closed. mainWindow.on('close', (e) => { // If the application is terminating, just do the default - if (windowState.shouldQuit() - || config.environment === 'test' || config.environment === 'test-lib') { + if (windowState.shouldQuit() || + config.environment === 'test' || config.environment === 'test-lib') { return; } @@ -422,9 +422,9 @@ app.on('before-quit', () => { app.on('window-all-closed', () => { // On OS X it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q - if (process.platform !== 'darwin' - || config.environment === 'test' - || config.environment === 'test-lib') { + if (process.platform !== 'darwin' || + config.environment === 'test' || + config.environment === 'test-lib') { app.quit(); } });