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