From 8e23dec84b11a5dd9cb098ae3d6b3518bcbdaa8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 1 Apr 2020 21:57:28 -0400 Subject: [PATCH] fix: lint --- src/groups/delete.js | 2 +- src/groups/search.js | 2 +- src/meta/build.js | 2 +- src/meta/configs.js | 2 +- src/meta/settings.js | 2 +- src/meta/sounds.js | 2 +- src/meta/tags.js | 2 +- src/meta/themes.js | 2 +- src/middleware/index.js | 2 +- src/socket.io/admin.js | 2 +- src/upgrade.js | 2 +- src/user/digest.js | 2 +- src/user/email.js | 2 +- src/user/info.js | 3 +-- src/user/invite.js | 2 +- src/user/notifications.js | 2 +- src/user/reset.js | 2 +- test/utils.js | 2 +- 18 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/groups/delete.js b/src/groups/delete.js index 573ea389aa..ecdb50469c 100644 --- a/src/groups/delete.js +++ b/src/groups/delete.js @@ -2,7 +2,7 @@ const plugins = require('../plugins'); const utils = require('../utils'); -const db = require('./../database'); +const db = require('../database'); const batch = require('../batch'); module.exports = function (Groups) { diff --git a/src/groups/search.js b/src/groups/search.js index a19c6ea253..7247efbd4d 100644 --- a/src/groups/search.js +++ b/src/groups/search.js @@ -1,7 +1,7 @@ 'use strict'; const user = require('../user'); -const db = require('./../database'); +const db = require('../database'); module.exports = function (Groups) { Groups.search = async function (query, options) { diff --git a/src/meta/build.js b/src/meta/build.js index f9370d1b9f..a6315edeeb 100644 --- a/src/meta/build.js +++ b/src/meta/build.js @@ -105,7 +105,7 @@ function beforeBuild(targets, callback) { db.init(next); }, function (next) { - meta = require('../meta'); + meta = require('./index'); meta.themes.setupPaths(next); }, function (next) { diff --git a/src/meta/configs.js b/src/meta/configs.js index d6379fc1e6..c28d3e2ff8 100644 --- a/src/meta/configs.js +++ b/src/meta/configs.js @@ -8,7 +8,7 @@ const util = require('util'); const db = require('../database'); const pubsub = require('../pubsub'); -const Meta = require('../meta'); +const Meta = require('./index'); const cacheBuster = require('./cacheBuster'); const defaults = require('../../install/data/defaults'); diff --git a/src/meta/settings.js b/src/meta/settings.js index a5cc59bbe3..a80c948899 100644 --- a/src/meta/settings.js +++ b/src/meta/settings.js @@ -2,7 +2,7 @@ const db = require('../database'); const plugins = require('../plugins'); -const Meta = require('../meta'); +const Meta = require('./index'); const pubsub = require('../pubsub'); const Settings = module.exports; diff --git a/src/meta/sounds.js b/src/meta/sounds.js index 3c6fb6eff3..b185743db9 100644 --- a/src/meta/sounds.js +++ b/src/meta/sounds.js @@ -15,7 +15,7 @@ const writeFileAsync = util.promisify(fs.writeFile); const file = require('../file'); const plugins = require('../plugins'); const user = require('../user'); -const Meta = require('../meta'); +const Meta = require('./index'); const soundsPath = path.join(__dirname, '../../build/public/sounds'); const uploadsPath = path.join(__dirname, '../../public/uploads/sounds'); diff --git a/src/meta/tags.js b/src/meta/tags.js index d6a01889b9..4044326079 100644 --- a/src/meta/tags.js +++ b/src/meta/tags.js @@ -4,7 +4,7 @@ const nconf = require('nconf'); const winston = require('winston'); const plugins = require('../plugins'); -const Meta = require('../meta'); +const Meta = require('./index'); const utils = require('../utils'); const Tags = module.exports; diff --git a/src/meta/themes.js b/src/meta/themes.js index 1499c83c8b..1450c46365 100644 --- a/src/meta/themes.js +++ b/src/meta/themes.js @@ -14,7 +14,7 @@ const fsReadfile = util.promisify(fs.readFile); const file = require('../file'); const db = require('../database'); -const Meta = require('../meta'); +const Meta = require('./index'); const events = require('../events'); const utils = require('../../public/src/utils'); diff --git a/src/middleware/index.js b/src/middleware/index.js index 9722c42690..107411dfc2 100644 --- a/src/middleware/index.js +++ b/src/middleware/index.js @@ -17,7 +17,7 @@ var analytics = require('../analytics'); var privileges = require('../privileges'); var controllers = { - api: require('./../controllers/api'), + api: require('../controllers/api'), helpers: require('../controllers/helpers'), }; diff --git a/src/socket.io/admin.js b/src/socket.io/admin.js index 05c6c975b8..2c06be484c 100644 --- a/src/socket.io/admin.js +++ b/src/socket.io/admin.js @@ -6,7 +6,7 @@ const meta = require('../meta'); const user = require('../user'); const events = require('../events'); const db = require('../database'); -const websockets = require('../socket.io/index'); +const websockets = require('./index'); const index = require('./index'); const getAdminSearchDict = require('../admin/search').getDictionary; diff --git a/src/upgrade.js b/src/upgrade.js index 7975a9ba6d..73d489bcba 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -7,7 +7,7 @@ var readline = require('readline'); var winston = require('winston'); var db = require('./database'); -var file = require('../src/file'); +var file = require('./file'); /* * Need to write an upgrade script for NodeBB? Cool. diff --git a/src/user/digest.js b/src/user/digest.js index b0051a9977..cebabccf29 100644 --- a/src/user/digest.js +++ b/src/user/digest.js @@ -7,7 +7,7 @@ const nconf = require('nconf'); const db = require('../database'); const batch = require('../batch'); const meta = require('../meta'); -const user = require('../user'); +const user = require('./index'); const topics = require('../topics'); const plugins = require('../plugins'); const emailer = require('../emailer'); diff --git a/src/user/email.js b/src/user/email.js index 1a76974c59..9e75a40f48 100644 --- a/src/user/email.js +++ b/src/user/email.js @@ -3,7 +3,7 @@ var nconf = require('nconf'); -var user = require('../user'); +var user = require('./index'); var utils = require('../utils'); var plugins = require('../plugins'); var db = require('../database'); diff --git a/src/user/info.js b/src/user/info.js index 9eb2268355..29687ad726 100644 --- a/src/user/info.js +++ b/src/user/info.js @@ -4,7 +4,6 @@ var _ = require('lodash'); var validator = require('validator'); var db = require('../database'); -var user = require('../user'); var posts = require('../posts'); var topics = require('../topics'); var utils = require('../../public/src/utils'); @@ -97,7 +96,7 @@ module.exports = function (User) { async function formatBanData(bans) { const banData = await db.getObjects(bans); const uids = banData.map(banData => banData.fromUid); - const usersData = await user.getUsersFields(uids, ['uid', 'username', 'userslug', 'picture']); + const usersData = await User.getUsersFields(uids, ['uid', 'username', 'userslug', 'picture']); return banData.map(function (banObj, index) { banObj.user = usersData[index]; banObj.until = parseInt(banObj.expire, 10); diff --git a/src/user/invite.js b/src/user/invite.js index 8b742263b6..2b0b217cd2 100644 --- a/src/user/invite.js +++ b/src/user/invite.js @@ -5,7 +5,7 @@ var async = require('async'); var nconf = require('nconf'); var validator = require('validator'); -var db = require('./../database'); +var db = require('../database'); var meta = require('../meta'); var emailer = require('../emailer'); var translator = require('../translator'); diff --git a/src/user/notifications.js b/src/user/notifications.js index 4bf159196b..fa30b0e2e1 100644 --- a/src/user/notifications.js +++ b/src/user/notifications.js @@ -222,7 +222,7 @@ UserNotifications.sendNameChangeNotification = async function (uid, username) { }; UserNotifications.pushCount = async function (uid) { - const websockets = require('./../socket.io'); + const websockets = require('../socket.io'); const count = await UserNotifications.getUnreadCount(uid); websockets.in('uid_' + uid).emit('event:notifications.updateCount', count); }; diff --git a/src/user/reset.js b/src/user/reset.js index 00baf982b8..d8765b9401 100644 --- a/src/user/reset.js +++ b/src/user/reset.js @@ -3,7 +3,7 @@ var nconf = require('nconf'); var winston = require('winston'); -var user = require('../user'); +var user = require('./index'); var utils = require('../utils'); var batch = require('../batch'); diff --git a/test/utils.js b/test/utils.js index 7ba317d0f2..5349418816 100644 --- a/test/utils.js +++ b/test/utils.js @@ -3,7 +3,7 @@ var assert = require('assert'); var JSDOM = require('jsdom').JSDOM; -var utils = require('./../public/src/utils.js'); +var utils = require('../public/src/utils.js'); const db = require('./mocks/databasemock'); describe('Utility Methods', function () {