mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 00:10:25 +01:00
Fix eslint rules (#5117)
* Fix semi linter rule * Fix semi-spacing linter rule * Fix no-undef-init linter rule * Fix space-before-blocks linter rule
This commit is contained in:
committed by
Julian Lam
parent
727710fbd9
commit
e515b791da
@@ -48,7 +48,6 @@
|
||||
"no-extend-native": "off",
|
||||
"no-shadow-restricted-names": "off",
|
||||
"no-extra-boolean-cast": "off",
|
||||
"no-undef-init": "off",
|
||||
"no-script-url": "off",
|
||||
"no-path-concat": "off",
|
||||
"no-unused-expressions": "off",
|
||||
@@ -66,7 +65,6 @@
|
||||
"padded-blocks": "off",
|
||||
"eol-last": "off",
|
||||
"lines-around-directive": "off",
|
||||
"space-before-blocks": "off",
|
||||
"no-restricted-syntax": "off",
|
||||
"vars-on-top": "off",
|
||||
"no-prototype-builtins": "off",
|
||||
@@ -80,7 +78,6 @@
|
||||
"keyword-spacing": "off",
|
||||
"no-plusplus": "off",
|
||||
"no-mixed-operators": "off",
|
||||
"semi": "off",
|
||||
"comma-spacing": "off",
|
||||
"global-require": "off",
|
||||
"no-trailing-spaces": "off",
|
||||
@@ -97,7 +94,6 @@
|
||||
"no-console": "off",
|
||||
"space-unary-ops": "off",
|
||||
"import/no-dynamic-require": "off",
|
||||
"semi-spacing": "off",
|
||||
"no-bitwise": "off",
|
||||
"no-empty": "off",
|
||||
"array-bracket-spacin": "off",
|
||||
|
||||
@@ -273,7 +273,7 @@ define('admin/general/dashboard', ['semver', 'Chart'], function (semver, Chart)
|
||||
adjustPieCharts();
|
||||
|
||||
$('[data-action="updateGraph"]').on('click', function () {
|
||||
var until = undefined;
|
||||
var until;
|
||||
switch($(this).attr('data-until')) {
|
||||
case 'last-month':
|
||||
var lastMonth = new Date();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*global define*/
|
||||
|
||||
define('admin/general/languages', ['admin/settings'], function (Settings) {
|
||||
var Languages = {}
|
||||
var Languages = {};
|
||||
|
||||
Languages.init = function () {
|
||||
Settings.prepare();
|
||||
|
||||
@@ -77,7 +77,7 @@ define('admin/general/navigation', ['translator', 'iconSelect', 'jqueryui'], fun
|
||||
templates.parse('admin/general/navigation', 'enabled', {enabled: [data]}, function (li) {
|
||||
li = $(translator.unescape(li));
|
||||
$('#enabled').append(li);
|
||||
componentHandler.upgradeDom()
|
||||
componentHandler.upgradeDom();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* global define, socket */
|
||||
|
||||
define('admin/settings/general', ['admin/settings'], function (Settings) {
|
||||
var Module = {}
|
||||
var Module = {};
|
||||
|
||||
Module.init = function () {
|
||||
$('button[data-action="removeLogo"]').on('click', function () {
|
||||
|
||||
@@ -122,7 +122,7 @@ $(document).ready(function () {
|
||||
|
||||
var payload = {
|
||||
url: url
|
||||
}
|
||||
};
|
||||
|
||||
$(window).trigger('action:ajaxify.start', payload);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ define('forum/compose', [], function () {
|
||||
container: container
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return Compose;
|
||||
});
|
||||
|
||||
@@ -60,7 +60,7 @@ define('forum/groups/list', ['forum/infinitescroll'], function (infinitescroll)
|
||||
$('[component="groups/container"]').attr('data-nextstart', data.nextStart);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Groups.search = function () {
|
||||
var groupsEl = $('#groups-list'),
|
||||
|
||||
@@ -22,7 +22,7 @@ define('autocomplete', function () {
|
||||
|
||||
if (result && result.users) {
|
||||
var names = result.users.map(function (user) {
|
||||
var username = $('<div/>').html(user.username).text()
|
||||
var username = $('<div/>').html(user.username).text();
|
||||
return user && {
|
||||
label: username,
|
||||
value: username,
|
||||
|
||||
@@ -19,7 +19,7 @@ define('sounds', ['buzz'], function (buzz) {
|
||||
}
|
||||
eventSoundMapping = mapping;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function loadData(callback) {
|
||||
socket.emit('modules.sounds.getData', function (err, data) {
|
||||
|
||||
@@ -318,7 +318,7 @@ var privileges = require('./privileges');
|
||||
|
||||
var bullet = level ? '• ' : '';
|
||||
category.value = category.cid;
|
||||
category.text = level + bullet + category.name
|
||||
category.text = level + bullet + category.name;
|
||||
categoriesData.push(category);
|
||||
|
||||
category.children.forEach(function (child) {
|
||||
|
||||
@@ -131,7 +131,7 @@ module.exports = function (Groups) {
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
})
|
||||
});
|
||||
next(null, results);
|
||||
}
|
||||
], callback);
|
||||
|
||||
@@ -161,6 +161,3 @@ module.exports = function (middleware) {
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -167,5 +167,5 @@ module.exports = function (SocketPosts) {
|
||||
},
|
||||
async.apply(posts.updateFlagData)
|
||||
], callback);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -122,6 +122,6 @@ module.exports = function (SocketUser) {
|
||||
}
|
||||
|
||||
callback(null, data.list.pictures);
|
||||
})
|
||||
});
|
||||
};
|
||||
};
|
||||
@@ -37,7 +37,7 @@ module.exports = function (User) {
|
||||
expiry_readable: new Date(parseInt(expiry, 10)).toString().replace(/:/g, '%3A'),
|
||||
reason: validator.escape(String(reason))
|
||||
});
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
User.getModerationHistory = function (uid, callback) {
|
||||
|
||||
@@ -138,7 +138,7 @@ module.exports = function (User) {
|
||||
db.delete('invitation:email:' + email, callback);
|
||||
}
|
||||
], function (err) {
|
||||
next(err)
|
||||
next(err);
|
||||
});
|
||||
}
|
||||
], callback);
|
||||
|
||||
@@ -81,7 +81,7 @@ describe('authentication', function () {
|
||||
}, function (err, response, body) {
|
||||
assert.ifError(err);
|
||||
assert.equal(body, 'not-authorized');
|
||||
done()
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -119,7 +119,7 @@ describe('authentication', function () {
|
||||
assert(body);
|
||||
assert.equal(body.username, 'regular');
|
||||
assert.equal(body.email, 'regular@nodebb.org');
|
||||
done()
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('Plugins', function () {
|
||||
plugins.registerHook('test-plugin', {hook: 'static:test.hook', method: actionMethod});
|
||||
plugins.fireHook('static:test.hook', {bar: 'test'}, function (err) {
|
||||
assert.ifError(err);
|
||||
done()
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user