Node.js based forum software built for the modern web
chore: eslint object-curly-newline
Peter Jaszkowiak8d1462ffd83c
diff --git a/.eslintrc b/.eslintrcindex 8f094ce324..dffb62726f 100644--- a/.eslintrc+++ b/.eslintrc@@ -54,8 +54,7 @@"no-use-before-define": ["error", "nofunc"],// require consistent newlines before and after braces// if contents are multiline- // "object-curly-newline": ["error", { "consistent": true, "multiline": true }],- "object-curly-newline": "off",+ "object-curly-newline": ["error", { "consistent": true, "multiline": true }],// require consistent linebreaks inline function parenthesis (arguments or params)"function-paren-newline": ["error", "consistent"],// only require const if all parts of destructuring can be constdiff --git a/src/controllers/accounts/helpers.js b/src/controllers/accounts/helpers.jsindex a38d1659c3..f94b73095a 100644--- a/src/controllers/accounts/helpers.js+++ b/src/controllers/accounts/helpers.js@@ -233,13 +233,15 @@ async function parseAboutMe(userData) {function filterLinks(links, states) {return links.filter((link, index) => {// Default visibility- link.visibility = { self: true,+ link.visibility = {+ self: true,other: true,moderator: true,globalMod: true,admin: true,canViewInfo: true,- ...link.visibility };+ ...link.visibility,+ };const permit = Object.keys(states).some(state => states[state] && link.visibility[state]);diff --git a/src/controllers/osd.js b/src/controllers/osd.jsindex 194734c26d..244f8326f4 100644--- a/src/controllers/osd.js+++ b/src/controllers/osd.js@@ -17,28 +17,36 @@ module.exports.handle = function (req, res, next) {function generateXML() {return xml([{OpenSearchDescription: [- { _attr: {- xmlns: 'http://a9.com/-/spec/opensearch/1.1/',- 'xmlns:moz': 'http://www.mozilla.org/2006/browser/search/',- } },+ {+ _attr: {+ xmlns: 'http://a9.com/-/spec/opensearch/1.1/',+ 'xmlns:moz': 'http://www.mozilla.org/2006/browser/search/',+ },+ },{ ShortName: trimToLength(String(meta.config.title || meta.config.browserTitle || 'NodeBB'), 16) },{ Description: trimToLength(String(meta.config.description || ''), 1024) },{ InputEncoding: 'UTF-8' },- { Image: [- { _attr: {- width: '16',- height: '16',- type: 'image/x-icon',- } },- `${nconf.get('url')}/favicon.ico`,- ] },- { Url: {- _attr: {- type: 'text/html',- method: 'get',- template: `${nconf.get('url')}/search?term={searchTerms}&in=titlesposts`,+ {+ Image: [+ {+ _attr: {+ width: '16',+ height: '16',+ type: 'image/x-icon',+ },+ },+ `${nconf.get('url')}/favicon.ico`,+ ],+ },+ {+ Url: {+ _attr: {+ type: 'text/html',+ method: 'get',+ template: `${nconf.get('url')}/search?term={searchTerms}&in=titlesposts`,+ },},- } },+ },{ 'moz:SearchForm': `${nconf.get('url')}/search` },],}], { declaration: true, indent: '\t' });diff --git a/src/database/mongo/sets.js b/src/database/mongo/sets.jsindex 93c43c7529..a6433c5680 100644--- a/src/database/mongo/sets.js+++ b/src/database/mongo/sets.js@@ -39,11 +39,13 @@ module.exports = function (module) {const bulk = module.client.collection('objects').initializeUnorderedBulkOp();for (let i = 0; i < keys.length; i += 1) {- bulk.find({ _key: keys[i] }).upsert().updateOne({ $addToSet: {- members: {- $each: value,+ bulk.find({ _key: keys[i] }).upsert().updateOne({+ $addToSet: {+ members: {+ $each: value,+ },},- } });+ });}try {await bulk.execute();