Skip to content

Node.js based forum software built for the modern web

Fix wrap-iife linter rule

HeeL9a0d764bbd15
diff --git a/.eslintrc.json b/.eslintrc.json
index 996ebe85c2..f96c075add 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -18,7 +18,6 @@
"eqeqeq": "off",
"camelcase": "off",
"no-negated-condition": "off",
- "wrap-iife": "off",
"one-var-declaration-per-line": "off",
"new-cap": "off",
"no-lonely-if": "off",
diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js
index 7250fab3b6..db3f9c2728 100644
--- a/public/src/modules/helpers.js
+++ b/public/src/modules/helpers.js
@@ -286,8 +286,8 @@
define('helpers', exports);
}
-})(
+}(
typeof exports === 'object' ? exports :
typeof define === 'function' && define.amd ? {} :
helpers = {}
-);
+));
diff --git a/public/src/modules/settings/array.js b/public/src/modules/settings/array.js
index 81071a65fa..fd94ed8226 100644
--- a/public/src/modules/settings/array.js
+++ b/public/src/modules/settings/array.js
@@ -107,7 +107,7 @@ define('settings/array', function () {
} catch (_error) {
return $(document.createTextNode(separator));
}
- })();
+ }());
if (typeof attributes !== 'object') {
attributes = {};
}
diff --git a/public/src/modules/settings/object.js b/public/src/modules/settings/object.js
index 8c7a53f99a..05971d6d73 100644
--- a/public/src/modules/settings/object.js
+++ b/public/src/modules/settings/object.js
@@ -69,7 +69,7 @@ define('settings/object', function () {
} catch (_error) {
return $(document.createTextNode(separator));
}
- })();
+ }());
element.empty();
if (typeof value !== 'object') {
value = {};
diff --git a/public/src/modules/translator.js b/public/src/modules/translator.js
index 08525702d5..65a92772e5 100644
--- a/public/src/modules/translator.js
+++ b/public/src/modules/translator.js
@@ -29,16 +29,16 @@
}
module.exports = factory(require('string'), loadServer);
- })();
+ }());
} else {
window.translator = factory(window.string, loadClient);
}
-})(function (string, load) {
+}(function (string, load) {
'use strict';
var assign = Object.assign || jQuery.extend;
function classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var Translator = function () {
+ var Translator = (function () {
/**
* Construct a new Translator object
* @param {string} language - Language code for this translator instance
@@ -305,7 +305,7 @@
Translator.cache = {};
return Translator;
- }();
+ }());
var adaptor = {
/**
@@ -453,4 +453,4 @@
};
return adaptor;
-});
+}));
diff --git a/public/src/overrides.js b/public/src/overrides.js
index 49dce7e754..ba4ab2745f 100644
--- a/public/src/overrides.js
+++ b/public/src/overrides.js
@@ -86,7 +86,7 @@ if ('undefined' !== typeof window) {
});
}
});
- })(jQuery || {fn:{}});
+ }(jQuery || {fn:{}}));
(function(){
// FIX FOR #1245 - https://github.com/NodeBB/NodeBB/issues/1245
@@ -109,7 +109,7 @@ if ('undefined' !== typeof window) {
_clearMenus();
}
});
- })();
+ }());
overrides.overrideBootbox = function () {
require(['translator'], function(translator) {
diff --git a/public/src/utils.js b/public/src/utils.js
index 190d0ab3c6..989a9506a6 100644
--- a/public/src/utils.js
+++ b/public/src/utils.js
@@ -478,8 +478,8 @@
window.utils = module.exports;
}
-})('undefined' === typeof module ? {
+}('undefined' === typeof module ? {
module: {
exports: {}
}
-} : module);
+} : module));
diff --git a/src/password.js b/src/password.js
index 20f4c79a95..8b9fbb33a6 100644
--- a/src/password.js
+++ b/src/password.js
@@ -30,4 +30,4 @@
}
return module;
-})(exports);
\ No newline at end of file
+}(exports));
\ No newline at end of file
diff --git a/src/socket.io/index.js b/src/socket.io/index.js
index d3393ea2d2..dedf6aab8e 100644
--- a/src/socket.io/index.js
+++ b/src/socket.io/index.js
@@ -224,4 +224,4 @@ var ratelimit = require('../middleware/ratelimit');
};
};
-})(exports);
+}(exports));