diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2019-03-06 20:36:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-06 20:36:17 +0300 |
commit | 581892c940078feafcb88c7228b58799561bb9f4 (patch) | |
tree | 2891a404ddbeeca20c3971d71d471fd6189a9cf3 /src | |
parent | 5ab96c39d64f803bb1a977b90a805a1895ba9618 (diff) | |
parent | 7101e13954b03f98cff18760ea559453843155cf (diff) |
Merge pull request #1588 from nextcloud/lint/utils
Apply lint:autofix on util modules
Diffstat (limited to 'src')
-rw-r--r-- | src/util/CrashReport.js | 15 | ||||
-rw-r--r-- | src/util/ErrorMessageFactory.js | 27 | ||||
-rw-r--r-- | src/util/HtmlHelper.js | 4 | ||||
-rw-r--r-- | src/util/undefined.js | 4 |
4 files changed, 22 insertions, 28 deletions
diff --git a/src/util/CrashReport.js b/src/util/CrashReport.js index a1f218f04..59f33f118 100644 --- a/src/util/CrashReport.js +++ b/src/util/CrashReport.js @@ -38,7 +38,7 @@ const flattenError = error => { } const flattenTrace = trace => { - return trace.reduce(function (acc, entry) { + return trace.reduce(function(acc, entry) { var text = '' if (entry.class) { text += ' at ' + entry.class + '::' + entry.function @@ -59,12 +59,17 @@ export const getReportUrl = error => { message += '.' } var builder = new IssueTemplateBuilder() - var template = builder.addEmptyStepsToReproduce() + var template = builder + .addEmptyStepsToReproduce() .addExpectedActualBehaviour() .addLogs('Error', flattenError(error)) .render() - return 'https://github.com/nextcloud/mail/issues/new' + - '?title=' + encodeURIComponent(message) + - '&body=' + encodeURIComponent(template) + return ( + 'https://github.com/nextcloud/mail/issues/new' + + '?title=' + + encodeURIComponent(message) + + '&body=' + + encodeURIComponent(template) + ) } diff --git a/src/util/ErrorMessageFactory.js b/src/util/ErrorMessageFactory.js index 12b42cb9b..91343903f 100644 --- a/src/util/ErrorMessageFactory.js +++ b/src/util/ErrorMessageFactory.js @@ -17,20 +17,9 @@ * */ -import { - translate as t -} from 'nextcloud-server/dist/l10n' +import {translate as t} from 'nextcloud-server/dist/l10n' -const smileys = [ - ':-(', - ':-/', - ':-\\', - ':-|', - ':\'-(', - ':\'-/', - ':\'-\\', - ':\'-|', -]; +const smileys = [':-(', ':-/', ':-\\', ':-|', ":'-(", ":'-/", ":'-\\", ":'-|"] const getRandomSmiley = () => { return smileys[Math.floor(Math.random() * smileys.length)] @@ -40,22 +29,22 @@ const getRandomSmiley = () => { * @param {Folder} folder * @returns {string} */ -export const getRandomFolderErrorMessage = (folder) => { - const folderName = folder.get('name'); +export const getRandomFolderErrorMessage = folder => { + const folderName = folder.get('name') const rawTexts = [ t('mail', 'Could not load {tag}{name}{endtag}', { - name: folderName + name: folderName, }), t('mail', 'Could not load {tag}{name}{endtag}', { - name: folderName + name: folderName, }), t('mail', 'There was a problem loading {tag}{name}{endtag}', { - name: folderName + name: folderName, }), ] const texts = rawTexts.map(text => text.replace('{tag}', '<strong>').replace('{endtag}', '</strong>')) const text = texts[Math.floor(Math.random() * texts.length)] - return text + ' ' + getRandomSmiley(); + return text + ' ' + getRandomSmiley() } /** diff --git a/src/util/HtmlHelper.js b/src/util/HtmlHelper.js index 1ad9856f8..dabcf563d 100644 --- a/src/util/HtmlHelper.js +++ b/src/util/HtmlHelper.js @@ -15,6 +15,6 @@ export const htmlToText = html => { noLinkBrackets: true, ignoreHref: true, ignoreImage: true, - wordwrap: 78 // 80 minus '> ' prefix for replies - }); + wordwrap: 78, // 80 minus '> ' prefix for replies + }) } diff --git a/src/util/undefined.js b/src/util/undefined.js index 4ea802910..78ec14cc2 100644 --- a/src/util/undefined.js +++ b/src/util/undefined.js @@ -22,11 +22,11 @@ import _ from 'lodash' class IndefinableValue { - constructor (value) { + constructor(value) { this.value = value } - or (other) { + or(other) { if (_.isUndefined(this.value)) { return other } else { |