mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
ESlint spaced-comment
This commit is contained in:
@@ -13,10 +13,13 @@
|
|||||||
"import/no-unresolved": "off",
|
"import/no-unresolved": "off",
|
||||||
"import/no-extraneous-dependencies": "off",
|
"import/no-extraneous-dependencies": "off",
|
||||||
"import/no-dynamic-require": "off",
|
"import/no-dynamic-require": "off",
|
||||||
|
"import/newline-after-import": "off",
|
||||||
"no-bitwise": "off",
|
"no-bitwise": "off",
|
||||||
"newline-per-chained-call": "off",
|
"newline-per-chained-call": "off",
|
||||||
"no-console": "off",
|
"no-console": "off",
|
||||||
"no-empty": ["error", { "allowEmptyCatch": true }],
|
"no-empty": ["error", { "allowEmptyCatch": true }],
|
||||||
|
"prefer-rest-params": "off",
|
||||||
|
"prefer-spread": "off",
|
||||||
|
|
||||||
// "linebreak-style": "off",
|
// "linebreak-style": "off",
|
||||||
// "one-var": "off",
|
// "one-var": "off",
|
||||||
@@ -94,12 +97,9 @@
|
|||||||
"global-require": "off",
|
"global-require": "off",
|
||||||
"no-trailing-spaces": "off",
|
"no-trailing-spaces": "off",
|
||||||
"key-spacing": "off",
|
"key-spacing": "off",
|
||||||
"import/newline-after-import": "off",
|
|
||||||
"no-underscore-dangle": "off",
|
"no-underscore-dangle": "off",
|
||||||
"prefer-spread": "off",
|
|
||||||
// "no-multiple-empty-lines": "off",
|
// "no-multiple-empty-lines": "off",
|
||||||
"spaced-comment": "off",
|
// "spaced-comment": "off",
|
||||||
"prefer-rest-params": "off",
|
|
||||||
// "space-in-parens": "off",
|
// "space-in-parens": "off",
|
||||||
// "block-spacing": "off",
|
// "block-spacing": "off",
|
||||||
// "quote-props": "off",
|
// "quote-props": "off",
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ Minifier.js.minify = function (scripts, minify, callback) {
|
|||||||
process.on('message', function (payload) {
|
process.on('message', function (payload) {
|
||||||
switch(payload.action) {
|
switch(payload.action) {
|
||||||
case 'js':
|
case 'js':
|
||||||
Minifier.js.minify(payload.scripts, payload.minify, function (minified/*, sourceMap*/) {
|
Minifier.js.minify(payload.scripts, payload.minify, function (minified/* , sourceMap*/) {
|
||||||
process.send({
|
process.send({
|
||||||
type: 'end',
|
type: 'end',
|
||||||
// sourceMap: sourceMap,
|
// sourceMap: sourceMap,
|
||||||
@@ -55,7 +55,7 @@ function minifyScripts(scripts, callback) {
|
|||||||
compress: false,
|
compress: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
callback(minified.code/*, minified.map*/);
|
callback(minified.code/* , minified.map*/);
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
process.send({
|
process.send({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
/*global config, componentHandler, socket, app, bootbox, Slideout, NProgress, utils*/
|
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
var logoutTimer = 0;
|
var logoutTimer = 0;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ define('admin/extend/plugins', ['jqueryui', 'translator'], function (jqueryui, t
|
|||||||
btn.html(buttonText);
|
btn.html(buttonText);
|
||||||
btn.toggleClass('btn-warning', status.active).toggleClass('btn-success', !status.active);
|
btn.toggleClass('btn-warning', status.active).toggleClass('btn-success', !status.active);
|
||||||
|
|
||||||
//clone it to active plugins tab
|
// clone it to active plugins tab
|
||||||
if (status.active && !$('#active #' + pluginID).length) {
|
if (status.active && !$('#active #' + pluginID).length) {
|
||||||
$('#active ul').prepend(pluginEl.clone(true));
|
$('#active ul').prepend(pluginEl.clone(true));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ define('admin/manage/categories', ['vendor/jquery/serializeObject/jquery.ba-seri
|
|||||||
function itemDragDidEnd(e) {
|
function itemDragDidEnd(e) {
|
||||||
var isCategoryUpdate = (newCategoryId != -1);
|
var isCategoryUpdate = (newCategoryId != -1);
|
||||||
|
|
||||||
//Update needed?
|
// Update needed?
|
||||||
if((e.newIndex != undefined && e.oldIndex != e.newIndex) || isCategoryUpdate) {
|
if((e.newIndex != undefined && e.oldIndex != e.newIndex) || isCategoryUpdate) {
|
||||||
var parentCategory = isCategoryUpdate ? sortables[newCategoryId] : sortables[e.from.dataset.cid];
|
var parentCategory = isCategoryUpdate ? sortables[newCategoryId] : sortables[e.from.dataset.cid];
|
||||||
var modified = {};
|
var modified = {};
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ if ('undefined' !== typeof window) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
//http://stackoverflow.com/questions/511088/use-javascript-to-place-cursor-at-end-of-text-in-text-input-element
|
// http://stackoverflow.com/questions/511088/use-javascript-to-place-cursor-at-end-of-text-in-text-input-element
|
||||||
$.fn.putCursorAtEnd = function () {
|
$.fn.putCursorAtEnd = function () {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
$(this).focus();
|
$(this).focus();
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
//Adapted from http://stackoverflow.com/questions/5827612/node-js-fs-readdir-recursive-directory-search
|
// Adapted from http://stackoverflow.com/questions/5827612/node-js-fs-readdir-recursive-directory-search
|
||||||
walk: function (dir, done) {
|
walk: function (dir, done) {
|
||||||
var results = [];
|
var results = [];
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
isLatin: /^[\w\d\s.,\-@]+$/,
|
isLatin: /^[\w\d\s.,\-@]+$/,
|
||||||
languageKeyRegex: /\[\[[\w]+:.+\]\]/,
|
languageKeyRegex: /\[\[[\w]+:.+\]\]/,
|
||||||
|
|
||||||
//http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/
|
// http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/
|
||||||
slugify: function (str, preserveCase) {
|
slugify: function (str, preserveCase) {
|
||||||
if (!str) {
|
if (!str) {
|
||||||
return '';
|
return '';
|
||||||
@@ -272,7 +272,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
findBootstrapEnvironment: function () {
|
findBootstrapEnvironment: function () {
|
||||||
//http://stackoverflow.com/questions/14441456/how-to-detect-which-device-view-youre-on-using-twitter-bootstrap-api
|
// http://stackoverflow.com/questions/14441456/how-to-detect-which-device-view-youre-on-using-twitter-bootstrap-api
|
||||||
var envs = ['xs', 'sm', 'md', 'lg'];
|
var envs = ['xs', 'sm', 'md', 'lg'];
|
||||||
var $el = $('<div>');
|
var $el = $('<div>');
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@
|
|||||||
|
|
||||||
/* Retrieved from http://stackoverflow.com/a/7557433 @ 27 Mar 2016 */
|
/* Retrieved from http://stackoverflow.com/a/7557433 @ 27 Mar 2016 */
|
||||||
isElementInViewport: function (el) {
|
isElementInViewport: function (el) {
|
||||||
//special bonus for those using jQuery
|
// special bonus for those using jQuery
|
||||||
if (typeof jQuery === "function" && el instanceof jQuery) {
|
if (typeof jQuery === "function" && el instanceof jQuery) {
|
||||||
el = el[0];
|
el = el[0];
|
||||||
}
|
}
|
||||||
@@ -334,8 +334,8 @@
|
|||||||
return (
|
return (
|
||||||
rect.top >= 0 &&
|
rect.top >= 0 &&
|
||||||
rect.left >= 0 &&
|
rect.left >= 0 &&
|
||||||
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /*or $(window).height() */
|
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /* or $(window).height() */
|
||||||
rect.right <= (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */
|
rect.right <= (window.innerWidth || document.documentElement.clientWidth) /* or $(window).width() */
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ module.exports = function (Meta) {
|
|||||||
* use the line below if you want to debug minifier.js script too (or even --debug-brk option, but
|
* use the line below if you want to debug minifier.js script too (or even --debug-brk option, but
|
||||||
* you'll have to setup your debugger and connect to the forked process)
|
* you'll have to setup your debugger and connect to the forked process)
|
||||||
*/
|
*/
|
||||||
//forkProcessParams = {execArgv: ['--debug=' + (global.process.debugPort + 1), '--nolazy']};
|
// forkProcessParams = {execArgv: ['--debug=' + (global.process.debugPort + 1), '--nolazy']};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* otherwise, just clean up --debug/--debug-brk options which are set up by default from the parent one
|
* otherwise, just clean up --debug/--debug-brk options which are set up by default from the parent one
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Categories.getAll = function (socket, data, callback) {
|
|||||||
async.apply(db.getSortedSetRange, 'categories:cid', 0, -1),
|
async.apply(db.getSortedSetRange, 'categories:cid', 0, -1),
|
||||||
async.apply(categories.getCategoriesData),
|
async.apply(categories.getCategoriesData),
|
||||||
function (categories, next) {
|
function (categories, next) {
|
||||||
//Hook changes, there is no req, and res
|
// Hook changes, there is no req, and res
|
||||||
plugins.fireHook('filter:admin.categories.get', {categories: categories}, next);
|
plugins.fireHook('filter:admin.categories.get', {categories: categories}, next);
|
||||||
},
|
},
|
||||||
function (result, next) {
|
function (result, next) {
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ helpers.registerUser = function (data, callback) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
//http://stackoverflow.com/a/14387791/583363
|
// http://stackoverflow.com/a/14387791/583363
|
||||||
helpers.copyFile = function (source, target, callback) {
|
helpers.copyFile = function (source, target, callback) {
|
||||||
|
|
||||||
var cbCalled = false;
|
var cbCalled = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user