chore: eslint object-curly-newline

v1.18.x
Peter Jaszkowiak 4 years ago committed by Julian Lam
parent 62869bae3d
commit 8d1462ffd8

@ -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 const

@ -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]);

@ -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' });

@ -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();

Loading…
Cancel
Save