Browse Source

chore(linting): fixed linting errors created with airbnb
errors still exist and some solutions are temporary

Signed-off-by: Jonathan <theflametrooper@gmail.com>

Jonathan 5 years ago
parent
commit
d76d8db6b8
53 changed files with 900 additions and 732 deletions
  1. 7 1
      frontend/.eslintrc
  2. 11 11
      frontend/App.vue
  3. 19 18
      frontend/api/auth.js
  4. 7 7
      frontend/auth.js
  5. 108 66
      frontend/components/Admin/EditStation.vue
  6. 22 20
      frontend/components/Admin/News.vue
  7. 9 9
      frontend/components/Admin/Punishments.vue
  8. 18 16
      frontend/components/Admin/QueueSongs.vue
  9. 6 6
      frontend/components/Admin/Reports.vue
  10. 13 13
      frontend/components/Admin/Songs.vue
  11. 26 22
      frontend/components/Admin/Stations.vue
  12. 6 6
      frontend/components/Admin/Statistics.vue
  13. 5 5
      frontend/components/Admin/Users.vue
  14. 1 1
      frontend/components/MainFooter.vue
  15. 9 3
      frontend/components/MainHeader.vue
  16. 13 12
      frontend/components/Modals/AddSongToPlaylist.vue
  17. 19 20
      frontend/components/Modals/AddSongToQueue.vue
  18. 15 12
      frontend/components/Modals/CreateCommunityStation.vue
  19. 4 3
      frontend/components/Modals/EditNews.vue
  20. 89 61
      frontend/components/Modals/EditSong.vue
  21. 89 59
      frontend/components/Modals/EditStation.vue
  22. 18 15
      frontend/components/Modals/EditUser.vue
  23. 1 1
      frontend/components/Modals/IssuesModal.vue
  24. 5 5
      frontend/components/Modals/Login.vue
  25. 4 4
      frontend/components/Modals/MobileAlert.vue
  26. 1 1
      frontend/components/Modals/Modal.vue
  27. 5 5
      frontend/components/Modals/Playlists/Create.vue
  28. 49 50
      frontend/components/Modals/Playlists/Edit.vue
  29. 6 6
      frontend/components/Modals/Register.vue
  30. 12 12
      frontend/components/Modals/Report.vue
  31. 6 3
      frontend/components/Modals/ViewPunishment.vue
  32. 6 8
      frontend/components/Modals/WhatIsNew.vue
  33. 9 9
      frontend/components/Sidebars/Playlist.vue
  34. 7 7
      frontend/components/Sidebars/SongsList.vue
  35. 10 4
      frontend/components/Station/CommunityHeader.vue
  36. 10 4
      frontend/components/Station/OfficialHeader.vue
  37. 109 101
      frontend/components/Station/Station.vue
  38. 16 12
      frontend/components/User/ResetPassword.vue
  39. 32 28
      frontend/components/User/Settings.vue
  40. 5 5
      frontend/components/User/Show.vue
  41. 2 2
      frontend/components/UserIdToUsername.vue
  42. 1 1
      frontend/components/pages/About.vue
  43. 2 2
      frontend/components/pages/Admin.vue
  44. 45 42
      frontend/components/pages/Home.vue
  45. 3 3
      frontend/components/pages/News.vue
  46. 23 25
      frontend/io.js
  47. 3 2
      frontend/main.js
  48. 2 0
      frontend/store/modules/admin.js
  49. 2 0
      frontend/store/modules/modals.js
  50. 2 0
      frontend/store/modules/station.js
  51. 6 2
      frontend/store/modules/user.js
  52. 1 1
      frontend/webpack.common.js
  53. 1 1
      frontend/webpack.dev.js

+ 7 - 1
frontend/.eslintrc

@@ -27,6 +27,12 @@
 	"rules": {
 		"no-console": 0,
 		"no-control-regex": 0,
-		"no-var": 2
+		"no-var": 2,
+		"no-underscore-dangle": 1,
+		"prefer-promise-reject-errors": 0, // temp
+		"no-nested-ternary": 0, // temp
+		"radix": 0,
+		"no-multi-assign": 0,
+		"no-shadow": 0
 	}
 }

+ 11 - 11
frontend/App.vue

@@ -48,24 +48,24 @@ export default {
 		currentlyActive: state => state.modals.currentlyActive
 	}),
 	methods: {
-		logout: function() {
-			let _this = this;
+		logout() {
+			const _this = this;
 			_this.socket.emit("users.logout", result => {
 				if (result.status === "success") {
 					document.cookie =
 						"SID=;expires=Thu, 01 Jan 1970 00:00:01 GMT;";
-					location.reload();
+					window.location.reload();
 				} else Toast.methods.addToast(result.message, 4000);
 			});
 		},
 		submitOnEnter: (cb, event) => {
-			if (event.which == 13) cb();
+			if (event.which === 13) cb();
 		},
 		...mapActions("modals", ["closeCurrentModal"])
 	},
-	mounted: function() {
-		document.onkeydown = event => {
-			event = event || window.event;
+	mounted() {
+		document.onkeydown = ev => {
+			const event = ev || window.event;
 			if (
 				event.keyCode === 27 &&
 				Object.keys(this.currentlyActive).length !== 0
@@ -73,7 +73,7 @@ export default {
 				this.closeCurrentModal();
 		};
 
-		let _this = this;
+		const _this = this;
 		if (localStorage.getItem("github_redirect")) {
 			this.$router.go(localStorage.getItem("github_redirect"));
 			localStorage.removeItem("github_redirect");
@@ -103,7 +103,7 @@ export default {
 		});
 		_this.$router.onReady(() => {
 			if (_this.$route.query.err) {
-				let err = _this.$route.query.err;
+				let { err } = _this.$route.query;
 				err = err
 					.replace(new RegExp("<", "g"), "&lt;")
 					.replace(new RegExp(">", "g"), "&gt;");
@@ -111,7 +111,7 @@ export default {
 				Toast.methods.addToast(err, 20000);
 			}
 			if (_this.$route.query.msg) {
-				let msg = _this.$route.query.msg;
+				let { msg } = _this.$route.query;
 				msg = msg
 					.replace(new RegExp("<", "g"), "&lt;")
 					.replace(new RegExp(">", "g"), "&gt;");
@@ -121,7 +121,7 @@ export default {
 		});
 		io.getSocket(true, socket => {
 			socket.on("keep.event:user.session.removed", () => {
-				location.reload();
+				window.location.reload();
 			});
 		});
 	},

+ 19 - 18
frontend/api/auth.js

@@ -17,13 +17,13 @@ export default {
 					res => {
 						if (res.status === "success") {
 							if (res.SID) {
-								lofig.get("cookie", cookie => {
-									let date = new Date();
+								return lofig.get("cookie", cookie => {
+									const date = new Date();
 									date.setTime(
 										new Date().getTime() +
 											2 * 365 * 24 * 60 * 60 * 1000
 									);
-									let secure = cookie.secure
+									const secure = cookie.secure
 										? "secure=true; "
 										: "";
 									document.cookie = `SID=${
@@ -31,18 +31,19 @@ export default {
 									}; expires=${date.toGMTString()}; domain=${
 										cookie.domain
 									}; ${secure}path=/`;
+
 									return resolve({ status: "success" });
 								});
-							} else
-								return reject({
-									status: "error",
-									message: "You must login"
-								});
-						} else
+							}
 							return reject({
 								status: "error",
-								message: res.message
+								message: "You must login"
 							});
+						}
+						return reject({
+							status: "error",
+							message: res.message
+						});
 					}
 				);
 			});
@@ -55,13 +56,13 @@ export default {
 			io.getSocket(socket => {
 				socket.emit("users.login", email, password, res => {
 					if (res.status === "success") {
-						lofig.get("cookie", cookie => {
-							let date = new Date();
+						return lofig.get("cookie", cookie => {
+							const date = new Date();
 							date.setTime(
 								new Date().getTime() +
 									2 * 365 * 24 * 60 * 60 * 1000
 							);
-							let secure = cookie.secure ? "secure=true; " : "";
+							const secure = cookie.secure ? "secure=true; " : "";
 							let domain = "";
 							if (cookie.domain !== "localhost")
 								domain = ` domain=${cookie.domain};`;
@@ -70,11 +71,11 @@ export default {
 							}; expires=${date.toGMTString()}; ${domain}${secure}path=/`;
 							return resolve({ status: "success" });
 						});
-					} else
-						return reject({
-							status: "error",
-							message: res.message
-						});
+					}
+					return reject({
+						status: "error",
+						message: res.message
+					});
 				});
 			});
 		});

+ 7 - 7
frontend/auth.js

@@ -1,5 +1,5 @@
 let callbacks = [];
-let bannedCallbacks = [];
+const bannedCallbacks = [];
 
 export default {
 	ready: false,
@@ -10,14 +10,14 @@ export default {
 	banned: null,
 	ban: {},
 
-	getStatus: function(cb) {
+	getStatus(cb) {
 		if (this.ready)
 			cb(this.authenticated, this.role, this.username, this.userId);
 		else callbacks.push(cb);
 	},
 
-	setBanned: function(ban) {
-		let _this = this;
+	setBanned(ban) {
+		const _this = this;
 		_this.banned = true;
 		_this.ban = ban;
 		bannedCallbacks.forEach(callback => {
@@ -25,13 +25,13 @@ export default {
 		});
 	},
 
-	isBanned: function(cb) {
+	isBanned(cb) {
 		if (this.ready) return cb(false);
 		if (!this.ready && this.banned === true) return cb(true, this.ban);
-		bannedCallbacks.push(cb);
+		return bannedCallbacks.push(cb);
 	},
 
-	data: function(authenticated, role, username, userId) {
+	data(authenticated, role, username, userId) {
 		this.authenticated = authenticated;
 		this.role = role;
 		this.username = username;

+ 108 - 66
frontend/components/Admin/EditStation.vue

@@ -162,12 +162,15 @@ export default {
 		station: state => state.station,
 		editing: state => state.editing
 	}),
-	mounted: function() {
-		let _this = this;
-		io.getSocket(socket => (_this.socket = socket));
+	mounted() {
+		const _this = this;
+		io.getSocket(socket => {
+			_this.socket = socket;
+			return socket;
+		});
 	},
 	methods: {
-		update: function() {
+		update() {
 			if (this.station.name !== this.editing.name) this.updateName();
 			if (this.station.displayName !== this.editing.displayName)
 				this.updateDisplayName();
@@ -188,8 +191,8 @@ export default {
 			)
 				this.updateBlacklistedGenres();
 		},
-		updateName: function() {
-			const name = this.editing.name;
+		updateName() {
+			const { name } = this.editing;
 			if (!validation.isLength(name, 2, 16))
 				return Toast.methods.addToast(
 					"Name must have between 2 and 16 characters.",
@@ -201,7 +204,7 @@ export default {
 					8000
 				);
 
-			this.socket.emit(
+			return this.socket.emit(
 				"stations.updateName",
 				this.editing._id,
 				name,
@@ -209,18 +212,20 @@ export default {
 					if (res.status === "success") {
 						if (this.station) this.station.name = name;
 						this.$parent.stations.forEach((station, index) => {
-							if (station._id === this.editing._id)
-								return (this.$parent.stations[
-									index
-								].name = name);
+							if (station._id === this.editing._id) {
+								this.$parent.stations[index].name = name;
+								return name;
+							}
+
+							return false;
 						});
 					}
 					Toast.methods.addToast(res.message, 8000);
 				}
 			);
 		},
-		updateDisplayName: function() {
-			const displayName = this.editing.displayName;
+		updateDisplayName() {
+			const { displayName } = this.editing;
 			if (!validation.isLength(displayName, 2, 32))
 				return Toast.methods.addToast(
 					"Display name must have between 2 and 32 characters.",
@@ -232,29 +237,36 @@ export default {
 					8000
 				);
 
-			this.socket.emit(
+			return this.socket.emit(
 				"stations.updateDisplayName",
 				this.editing._id,
 				displayName,
 				res => {
 					if (res.status === "success") {
-						if (this.station)
+						if (this.station) {
 							this.station.displayName = displayName;
+							return displayName;
+						}
 						this.$parent.stations.forEach((station, index) => {
-							if (station._id === this.editing._id)
-								return (this.$parent.stations[
+							if (station._id === this.editing._id) {
+								this.$parent.stations[
 									index
-								].displayName = displayName);
+								].displayName = displayName;
+								return displayName;
+							}
+
+							return false;
 						});
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 			);
 		},
-		updateDescription: function() {
-			let _this = this;
+		updateDescription() {
+			const _this = this;
 
-			const description = this.editing.description;
+			const { description } = this.editing;
 			if (!validation.isLength(description, 2, 200))
 				return Toast.methods.addToast(
 					"Description must have between 2 and 200 characters.",
@@ -270,28 +282,36 @@ export default {
 					8000
 				);
 
-			this.socket.emit(
+			return this.socket.emit(
 				"stations.updateDescription",
 				this.editing._id,
 				description,
 				res => {
 					if (res.status === "success") {
-						if (_this.station)
+						if (_this.station) {
 							_this.station.description = description;
+							return description;
+						}
 						_this.$parent.stations.forEach((station, index) => {
-							if (station._id === station._id)
-								return (_this.$parent.stations[
+							if (station._id === _this.editing._id) {
+								_this.$parent.stations[
 									index
-								].description = description);
+								].description = description;
+								return description;
+							}
+
+							return false;
 						});
+
 						return Toast.methods.addToast(res.message, 4000);
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 			);
 		},
-		updatePrivacy: function() {
-			let _this = this;
+		updatePrivacy() {
+			const _this = this;
 			this.socket.emit(
 				"stations.updatePrivacy",
 				this.editing._id,
@@ -302,69 +322,81 @@ export default {
 							_this.station.privacy = _this.editing.privacy;
 						else {
 							_this.$parent.stations.forEach((station, index) => {
-								if (station._id === station._id)
-									return (_this.$parent.stations[
-										index
-									].privacy = _this.editing.privacy);
+								if (station._id === _this.editing._id) {
+									_this.$parent.stations[index].privacy =
+										_this.editing.privacy;
+									return _this.editing.privacy;
+								}
+
+								return false;
 							});
 						}
 						return Toast.methods.addToast(res.message, 4000);
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 			);
 		},
-		updateGenres: function() {
-			let _this = this;
+		updateGenres() {
+			const _this = this;
 			this.socket.emit(
 				"stations.updateGenres",
 				this.editing._id,
 				this.editing.genres,
 				res => {
 					if (res.status === "success") {
-						let genres = JSON.parse(
+						const genres = JSON.parse(
 							JSON.stringify(_this.editing.genres)
 						);
 						if (_this.station) _this.station.genres = genres;
 						_this.$parent.stations.forEach((station, index) => {
-							if (station._id === station._id)
-								return (_this.$parent.stations[
-									index
-								].genres = genres);
+							if (station._id === _this.editing._id) {
+								_this.$parent.stations[index].genres = genres;
+								return genres;
+							}
+
+							return false;
 						});
 						return Toast.methods.addToast(res.message, 4000);
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 			);
 		},
-		updateBlacklistedGenres: function() {
-			let _this = this;
+		updateBlacklistedGenres() {
+			const _this = this;
 			this.socket.emit(
 				"stations.updateBlacklistedGenres",
 				this.editing._id,
 				this.editing.blacklistedGenres,
 				res => {
 					if (res.status === "success") {
-						let blacklistedGenres = JSON.parse(
+						const blacklistedGenres = JSON.parse(
 							JSON.stringify(_this.editing.blacklistedGenres)
 						);
 						if (_this.station)
 							_this.station.blacklistedGenres = blacklistedGenres;
 						_this.$parent.stations.forEach((station, index) => {
-							if (station._id === station._id)
-								return (_this.$parent.stations[
+							if (station._id === _this.editing._id) {
+								_this.$parent.stations[
 									index
-								].blacklistedGenres = blacklistedGenres);
+								].blacklistedGenres = blacklistedGenres;
+								return blacklistedGenres;
+							}
+
+							return false;
 						});
 						return Toast.methods.addToast(res.message, 4000);
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 			);
 		},
-		updatePartyMode: function() {
-			let _this = this;
+		updatePartyMode() {
+			const _this = this;
 			this.socket.emit(
 				"stations.updatePartyMode",
 				this.editing._id,
@@ -374,34 +406,42 @@ export default {
 						if (_this.station)
 							_this.station.partyMode = _this.editing.partyMode;
 						_this.$parent.stations.forEach((station, index) => {
-							if (station._id === station._id)
-								return (_this.$parent.stations[
-									index
-								].partyMode = _this.editing.partyMode);
+							if (station._id === _this.editing._id) {
+								_this.$parent.stations[index].partyMode =
+									_this.editing.partyMode;
+								return _this.editing.partyMode;
+							}
+
+							return false;
 						});
+
 						return Toast.methods.addToast(res.message, 4000);
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 			);
 		},
-		addGenre: function() {
-			let genre = document
+		addGenre() {
+			const genre = document
 				.getElementById(`new-genre-edit`)
 				.value.toLowerCase()
 				.trim();
+
 			if (this.editing.genres.indexOf(genre) !== -1)
 				return Toast.methods.addToast("Genre already exists", 3000);
 			if (genre) {
 				this.editing.genres.push(genre);
 				document.getElementById(`new-genre`).value = "";
-			} else Toast.methods.addToast("Genre cannot be empty", 3000);
+				return true;
+			}
+			return Toast.methods.addToast("Genre cannot be empty", 3000);
 		},
-		removeGenre: function(index) {
+		removeGenre(index) {
 			this.editing.genres.splice(index, 1);
 		},
-		addBlacklistedGenre: function() {
-			let genre = document
+		addBlacklistedGenre() {
+			const genre = document
 				.getElementById(`new-blacklisted-genre-edit`)
 				.value.toLowerCase()
 				.trim();
@@ -411,12 +451,14 @@ export default {
 			if (genre) {
 				this.editing.blacklistedGenres.push(genre);
 				document.getElementById(`new-blacklisted-genre`).value = "";
-			} else Toast.methods.addToast("Genre cannot be empty", 3000);
+				return true;
+			}
+			return Toast.methods.addToast("Genre cannot be empty", 3000);
 		},
-		removeBlacklistedGenre: function(index) {
+		removeBlacklistedGenre(index) {
 			this.editing.blacklistedGenres.splice(index, 1);
 		},
-		deleteStation: function() {
+		deleteStation() {
 			this.socket.emit("stations.remove", this.editing._id, res => {
 				Toast.methods.addToast(res.message, 8000);
 			});

+ 22 - 20
frontend/components/Admin/News.vue

@@ -235,14 +235,14 @@ export default {
 			editing: {}
 		};
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
-			_this.socket.emit(
-				"news.index",
-				result => (_this.news = result.data)
-			);
+			_this.socket.emit("news.index", res => {
+				_this.news = res.data;
+				return res.data;
+			});
 			_this.socket.on("event:admin.news.created", news => {
 				_this.news.unshift(news);
 			});
@@ -259,10 +259,10 @@ export default {
 		})
 	},
 	methods: {
-		createNews: function() {
-			let _this = this;
+		createNews() {
+			const _this = this;
 
-			let {
+			const {
 				creating: { bugs, features, improvements, upcoming }
 			} = this;
 
@@ -287,9 +287,9 @@ export default {
 					3000
 				);
 
-			_this.socket.emit("news.create", _this.creating, result => {
+			return _this.socket.emit("news.create", _this.creating, result => {
 				Toast.methods.addToast(result.message, 4000);
-				if (result.status == "success")
+				if (result.status === "success")
 					_this.creating = {
 						title: "",
 						description: "",
@@ -300,17 +300,17 @@ export default {
 					};
 			});
 		},
-		removeNews: function(news) {
+		removeNews(news) {
 			this.socket.emit("news.remove", news, res =>
 				Toast.methods.addToast(res.message, 8000)
 			);
 		},
-		editNews: function(news) {
+		editNews(news) {
 			this.editing = news;
 			this.openModal({ sector: "admin", modal: "editNews" });
 		},
-		updateNews: function(close) {
-			let _this = this;
+		updateNews(close) {
+			const _this = this;
 			this.socket.emit(
 				"news.update",
 				_this.editing._id,
@@ -327,8 +327,8 @@ export default {
 				}
 			);
 		},
-		addChange: function(type) {
-			let change = document.getElementById(`new-${type}`).value.trim();
+		addChange(type) {
+			const change = document.getElementById(`new-${type}`).value.trim();
 
 			if (this.creating[type].indexOf(change) !== -1)
 				return Toast.methods.addToast(`Tag already exists`, 3000);
@@ -336,12 +336,14 @@ export default {
 			if (change) {
 				document.getElementById(`new-${type}`).value = "";
 				this.creating[type].push(change);
-			} else Toast.methods.addToast(`${type} cannot be empty`, 3000);
+				return true;
+			}
+			return Toast.methods.addToast(`${type} cannot be empty`, 3000);
 		},
-		removeChange: function(type, index) {
+		removeChange(type, index) {
 			this.creating[type].splice(index, 1);
 		},
-		init: function() {
+		init() {
 			this.socket.emit("apis.joinAdminRoom", "news", () => {});
 		},
 		...mapActions("modals", ["openModal", "closeModal"])

+ 9 - 9
frontend/components/Admin/Punishments.vue

@@ -128,7 +128,7 @@ export default {
 		};
 	},
 	computed: {
-		sortedPunishments: function() {
+		sortedPunishments() {
 			//   return _.orderBy(this.punishments, -1);
 			return this.punishments;
 		},
@@ -137,12 +137,12 @@ export default {
 		})
 	},
 	methods: {
-		view: function(punishment) {
+		view(punishment) {
 			this.viewPunishment(punishment);
 			this.openModal({ sector: "admin", modal: "viewPunishment" });
 		},
-		banIP: function() {
-			let _this = this;
+		banIP() {
+			const _this = this;
 			_this.socket.emit(
 				"punishments.banIP",
 				_this.ipBan.ip,
@@ -153,18 +153,18 @@ export default {
 				}
 			);
 		},
-		init: function() {
-			let _this = this;
+		init() {
+			const _this = this;
 			_this.socket.emit("punishments.index", res => {
 				if (res.status === "success") _this.punishments = res.data;
 			});
-			//_this.socket.emit('apis.joinAdminRoom', 'punishments', () => {});
+			// _this.socket.emit('apis.joinAdminRoom', 'punishments', () => {});
 		},
 		...mapActions("modals", ["openModal"]),
 		...mapActions("admin/punishments", ["viewPunishment"])
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 			if (_this.socket.connected) _this.init();

+ 18 - 16
frontend/components/Admin/QueueSongs.vue

@@ -121,7 +121,7 @@ export default {
 		};
 	},
 	computed: {
-		filteredSongs: function() {
+		filteredSongs() {
 			return this.songs;
 			// return this.songs.filter(song => song.indexOf(song.searchQuery) !== -1);
 		},
@@ -136,36 +136,38 @@ export default {
 	//   }
 	// },
 	methods: {
-		getSet: function(position) {
-			let _this = this;
+		getSet(position) {
+			const _this = this;
 			this.socket.emit("queueSongs.getSet", position, data => {
 				_this.songs = data;
 				this.position = position;
 			});
 		},
-		edit: function(song, index) {
-			let newSong = {};
-			for (let n in song) newSong[n] = song[n];
+		edit(song, index) {
+			const newSong = {};
+			Object.keys(song).forEach(n => {
+				newSong[n] = song[n];
+			});
 
 			this.editSong({ index, song: newSong, type: "queueSongs" });
 			this.openModal({ sector: "admin", modal: "editSong" });
 		},
-		add: function(song) {
+		add(song) {
 			this.socket.emit("songs.add", song, res => {
-				if (res.status == "success")
+				if (res.status === "success")
 					Toast.methods.addToast(res.message, 2000);
 				else Toast.methods.addToast(res.message, 4000);
 			});
 		},
-		remove: function(id) {
+		remove(id) {
 			this.socket.emit("queueSongs.remove", id, res => {
-				if (res.status == "success")
+				if (res.status === "success")
 					Toast.methods.addToast(res.message, 2000);
 				else Toast.methods.addToast(res.message, 4000);
 			});
 		},
-		init: function() {
-			let _this = this;
+		init() {
+			const _this = this;
 			_this.socket.emit("queueSongs.index", data => {
 				_this.songs = data.songs;
 				_this.maxPosition = Math.round(data.maxLength / 50);
@@ -175,8 +177,8 @@ export default {
 		...mapActions("admin/songs", ["stopVideo", "editSong"]),
 		...mapActions("modals", ["openModal"])
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 			if (_this.socket.connected) {
@@ -192,8 +194,8 @@ export default {
 				_this.socket.on(
 					"event:admin.queueSong.updated",
 					updatedSong => {
-						for (let i = 0; i < _this.songs.length; i++) {
-							let song = _this.songs[i];
+						for (let i = 0; i < _this.songs.length; i += 1) {
+							const song = _this.songs[i];
 							if (song._id === updatedSong._id) {
 								_this.songs.$set(i, updatedSong);
 							}

+ 6 - 6
frontend/components/Admin/Reports.vue

@@ -67,8 +67,8 @@ export default {
 			reports: []
 		};
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 			if (_this.socket.connected) _this.init();
@@ -105,15 +105,15 @@ export default {
 		})
 	},
 	methods: {
-		init: function() {
+		init() {
 			this.socket.emit("apis.joinAdminRoom", "reports", () => {});
 		},
-		view: function(report) {
+		view(report) {
 			this.viewReport(report);
 			this.openModal({ sector: "admin", modal: "viewReport" });
 		},
-		resolve: function(reportId) {
-			let _this = this;
+		resolve(reportId) {
+			const _this = this;
 			this.socket.emit("reports.resolve", reportId, res => {
 				Toast.methods.addToast(res.message, 3000);
 				if (res.status === "success" && this.modals.viewReport)

+ 13 - 13
frontend/components/Admin/Songs.vue

@@ -101,7 +101,7 @@ export default {
 		};
 	},
 	computed: {
-		filteredSongs: function() {
+		filteredSongs() {
 			return this.songs;
 			// return this.songs.filter(song => song.indexOf(song.searchQuery) !== -1);
 		},
@@ -115,29 +115,29 @@ export default {
 		}
 	},
 	methods: {
-		edit: function(song) {
+		edit(song) {
 			this.editSong({ song, type: "songs" });
 			this.openModal({ sector: "admin", modal: "editSong" });
 		},
-		remove: function(id) {
+		remove(id) {
 			this.socket.emit("songs.remove", id, res => {
-				if (res.status == "success")
+				if (res.status === "success")
 					Toast.methods.addToast(res.message, 4000);
 				else Toast.methods.addToast(res.message, 8000);
 			});
 		},
-		getSet: function() {
-			let _this = this;
+		getSet() {
+			const _this = this;
 			_this.socket.emit("songs.getSet", _this.position, data => {
 				data.forEach(song => {
 					_this.songs.push(song);
 				});
-				_this.position = _this.position + 1;
+				_this.position += 1;
 				if (_this.maxPosition > _this.position - 1) _this.getSet();
 			});
 		},
-		init: function() {
-			let _this = this;
+		init() {
+			const _this = this;
 			_this.songs = [];
 			_this.socket.emit("songs.length", length => {
 				_this.maxPosition = Math.ceil(length / 15);
@@ -148,8 +148,8 @@ export default {
 		...mapActions("admin/songs", ["stopVideo", "editSong"]),
 		...mapActions("modals", ["openModal", "closeModal"])
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 			if (_this.socket.connected) {
@@ -163,8 +163,8 @@ export default {
 					});
 				});
 				_this.socket.on("event:admin.song.updated", updatedSong => {
-					for (let i = 0; i < _this.songs.length; i++) {
-						let song = _this.songs[i];
+					for (let i = 0; i < _this.songs.length; i += 1) {
+						const song = _this.songs[i];
 						if (song._id === updatedSong._id) {
 							_this.songs.$set(i, updatedSong);
 						}

+ 26 - 22
frontend/components/Admin/Stations.vue

@@ -191,9 +191,9 @@ export default {
 		})
 	},
 	methods: {
-		createStation: function() {
-			let _this = this;
-			let {
+		createStation() {
+			const _this = this;
+			const {
 				newStation: {
 					name,
 					displayName,
@@ -203,23 +203,23 @@ export default {
 				}
 			} = this;
 
-			if (name == undefined)
+			if (name === undefined)
 				return Toast.methods.addToast(
 					"Field (Name) cannot be empty",
 					3000
 				);
-			if (displayName == undefined)
+			if (displayName === undefined)
 				return Toast.methods.addToast(
 					"Field (Display Name) cannot be empty",
 					3000
 				);
-			if (description == undefined)
+			if (description === undefined)
 				return Toast.methods.addToast(
 					"Field (Description) cannot be empty",
 					3000
 				);
 
-			_this.socket.emit(
+			return _this.socket.emit(
 				"stations.create",
 				{
 					name,
@@ -231,7 +231,7 @@ export default {
 				},
 				result => {
 					Toast.methods.addToast(result.message, 3000);
-					if (result.status == "success")
+					if (result.status === "success")
 						this.newStation = {
 							genres: [],
 							blacklistedGenres: []
@@ -239,7 +239,7 @@ export default {
 				}
 			);
 		},
-		removeStation: function(index) {
+		removeStation(index) {
 			this.socket.emit(
 				"stations.remove",
 				this.stations[index]._id,
@@ -248,7 +248,7 @@ export default {
 				}
 			);
 		},
-		edit: function(station) {
+		edit(station) {
 			this.editStation({
 				_id: station._id,
 				name: station.name,
@@ -265,8 +265,8 @@ export default {
 				modal: "editStation"
 			});
 		},
-		addGenre: function() {
-			let genre = document
+		addGenre() {
+			const genre = document
 				.getElementById(`new-genre`)
 				.value.toLowerCase()
 				.trim();
@@ -275,13 +275,15 @@ export default {
 			if (genre) {
 				this.newStation.genres.push(genre);
 				document.getElementById(`new-genre`).value = "";
-			} else Toast.methods.addToast("Genre cannot be empty", 3000);
+				return true;
+			}
+			return Toast.methods.addToast("Genre cannot be empty", 3000);
 		},
-		removeGenre: function(index) {
+		removeGenre(index) {
 			this.newStation.genres.splice(index, 1);
 		},
-		addBlacklistedGenre: function() {
-			let genre = document
+		addBlacklistedGenre() {
+			const genre = document
 				.getElementById(`new-blacklisted-genre`)
 				.value.toLowerCase()
 				.trim();
@@ -291,13 +293,15 @@ export default {
 			if (genre) {
 				this.newStation.blacklistedGenres.push(genre);
 				document.getElementById(`new-blacklisted-genre`).value = "";
-			} else Toast.methods.addToast("Genre cannot be empty", 3000);
+				return true;
+			}
+			return Toast.methods.addToast("Genre cannot be empty", 3000);
 		},
-		removeBlacklistedGenre: function(index) {
+		removeBlacklistedGenre(index) {
 			this.newStation.blacklistedGenres.splice(index, 1);
 		},
-		init: function() {
-			let _this = this;
+		init() {
+			const _this = this;
 			_this.socket.emit("stations.index", data => {
 				_this.stations = data.stations;
 			});
@@ -306,8 +310,8 @@ export default {
 		...mapActions("modals", ["openModal"]),
 		...mapActions("admin/stations", ["editStation"])
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 			if (_this.socket.connected) _this.init();

+ 6 - 6
frontend/components/Admin/Statistics.vue

@@ -143,10 +143,10 @@ export default {
 			}
 		};
 	},
-	mounted: function() {
-		let _this = this;
-		let minuteCtx = document.getElementById("minuteChart");
-		let hourCtx = document.getElementById("hourChart");
+	mounted() {
+		const _this = this;
+		const minuteCtx = document.getElementById("minuteChart");
+		const hourCtx = document.getElementById("hourChart");
 
 		_this.minuteChart = new Chart(minuteCtx, {
 			type: "line",
@@ -273,7 +273,7 @@ export default {
 		});
 	},
 	methods: {
-		init: function() {
+		init() {
 			this.socket.emit("apis.joinAdminRoom", "statistics", () => {});
 			this.socket.on(
 				"event:admin.statistics.success.units.minute",
@@ -321,7 +321,7 @@ export default {
 				this.logs = logs;
 			});
 		},
-		round: function(number) {
+		round(number) {
 			return Math.round(number);
 		}
 	}

+ 5 - 5
frontend/components/Admin/Users.vue

@@ -81,12 +81,12 @@ export default {
 		})
 	},
 	methods: {
-		edit: function(user) {
+		edit(user) {
 			this.editUser(user);
 			this.openModal({ sector: "admin", modal: "editUser" });
 		},
-		init: function() {
-			let _this = this;
+		init() {
+			const _this = this;
 			_this.socket.emit("users.index", result => {
 				if (result.status === "success") _this.users = result.data;
 			});
@@ -98,8 +98,8 @@ export default {
 		...mapActions("admin/users", ["editUser"]),
 		...mapActions("modals", ["openModal"])
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 			if (_this.socket.connected) _this.init();

+ 1 - 1
frontend/components/MainFooter.vue

@@ -73,7 +73,7 @@ export default {
 			}
 		};
 	},
-	mounted: function() {
+	mounted() {
 		lofig.get("siteSettings.socialLinks", res => {
 			this.socialLinks = res;
 		});

+ 9 - 3
frontend/components/MainHeader.vue

@@ -89,9 +89,15 @@ export default {
 			}
 		};
 	},
-	mounted: function() {
-		lofig.get("frontendDomain", res => (this.frontendDomain = res));
-		lofig.get("siteSettings", res => (this.siteSettings = res));
+	mounted() {
+		lofig.get("frontendDomain", res => {
+			this.frontendDomain = res;
+			return res;
+		});
+		lofig.get("siteSettings", res => {
+			this.siteSettings = res;
+			return res;
+		});
 	},
 	computed: mapState("modals", {
 		modals: state => state.modals.header

+ 13 - 12
frontend/components/Modals/AddSongToPlaylist.vue

@@ -52,8 +52,8 @@ export default {
 			song: null
 		};
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		this.songId = this.$parent.currentSong.songId;
 		this.song = this.$parent.currentSong;
 		io.getSocket(socket => {
@@ -69,8 +69,8 @@ export default {
 		});
 	},
 	methods: {
-		addSongToPlaylist: function(playlistId) {
-			let _this = this;
+		addSongToPlaylist(playlistId) {
+			const _this = this;
 			this.socket.emit(
 				"playlists.addSongToPlaylist",
 				this.$parent.currentSong.songId,
@@ -81,12 +81,12 @@ export default {
 						_this.playlists[playlistId].songs.push(_this.song);
 					}
 					_this.recalculatePlaylists();
-					//this.$parent.modals.addSongToPlaylist = false;
+					// this.$parent.modals.addSongToPlaylist = false;
 				}
 			);
 		},
-		removeSongFromPlaylist: function(playlistId) {
-			let _this = this;
+		removeSongFromPlaylist(playlistId) {
+			const _this = this;
 			this.socket.emit(
 				"playlists.removeSongFromPlaylist",
 				_this.songId,
@@ -105,21 +105,22 @@ export default {
 						);
 					}
 					_this.recalculatePlaylists();
-					//this.$parent.modals.addSongToPlaylist = false;
+					// this.$parent.modals.addSongToPlaylist = false;
 				}
 			);
 		},
-		recalculatePlaylists: function() {
-			let _this = this;
+		recalculatePlaylists() {
+			const _this = this;
 			_this.playlistsArr = Object.values(_this.playlists).map(
 				playlist => {
 					let hasSong = false;
-					for (let i = 0; i < playlist.songs.length; i++) {
+					for (let i = 0; i < playlist.songs.length; i += 1) {
 						if (playlist.songs[i].songId === _this.songId) {
 							hasSong = true;
 						}
 					}
-					playlist.hasSong = hasSong;
+
+					playlist.hasSong = hasSong; // eslint-disable-line no-param-reassign
 					_this.playlists[playlist._id] = playlist;
 					return playlist;
 				}

+ 19 - 20
frontend/components/Modals/AddSongToQueue.vue

@@ -110,26 +110,26 @@ export default {
 		};
 	},
 	methods: {
-		isPlaylistSelected: function(playlistId) {
+		isPlaylistSelected(playlistId) {
 			return this.privatePlaylistQueueSelected === playlistId;
 		},
-		selectPlaylist: function(playlistId) {
-			let _this = this;
+		selectPlaylist(playlistId) {
+			const _this = this;
 			if (_this.$parent.type === "community") {
 				_this.privatePlaylistQueueSelected = playlistId;
 				_this.$parent.privatePlaylistQueueSelected = playlistId;
 				_this.$parent.addFirstPrivatePlaylistSongToQueue();
 			}
 		},
-		unSelectPlaylist: function() {
-			let _this = this;
+		unSelectPlaylist() {
+			const _this = this;
 			if (_this.$parent.type === "community") {
 				_this.privatePlaylistQueueSelected = null;
 				_this.$parent.privatePlaylistQueueSelected = null;
 			}
 		},
-		addSongToQueue: function(songId) {
-			let _this = this;
+		addSongToQueue(songId) {
+			const _this = this;
 			if (_this.$parent.type === "community") {
 				_this.socket.emit(
 					"stations.addToQueue",
@@ -152,8 +152,8 @@ export default {
 				});
 			}
 		},
-		importPlaylist: function() {
-			let _this = this;
+		importPlaylist() {
+			const _this = this;
 			Toast.methods.addToast(
 				"Starting to import your playlist. This can take some time to do.",
 				4000
@@ -166,8 +166,8 @@ export default {
 				}
 			);
 		},
-		submitQuery: function() {
-			let _this = this;
+		submitQuery() {
+			const _this = this;
 			let query = _this.querySearch;
 			if (query.indexOf("&index=") !== -1) {
 				query = query.split("&index=");
@@ -179,24 +179,23 @@ export default {
 				query.pop();
 				query = query.join("");
 			}
-			_this.socket.emit("apis.searchYoutube", query, results => {
+			_this.socket.emit("apis.searchYoutube", query, res => {
 				// check for error
-				results = results.data;
+				const { data } = res;
 				_this.queryResults = [];
-				for (let i = 0; i < results.items.length; i++) {
+				for (let i = 0; i < data.items.length; i += 1) {
 					_this.queryResults.push({
-						id: results.items[i].id.videoId,
+						id: data.items[i].id.videoId,
 						url: `https://www.youtube.com/watch?v=${this.id}`,
-						title: results.items[i].snippet.title,
-						thumbnail:
-							results.items[i].snippet.thumbnails.default.url
+						title: data.items[i].snippet.title,
+						thumbnail: data.items[i].snippet.thumbnails.default.url
 					});
 				}
 			});
 		}
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket.emit("playlists.indexForUser", res => {

+ 15 - 12
frontend/components/Modals/CreateCommunityStation.vue

@@ -57,17 +57,16 @@ export default {
 			}
 		};
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 		});
 	},
 	methods: {
-		submitModal: function() {
-			const name = this.newCommunity.name;
-			const displayName = this.newCommunity.displayName;
-			const description = this.newCommunity.description;
+		submitModal() {
+			const { name, displayName, description } = this.newCommunity;
+
 			if (!name || !displayName || !description)
 				return Toast.methods.addToast(
 					"Please fill in all fields",
@@ -79,6 +78,7 @@ export default {
 					"Name must have between 2 and 16 characters.",
 					8000
 				);
+
 			if (!validation.regex.az09_.test(name))
 				return Toast.methods.addToast(
 					"Invalid name format. Allowed characters: a-z, 0-9 and _.",
@@ -101,25 +101,28 @@ export default {
 					"Description must have between 2 and 200 characters.",
 					8000
 				);
+
 			let characters = description.split("");
-			characters = characters.filter(function(character) {
+
+			characters = characters.filter(character => {
 				return character.charCodeAt(0) === 21328;
 			});
+
 			if (characters.length !== 0)
 				return Toast.methods.addToast(
 					"Invalid description format. Swastika's are not allowed.",
 					8000
 				);
 
-			let _this = this;
+			const _this = this;
 
-			this.socket.emit(
+			return this.socket.emit(
 				"stations.create",
 				{
-					name: name,
+					name,
 					type: "community",
-					displayName: displayName,
-					description: description
+					displayName,
+					description
 				},
 				res => {
 					if (res.status === "success") {

+ 4 - 3
frontend/components/Modals/EditNews.vue

@@ -180,8 +180,8 @@ import Modal from "./Modal.vue";
 export default {
 	components: { Modal },
 	methods: {
-		addChange: function(type) {
-			let change = document.getElementById(`edit-${type}`).value.trim();
+		addChange(type) {
+			const change = document.getElementById(`edit-${type}`).value.trim();
 
 			if (this.$parent.editing[type].indexOf(change) !== -1)
 				return Toast.methods.addToast(`Tag already exists`, 3000);
@@ -190,8 +190,9 @@ export default {
 			else Toast.methods.addToast(`${type} cannot be empty`, 3000);
 
 			document.getElementById(`edit-${type}`).value = "";
+			return true;
 		},
-		removeChange: function(type, index) {
+		removeChange(type, index) {
 			this.$parent.editing[type].splice(index, 1);
 		},
 		...mapActions("modals", ["closeModal"])

+ 89 - 61
frontend/components/Modals/EditSong.vue

@@ -317,8 +317,8 @@ export default {
 		})
 	},
 	methods: {
-		save: function(song, close) {
-			let _this = this;
+		save(song, close) {
+			const _this = this;
 
 			if (!song.title)
 				return Toast.methods.addToast(
@@ -348,11 +348,11 @@ export default {
 					"Title must have between 1 and 100 characters.",
 					8000
 				);
-			/*if (!validation.regex.ascii.test(song.title))
+			/* if (!validation.regex.ascii.test(song.title))
 				return Toast.methods.addToast(
 					"Invalid title format. Only ascii characters are allowed.",
 					8000
-				);*/
+				); */
 
 			// Artists
 			if (song.artists.length < 1 || song.artists.length > 10)
@@ -362,27 +362,39 @@ export default {
 				);
 			let error;
 			song.artists.forEach(artist => {
-				if (!validation.isLength(artist, 1, 32))
-					return (error =
-						"Artist must have between 1 and 32 characters.");
-				if (!validation.regex.ascii.test(artist))
-					return (error =
-						"Invalid artist format. Only ascii characters are allowed.");
-				if (artist === "NONE")
-					return (error =
-						'Invalid artist format. Artists are not allowed to be named "NONE".');
+				if (!validation.isLength(artist, 1, 32)) {
+					error = "Artist must have between 1 and 32 characters.";
+					return error;
+				}
+				if (!validation.regex.ascii.test(artist)) {
+					error =
+						"Invalid artist format. Only ascii characters are allowed.";
+					return error;
+				}
+				if (artist === "NONE") {
+					error =
+						'Invalid artist format. Artists are not allowed to be named "NONE".';
+					return error;
+				}
+
+				return false;
 			});
 			if (error) return Toast.methods.addToast(error, 8000);
 
 			// Genres
 			error = undefined;
 			song.genres.forEach(genre => {
-				if (!validation.isLength(genre, 1, 16))
-					return (error =
-						"Genre must have between 1 and 16 characters.");
-				if (!validation.regex.az09_.test(genre))
-					return (error =
-						"Invalid genre format. Only ascii characters are allowed.");
+				if (!validation.isLength(genre, 1, 16)) {
+					error = "Genre must have between 1 and 16 characters.";
+					return error;
+				}
+				if (!validation.regex.az09_.test(genre)) {
+					error =
+						"Invalid genre format. Only ascii characters are allowed.";
+					return error;
+				}
+
+				return false;
 			});
 			if (error) return Toast.methods.addToast(error, 8000);
 
@@ -406,18 +418,20 @@ export default {
 				);
 			}
 
-			this.socket.emit(
+			return this.socket.emit(
 				`${_this.editing.type}.update`,
 				song._id,
 				song,
 				res => {
 					Toast.methods.addToast(res.message, 4000);
 					if (res.status === "success") {
-						_this.$parent.songs.forEach(lSong => {
-							if (song._id === lSong._id) {
-								for (let n in song) {
-									lSong[n] = song[n];
-								}
+						_this.$parent.songs.forEach(originalSong => {
+							const updatedSong = song;
+							if (originalSong._id === updatedSong._id) {
+								Object.keys(originalSong).forEach(n => {
+									updatedSong[n] = originalSong[n];
+									return originalSong[n];
+								});
 							}
 						});
 					}
@@ -429,9 +443,11 @@ export default {
 				}
 			);
 		},
-		settings: function(type) {
-			let _this = this;
+		settings(type) {
+			const _this = this;
 			switch (type) {
+				default:
+					break;
 				case "stop":
 					_this.stopVideo();
 					_this.pauseVideo(true);
@@ -451,16 +467,16 @@ export default {
 					break;
 			}
 		},
-		changeVolume: function() {
-			let local = this;
-			let volume = document.getElementById("volumeSlider").value;
+		changeVolume() {
+			const local = this;
+			const volume = document.getElementById("volumeSlider").value;
 			localStorage.setItem("volume", volume);
 			local.video.player.setVolume(volume);
 			if (volume > 0) local.video.player.unMute();
 		},
-		addTag: function(type) {
-			if (type == "genres") {
-				let genre = document
+		addTag(type) {
+			if (type === "genres") {
+				const genre = document
 					.getElementById("new-genre")
 					.value.toLowerCase()
 					.trim();
@@ -469,9 +485,13 @@ export default {
 				if (genre) {
 					this.editing.song.genres.push(genre);
 					document.getElementById("new-genre").value = "";
-				} else Toast.methods.addToast("Genre cannot be empty", 3000);
-			} else if (type == "artists") {
-				let artist = document.getElementById("new-artist").value;
+					return false;
+				}
+
+				return Toast.methods.addToast("Genre cannot be empty", 3000);
+			}
+			if (type === "artists") {
+				const artist = document.getElementById("new-artist").value;
 				if (this.editing.song.artists.indexOf(artist) !== -1)
 					return Toast.methods.addToast(
 						"Artist already exists",
@@ -480,15 +500,19 @@ export default {
 				if (document.getElementById("new-artist").value !== "") {
 					this.editing.song.artists.push(artist);
 					document.getElementById("new-artist").value = "";
-				} else Toast.methods.addToast("Artist cannot be empty", 3000);
+					return false;
+				}
+				return Toast.methods.addToast("Artist cannot be empty", 3000);
 			}
+
+			return false;
 		},
-		removeTag: function(type, index) {
-			if (type == "genres") this.editing.song.genres.splice(index, 1);
-			else if (type == "artists")
+		removeTag(type, index) {
+			if (type === "genres") this.editing.song.genres.splice(index, 1);
+			else if (type === "artists")
 				this.editing.song.artists.splice(index, 1);
 		},
-		getSpotifySongs: function() {
+		getSpotifySongs() {
 			this.socket.emit(
 				"apis.getSpotifySongs",
 				this.spotify.title,
@@ -510,9 +534,9 @@ export default {
 				}
 			);
 		},
-		initCanvas: function() {
-			let canvasElement = document.getElementById("durationCanvas");
-			let ctx = canvasElement.getContext("2d");
+		initCanvas() {
+			const canvasElement = document.getElementById("durationCanvas");
+			const ctx = canvasElement.getContext("2d");
 
 			const skipDurationColor = "#ef4a1c";
 			const durationColor = "#1dc146";
@@ -538,9 +562,9 @@ export default {
 			ctx.fillStyle = "#000000";
 			ctx.fillText("After duration", 255, 38);
 		},
-		drawCanvas: function() {
-			let canvasElement = document.getElementById("durationCanvas");
-			let ctx = canvasElement.getContext("2d");
+		drawCanvas() {
+			const canvasElement = document.getElementById("durationCanvas");
+			const ctx = canvasElement.getContext("2d");
 
 			const videoDuration = Number(this.youtubeVideoDuration);
 
@@ -552,11 +576,11 @@ export default {
 
 			const currentTime = this.video.player.getCurrentTime();
 
-			let widthSkipDuration = (skipDuration / videoDuration) * width;
-			let widthDuration = (duration / videoDuration) * width;
-			let widthAfterDuration = (afterDuration / videoDuration) * width;
+			const widthSkipDuration = (skipDuration / videoDuration) * width;
+			const widthDuration = (duration / videoDuration) * width;
+			const widthAfterDuration = (afterDuration / videoDuration) * width;
 
-			let widthCurrentTime = (currentTime / videoDuration) * width;
+			const widthCurrentTime = (currentTime / videoDuration) * width;
 
 			const skipDurationColor = "#ef4a1c";
 			const durationColor = "#1dc146";
@@ -587,8 +611,8 @@ export default {
 		]),
 		...mapActions("modals", ["closeModal"])
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 
 		// if (this.modals.editSong = false) this.video.player.stopVideo();
 
@@ -629,9 +653,10 @@ export default {
 				_this.video.player.stopVideo();
 			}
 			if (this.playerReady) {
-				_this
-					.getCurrentTime(3)
-					.then(time => (this.youtubeVideoCurrentTime = time));
+				_this.getCurrentTime(3).then(time => {
+					this.youtubeVideoCurrentTime = time;
+					return time;
+				});
 			}
 
 			if (_this.video.paused === false) _this.drawCanvas();
@@ -653,7 +678,7 @@ export default {
 				onReady: () => {
 					let volume = parseInt(localStorage.getItem("volume"));
 					volume = typeof volume === "number" ? volume : 20;
-					console.log("Seekto: " + _this.editing.song.skipDuration);
+					console.log(`Seekto: ${_this.editing.song.skipDuration}`);
 					_this.video.player.seekTo(_this.editing.song.skipDuration);
 					_this.video.player.setVolume(volume);
 					if (volume > 0) _this.video.player.unMute();
@@ -678,14 +703,15 @@ export default {
 						if (_this.editing.song.duration > youtubeDuration + 1) {
 							this.video.player.stopVideo();
 							_this.video.paused = true;
-							Toast.methods.addToast(
+							return Toast.methods.addToast(
 								"Video can't play. Specified duration is bigger than the YouTube song duration.",
 								4000
 							);
-						} else if (_this.editing.song.duration <= 0) {
+						}
+						if (_this.editing.song.duration <= 0) {
 							this.video.player.stopVideo();
 							_this.video.paused = true;
-							Toast.methods.addToast(
+							return Toast.methods.addToast(
 								"Video can't play. Specified duration has to be more than 0 seconds.",
 								4000
 							);
@@ -695,13 +721,15 @@ export default {
 							_this.video.player.getCurrentTime() <
 							_this.editing.song.skipDuration
 						) {
-							_this.video.player.seekTo(
+							return _this.video.player.seekTo(
 								_this.editing.song.skipDuration
 							);
 						}
 					} else if (event.data === 2) {
 						this.video.paused = true;
 					}
+
+					return false;
 				}
 			}
 		});

+ 89 - 59
frontend/components/Modals/EditStation.vue

@@ -104,12 +104,15 @@ export default {
 		station: state => state.station,
 		editing: state => state.editing
 	}),
-	mounted: function() {
-		let _this = this;
-		io.getSocket(socket => (_this.socket = socket));
+	mounted() {
+		const _this = this;
+		io.getSocket(socket => {
+			_this.socket = socket;
+			return socket;
+		});
 	},
 	methods: {
-		update: function() {
+		update() {
 			if (this.station.name !== this.editing.name) this.updateName();
 			if (this.station.displayName !== this.editing.displayName)
 				this.updateDisplayName();
@@ -120,8 +123,8 @@ export default {
 			if (this.station.partyMode !== this.editing.partyMode)
 				this.updatePartyMode();
 		},
-		updateName: function() {
-			const name = this.editing.name;
+		updateName() {
+			const { name } = this.editing;
 			if (!validation.isLength(name, 2, 16))
 				return Toast.methods.addToast(
 					"Name must have between 2 and 16 characters.",
@@ -133,28 +136,33 @@ export default {
 					8000
 				);
 
-			this.socket.emit(
+			return this.socket.emit(
 				"stations.updateName",
 				this.editing._id,
 				name,
 				res => {
 					if (res.status === "success") {
-						if (this.station) this.station.name = name;
-						else {
-							this.$parent.stations.forEach((station, index) => {
-								if (station._id === this.editing._id)
-									return (this.$parent.stations[
-										index
-									].name = name);
-							});
+						if (this.station) {
+							this.station.name = name;
+							return name;
 						}
+
+						this.$parent.stations.forEach((station, index) => {
+							if (station._id === this.editing._id) {
+								this.$parent.stations[index].name = name;
+								return name;
+							}
+
+							return false;
+						});
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 			);
 		},
-		updateDisplayName: function() {
-			const displayName = this.editing.displayName;
+		updateDisplayName() {
+			const { displayName } = this.editing;
 			if (!validation.isLength(displayName, 2, 32))
 				return Toast.methods.addToast(
 					"Display name must have between 2 and 32 characters.",
@@ -166,7 +174,7 @@ export default {
 					8000
 				);
 
-			this.socket.emit(
+			return this.socket.emit(
 				"stations.updateDisplayName",
 				this.editing._id,
 				displayName,
@@ -177,9 +185,10 @@ export default {
 						else {
 							this.$parent.stations.forEach((station, index) => {
 								if (station._id === this.editing._id)
-									return (this.$parent.stations[
+									this.$parent.stations[
 										index
-									].displayName = displayName);
+									].displayName = displayName;
+								return displayName;
 							});
 						}
 					}
@@ -187,96 +196,117 @@ export default {
 				}
 			);
 		},
-		updateDescription: function() {
-			let _this = this;
+		updateDescription() {
+			const _this = this;
 
-			const description = this.editing.description;
+			const { description } = this.editing;
 			if (!validation.isLength(description, 2, 200))
 				return Toast.methods.addToast(
 					"Description must have between 2 and 200 characters.",
 					8000
 				);
+
 			let characters = description.split("");
 			characters = characters.filter(character => {
 				return character.charCodeAt(0) === 21328;
 			});
+
 			if (characters.length !== 0)
 				return Toast.methods.addToast(
 					"Invalid description format. Swastika's are not allowed.",
 					8000
 				);
 
-			this.socket.emit(
+			return this.socket.emit(
 				"stations.updateDescription",
 				this.editing._id,
 				description,
 				res => {
 					if (res.status === "success") {
-						if (_this.station)
+						if (_this.station) {
 							_this.station.description = description;
-						else {
-							_this.$parent.stations.forEach((station, index) => {
-								if (station._id === station._id)
-									return (_this.$parent.stations[
-										index
-									].description = description);
-							});
+							return description;
 						}
+
+						_this.$parent.stations.forEach((station, index) => {
+							if (station._id === this.editing._id) {
+								_this.$parent.stations[
+									index
+								].description = description;
+								return description;
+							}
+
+							return false;
+						});
+
 						return Toast.methods.addToast(res.message, 4000);
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 			);
 		},
-		updatePrivacy: function() {
-			let _this = this;
-			this.socket.emit(
+		updatePrivacy() {
+			const _this = this;
+			return this.socket.emit(
 				"stations.updatePrivacy",
 				this.editing._id,
 				this.editing.privacy,
 				res => {
 					if (res.status === "success") {
-						if (_this.station)
+						if (_this.station) {
 							_this.station.privacy = _this.editing.privacy;
-						else {
-							_this.$parent.stations.forEach((station, index) => {
-								if (station._id === station._id)
-									return (_this.$parent.stations[
-										index
-									].privacy = _this.editing.privacy);
-							});
+							return _this.editing.privacy;
 						}
+
+						_this.$parent.stations.forEach((station, index) => {
+							if (station._id === _this.editing._id) {
+								_this.$parent.stations[index].privacy =
+									_this.editing.privacy;
+								return _this.editing.privacy;
+							}
+
+							return false;
+						});
+
 						return Toast.methods.addToast(res.message, 4000);
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 			);
 		},
-		updatePartyMode: function() {
-			let _this = this;
-			this.socket.emit(
+		updatePartyMode() {
+			const _this = this;
+			return this.socket.emit(
 				"stations.updatePartyMode",
 				this.editing._id,
 				this.editing.partyMode,
 				res => {
 					if (res.status === "success") {
-						if (_this.station)
+						if (_this.station) {
 							_this.station.partyMode = _this.editing.partyMode;
-						else {
-							_this.$parent.stations.forEach((station, index) => {
-								if (station._id === station._id)
-									return (_this.$parent.stations[
-										index
-									].partyMode = _this.editing.partyMode);
-							});
+							return _this.editing.partyMode;
 						}
+
+						_this.$parent.stations.forEach((station, index) => {
+							if (station._id === _this.editing._id) {
+								_this.$parent.stations[index].partyMode =
+									_this.editing.partyMode;
+								return _this.editing.partyMode;
+							}
+
+							return false;
+						});
+
 						return Toast.methods.addToast(res.message, 4000);
 					}
-					Toast.methods.addToast(res.message, 8000);
+
+					return Toast.methods.addToast(res.message, 8000);
 				}
 			);
 		},
-		deleteStation: function() {
+		deleteStation() {
 			this.socket.emit("stations.remove", this.editing._id, res => {
 				Toast.methods.addToast(res.message, 8000);
 			});

+ 18 - 15
frontend/components/Modals/EditUser.vue

@@ -112,8 +112,8 @@ export default {
 		})
 	},
 	methods: {
-		updateUsername: function() {
-			const username = this.editing.username;
+		updateUsername() {
+			const { username } = this.editing;
 			if (!validation.isLength(username, 2, 32))
 				return Toast.methods.addToast(
 					"Username must have between 2 and 32 characters.",
@@ -125,7 +125,7 @@ export default {
 					8000
 				);
 
-			this.socket.emit(
+			return this.socket.emit(
 				`users.updateUsername`,
 				this.editing._id,
 				username,
@@ -134,8 +134,8 @@ export default {
 				}
 			);
 		},
-		updateEmail: function() {
-			const email = this.editing.email;
+		updateEmail() {
+			const { email } = this.editing;
 			if (!validation.isLength(email, 3, 254))
 				return Toast.methods.addToast(
 					"Email must have between 3 and 254 characters.",
@@ -147,7 +147,7 @@ export default {
 			)
 				return Toast.methods.addToast("Invalid email format.", 8000);
 
-			this.socket.emit(
+			return this.socket.emit(
 				`users.updateEmail`,
 				this.editing._id,
 				email,
@@ -156,7 +156,7 @@ export default {
 				}
 			);
 		},
-		updateRole: function() {
+		updateRole() {
 			this.socket.emit(
 				`users.updateRole`,
 				this.editing._id,
@@ -168,12 +168,12 @@ export default {
 						this.editing.role === "default" &&
 						this.editing._id === this.$parent.$parent.$parent.userId
 					)
-						location.reload();
+						window.location.reload();
 				}
 			);
 		},
-		banUser: function() {
-			const reason = this.ban.reason;
+		banUser() {
+			const { reason } = this.ban;
 			if (!validation.isLength(reason, 1, 64))
 				return Toast.methods.addToast(
 					"Reason must have between 1 and 64 characters.",
@@ -185,7 +185,7 @@ export default {
 					8000
 				);
 
-			this.socket.emit(
+			return this.socket.emit(
 				`users.banUserById`,
 				this.editing._id,
 				this.ban.reason,
@@ -195,16 +195,19 @@ export default {
 				}
 			);
 		},
-		removeSessions: function() {
+		removeSessions() {
 			this.socket.emit(`users.removeSessions`, this.editing._id, res => {
 				Toast.methods.addToast(res.message, 4000);
 			});
 		},
 		...mapActions("modals", ["closeModal"])
 	},
-	mounted: function() {
-		let _this = this;
-		io.getSocket(socket => (_this.socket = socket));
+	mounted() {
+		const _this = this;
+		io.getSocket(socket => {
+			_this.socket = socket;
+			return socket;
+		});
 	}
 };
 </script>

+ 1 - 1
frontend/components/Modals/IssuesModal.vue

@@ -83,7 +83,7 @@ export default {
 			report: state => state.report
 		})
 	},
-	mounted: function() {
+	mounted() {
 		if (this.$route.query.returnToSong) {
 			this.closeModal({ sector: "admin", modal: "editSong" });
 		}

+ 5 - 5
frontend/components/Modals/Login.vue

@@ -83,28 +83,28 @@ import { mapActions } from "vuex";
 import { Toast } from "vue-roaster";
 
 export default {
-	data: function() {
+	data() {
 		return {
 			email: "",
 			password: ""
 		};
 	},
 	methods: {
-		submitModal: function() {
+		submitModal() {
 			this.login({
 				email: this.email,
 				password: this.password
 			})
 				.then(res => {
-					if (res.status == "success") location.reload();
+					if (res.status === "success") window.location.reload();
 				})
 				.catch(err => Toast.methods.addToast(err.message, 5000));
 		},
-		resetPassword: function() {
+		resetPassword() {
 			this.closeModal({ sector: "header", modal: "login" });
 			this.$router.go("/reset_password");
 		},
-		githubRedirect: function() {
+		githubRedirect() {
 			localStorage.setItem("github_redirect", this.$route.path);
 		},
 		...mapActions("modals", ["closeModal"]),

+ 4 - 4
frontend/components/Modals/MobileAlert.vue

@@ -22,15 +22,15 @@ export default {
 			isModalActive: false
 		};
 	},
-	mounted: function() {
+	mounted() {
 		if (!localStorage.getItem("mobileOptimization")) {
 			this.toggleModal();
 			localStorage.setItem("mobileOptimization", true);
 		}
 	},
 	methods: {
-		toggleModal: function() {
-			let _this = this;
+		toggleModal() {
+			const _this = this;
 			_this.isModalActive = !_this.isModalActive;
 			if (_this.isModalActive) {
 				setTimeout(() => {
@@ -40,7 +40,7 @@ export default {
 		}
 	},
 	events: {
-		closeModal: function() {
+		closeModal() {
 			this.isModalActive = false;
 		}
 	}

+ 1 - 1
frontend/components/Modals/Modal.vue

@@ -38,7 +38,7 @@ export default {
 		},
 		...mapActions("modals", ["closeCurrentModal"])
 	},
-	mounted: function() {
+	mounted() {
 		this.type = this.toCamelCase(this.title);
 	}
 };

+ 5 - 5
frontend/components/Modals/Playlists/Create.vue

@@ -40,15 +40,15 @@ export default {
 			}
 		};
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 		});
 	},
 	methods: {
-		createPlaylist: function() {
-			const displayName = this.playlist.displayName;
+		createPlaylist() {
+			const { displayName } = this.playlist;
 			if (!validation.isLength(displayName, 2, 32))
 				return Toast.methods.addToast(
 					"Display name must have between 2 and 32 characters.",
@@ -60,7 +60,7 @@ export default {
 					8000
 				);
 
-			this.socket.emit("playlists.create", this.playlist, res => {
+			return this.socket.emit("playlists.create", this.playlist, res => {
 				Toast.methods.addToast(res.message, 3000);
 
 				if (res.status === "success") {

+ 49 - 50
frontend/components/Modals/Playlists/Edit.vue

@@ -155,8 +155,8 @@ export default {
 	computed: mapState("user/playlists", {
 		editing: state => state.editing
 	}),
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket.emit("playlists.getPlaylist", _this.editing, res => {
@@ -185,7 +185,7 @@ export default {
 					_this.playlist.songs.forEach((song, index) => {
 						if (song.songId === data.songId) songIndex = index;
 					});
-					let song = _this.playlist.songs.splice(songIndex, 1)[0];
+					const song = _this.playlist.songs.splice(songIndex, 1)[0];
 					_this.playlist.songs.push(song);
 				}
 			});
@@ -195,53 +195,52 @@ export default {
 					_this.playlist.songs.forEach((song, index) => {
 						if (song.songId === data.songId) songIndex = index;
 					});
-					let song = _this.playlist.songs.splice(songIndex, 1)[0];
+					const song = _this.playlist.songs.splice(songIndex, 1)[0];
 					_this.playlist.songs.unshift(song);
 				}
 			});
 		});
 	},
 	methods: {
-		formatTime: function(length) {
-			let duration = moment.duration(length, "seconds");
+		formatTime(length) {
+			const duration = moment.duration(length, "seconds");
 			function getHours() {
 				return Math.floor(duration.asHours());
 			}
 			if (length <= 0) return "0 seconds";
-			else
-				return (
-					(getHours() > 0
-						? getHours() > 1
-							? getHours() < 10
-								? "0" + getHours() + " hours "
-								: getHours() + " hours "
-							: "0" + getHours() + " hour "
-						: "") +
-					(duration.minutes() > 0
-						? duration.minutes() > 1
-							? duration.minutes() < 10
-								? "0" + duration.minutes() + " minutes "
-								: duration.minutes() + " minutes "
-							: "0" + duration.minutes() + " minute "
-						: "") +
-					(duration.seconds() > 0
-						? duration.seconds() > 1
-							? duration.seconds() < 10
-								? "0" + duration.seconds() + " seconds "
-								: duration.seconds() + " seconds "
-							: "0" + duration.seconds() + " second "
-						: "")
-				);
+			return (
+				(getHours() > 0
+					? getHours() > 1
+						? getHours() < 10
+							? `0${getHours()} hours `
+							: `${getHours()} hours `
+						: `0${getHours()} hour `
+					: "") +
+				(duration.minutes() > 0
+					? duration.minutes() > 1
+						? duration.minutes() < 10
+							? `0${duration.minutes()} minutes `
+							: `${duration.minutes()} minutes `
+						: `0${duration.minutes()} minute `
+					: "") +
+				(duration.seconds() > 0
+					? duration.seconds() > 1
+						? duration.seconds() < 10
+							? `0${duration.seconds()} seconds `
+							: `${duration.seconds()} seconds `
+						: `0${duration.seconds()} second `
+					: "")
+			);
 		},
-		totalLength: function() {
+		totalLength() {
 			let length = 0;
 			this.playlist.songs.forEach(song => {
 				length += song.duration;
 			});
 			return this.formatTime(length);
 		},
-		searchForSongs: function() {
-			let _this = this;
+		searchForSongs() {
+			const _this = this;
 			let query = _this.songQuery;
 			if (query.indexOf("&index=") !== -1) {
 				query = query.split("&index=");
@@ -254,9 +253,9 @@ export default {
 				query = query.join("");
 			}
 			_this.socket.emit("apis.searchYoutube", query, res => {
-				if (res.status == "success") {
+				if (res.status === "success") {
 					_this.songQueryResults = [];
-					for (let i = 0; i < res.data.items.length; i++) {
+					for (let i = 0; i < res.data.items.length; i += 1) {
 						_this.songQueryResults.push({
 							id: res.data.items[i].id.videoId,
 							url: `https://www.youtube.com/watch?v=${this.id}`,
@@ -269,8 +268,8 @@ export default {
 					Toast.methods.addToast(res.message, 3000);
 			});
 		},
-		addSongToPlaylist: function(id) {
-			let _this = this;
+		addSongToPlaylist(id) {
+			const _this = this;
 			_this.socket.emit(
 				"playlists.addSongToPlaylist",
 				id,
@@ -280,8 +279,8 @@ export default {
 				}
 			);
 		},
-		importPlaylist: function() {
-			let _this = this;
+		importPlaylist() {
+			const _this = this;
 			Toast.methods.addToast(
 				"Starting to import your playlist. This can take some time to do.",
 				4000
@@ -297,8 +296,8 @@ export default {
 				}
 			);
 		},
-		removeSongFromPlaylist: function(id) {
-			let _this = this;
+		removeSongFromPlaylist(id) {
+			const _this = this;
 			this.socket.emit(
 				"playlists.removeSongFromPlaylist",
 				id,
@@ -308,8 +307,8 @@ export default {
 				}
 			);
 		},
-		renamePlaylist: function() {
-			const displayName = this.playlist.displayName;
+		renamePlaylist() {
+			const { displayName } = this.playlist;
 			if (!validation.isLength(displayName, 2, 32))
 				return Toast.methods.addToast(
 					"Display name must have between 2 and 32 characters.",
@@ -321,7 +320,7 @@ export default {
 					8000
 				);
 
-			this.socket.emit(
+			return this.socket.emit(
 				"playlists.updateDisplayName",
 				this.playlist._id,
 				this.playlist.displayName,
@@ -330,8 +329,8 @@ export default {
 				}
 			);
 		},
-		removePlaylist: function() {
-			let _this = this;
+		removePlaylist() {
+			const _this = this;
 			_this.socket.emit("playlists.remove", _this.playlist._id, res => {
 				Toast.methods.addToast(res.message, 3000);
 				if (res.status === "success") {
@@ -340,8 +339,8 @@ export default {
 				}
 			});
 		},
-		promoteSong: function(songId) {
-			let _this = this;
+		promoteSong(songId) {
+			const _this = this;
 			_this.socket.emit(
 				"playlists.moveSongToTop",
 				_this.playlist._id,
@@ -351,8 +350,8 @@ export default {
 				}
 			);
 		},
-		demoteSong: function(songId) {
-			let _this = this;
+		demoteSong(songId) {
+			const _this = this;
 			_this.socket.emit(
 				"playlists.moveSongToBottom",
 				_this.playlist._id,

+ 6 - 6
frontend/components/Modals/Register.vue

@@ -98,12 +98,12 @@ export default {
 			}
 		};
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		lofig.get("recaptcha", obj => {
 			_this.recaptcha.key = obj.key;
 
-			let recaptchaScript = document.createElement("script");
+			const recaptchaScript = document.createElement("script");
 			recaptchaScript.onload = () => {
 				grecaptcha.ready(() => {
 					grecaptcha
@@ -122,7 +122,7 @@ export default {
 		});
 	},
 	methods: {
-		submitModal: function() {
+		submitModal() {
 			console.log(this.recaptcha.token);
 
 			this.register({
@@ -132,11 +132,11 @@ export default {
 				recaptchaToken: this.recaptcha.token
 			})
 				.then(res => {
-					if (res.status == "success") location.reload();
+					if (res.status === "success") window.location.reload();
 				})
 				.catch(err => Toast.methods.addToast(err.message, 5000));
 		},
-		githubRedirect: function() {
+		githubRedirect() {
 			localStorage.setItem("github_redirect", this.$route.path);
 		},
 		...mapActions("modals", ["closeModal"]),

+ 12 - 12
frontend/components/Modals/Report.vue

@@ -216,43 +216,43 @@ export default {
 			]
 		};
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 		});
 	},
 	methods: {
-		create: function() {
-			let _this = this;
+		create() {
+			const _this = this;
 			console.log(this.report);
 			_this.socket.emit("reports.create", _this.report, res => {
 				Toast.methods.addToast(res.message, 4000);
-				if (res.status == "success")
+				if (res.status === "success")
 					_this.closeModal({
 						sector: "station",
 						modal: "report"
 					});
 			});
 		},
-		updateCharactersRemaining: function() {
+		updateCharactersRemaining() {
 			this.charactersRemaining =
 				400 - document.getElementsByClassName("textarea").value.length;
 		},
-		highlight: function(type) {
-			if (type == "currentSong") {
+		highlight(type) {
+			if (type === "currentSong") {
 				this.report.songId = this.$parent.currentSong.songId;
 				this.isPreviousSongActive = false;
 				this.isCurrentSongActive = true;
-			} else if (type == "previousSong") {
+			} else if (type === "previousSong") {
 				this.report.songId = this.$parent.previousSong.songId;
 				this.isCurrentSongActive = false;
 				this.isPreviousSongActive = true;
 			}
 		},
-		toggleIssue: function(name, reason) {
-			for (let z = 0; z < this.report.issues.length; z++) {
-				if (this.report.issues[z].name == name) {
+		toggleIssue(name, reason) {
+			for (let z = 0; z < this.report.issues.length; z += 1) {
+				if (this.report.issues[z].name === name) {
 					if (this.report.issues[z].reasons.indexOf(reason) > -1) {
 						this.report.issues[z].reasons.splice(
 							this.report.issues[z].reasons.indexOf(reason),

+ 6 - 3
frontend/components/Modals/ViewPunishment.vue

@@ -74,9 +74,12 @@ export default {
 			punishment: state => state.punishment
 		})
 	},
-	mounted: function() {
-		let _this = this;
-		io.getSocket(socket => (_this.socket = socket));
+	mounted() {
+		const _this = this;
+		io.getSocket(socket => {
+			_this.socket = socket;
+			return socket;
+		});
 	},
 	methods: {
 		...mapActions("modals", ["closeModal"])

+ 6 - 8
frontend/components/Modals/WhatIsNew.vue

@@ -81,8 +81,8 @@ export default {
 			news: null
 		};
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(true, socket => {
 			_this.socket = socket;
 			_this.socket.emit("news.newest", res => {
@@ -108,15 +108,13 @@ export default {
 						}
 						localStorage.setItem("whatIsNew", res.data.createdAt);
 					}
-				} else {
-					if (!localStorage.getItem("firstVisited"))
-						localStorage.setItem("firstVisited", Date.now());
-				}
+				} else if (!localStorage.getItem("firstVisited"))
+					localStorage.setItem("firstVisited", Date.now());
 			});
 		});
 	},
 	methods: {
-		toggleModal: function() {
+		toggleModal() {
 			this.isModalActive = !this.isModalActive;
 		},
 		formatDate: unix => {
@@ -124,7 +122,7 @@ export default {
 		}
 	},
 	events: {
-		closeModal: function() {
+		closeModal() {
 			this.isModalActive = false;
 		}
 	}

+ 9 - 9
frontend/components/Sidebars/Playlist.vue

@@ -58,11 +58,11 @@ export default {
 		};
 	},
 	methods: {
-		edit: function(id) {
+		edit(id) {
 			this.editPlaylist(id);
 			this.openModal({ sector: "station", modal: "editPlaylist" });
 		},
-		selectPlaylist: function(id) {
+		selectPlaylist(id) {
 			this.socket.emit(
 				"stations.selectPrivatePlaylist",
 				this.$parent.station._id,
@@ -70,13 +70,13 @@ export default {
 				res => {
 					if (res.status === "failure")
 						return Toast.methods.addToast(res.message, 8000);
-					Toast.methods.addToast(res.message, 4000);
+					return Toast.methods.addToast(res.message, 4000);
 				}
 			);
 		},
-		isNotSelected: function(id) {
-			let _this = this;
-			//TODO Also change this once it changes for a station
+		isNotSelected(id) {
+			const _this = this;
+			// TODO Also change this once it changes for a station
 			if (
 				_this.$parent.station &&
 				_this.$parent.station.privatePlaylist === id
@@ -87,13 +87,13 @@ export default {
 		...mapActions("modals", ["openModal"]),
 		...mapActions("user/playlists", ["editPlaylist"])
 	},
-	mounted: function() {
+	mounted() {
 		// TODO: Update when playlist is removed/created
-		let _this = this;
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket.emit("playlists.indexForUser", res => {
-				if (res.status == "success") _this.playlists = res.data;
+				if (res.status === "success") _this.playlists = res.data;
 			});
 			_this.socket.on("event:playlist.create", playlist => {
 				_this.playlists.push(playlist);

+ 7 - 7
frontend/components/Sidebars/SongsList.vue

@@ -136,25 +136,25 @@ import { Toast } from "vue-roaster";
 import UserIdToUsername from "../UserIdToUsername.vue";
 
 export default {
-	data: function() {
+	data() {
 		return {
 			dismissedWarning: false
 		};
 	},
 	methods: {
-		isOwnerOnly: function() {
+		isOwnerOnly() {
 			return (
 				this.$parent.$parent.loggedIn &&
 				this.$parent.$parent.userId === this.$parent.station.owner
 			);
 		},
-		isAdminOnly: function() {
+		isAdminOnly() {
 			return (
 				this.$parent.$parent.loggedIn &&
 				this.$parent.$parent.role === "admin"
 			);
 		},
-		removeFromQueue: function(songId) {
+		removeFromQueue(songId) {
 			window.socket.emit(
 				"stations.removeFromQueue",
 				this.$parent.station._id,
@@ -171,12 +171,12 @@ export default {
 		},
 		...mapActions("modals", ["openModal"])
 	},
-	mounted: function() {
-		/*let _this = this;
+	mounted() {
+		/* let _this = this;
 			io.getSocket((socket) => {
 				_this.socket = socket;
 
-			});*/
+			}); */
 	},
 	components: { UserIdToUsername }
 };

+ 10 - 4
frontend/components/Station/CommunityHeader.vue

@@ -210,12 +210,18 @@ export default {
 			}
 		};
 	},
-	mounted: function() {
-		lofig.get("frontendDomain", res => (this.frontendDomain = res));
-		lofig.get("siteSettings", res => (this.siteSettings = res));
+	mounted() {
+		lofig.get("frontendDomain", res => {
+			this.frontendDomain = res;
+			return res;
+		});
+		lofig.get("siteSettings", res => {
+			this.siteSettings = res;
+			return res;
+		});
 	},
 	methods: {
-		isOwner: function() {
+		isOwner() {
 			return (
 				this.$parent.$parent.loggedIn &&
 				(this.$parent.$parent.role === "admin" ||

+ 10 - 4
frontend/components/Station/OfficialHeader.vue

@@ -231,12 +231,18 @@ export default {
 			}
 		};
 	},
-	mounted: function() {
-		lofig.get("frontendDomain", res => (this.frontendDomain = res));
-		lofig.get("siteSettings", res => (this.siteSettings = res));
+	mounted() {
+		lofig.get("frontendDomain", res => {
+			this.frontendDomain = res;
+			return res;
+		});
+		lofig.get("siteSettings", res => {
+			this.siteSettings = res;
+			return res;
+		});
 	},
 	methods: {
-		isOwner: function() {
+		isOwner() {
 			return (
 				this.$parent.$parent.loggedIn &&
 				this.$parent.$parent.role === "admin"

+ 109 - 101
frontend/components/Station/Station.vue

@@ -485,16 +485,16 @@ export default {
 		})
 	},
 	methods: {
-		isOwnerOnly: function() {
+		isOwnerOnly() {
 			return (
 				this.$parent.loggedIn &&
 				this.$parent.userId === this.station.owner
 			);
 		},
-		isAdminOnly: function() {
+		isAdminOnly() {
 			return this.$parent.loggedIn && this.$parent.role === "admin";
 		},
-		removeFromQueue: function(songId) {
+		removeFromQueue(songId) {
 			window.socket.emit(
 				"stations.removeFromQueue",
 				this.station._id,
@@ -509,14 +509,14 @@ export default {
 				}
 			);
 		},
-		toggleSidebar: function(type) {
+		toggleSidebar(type) {
 			Object.keys(this.sidebars).forEach(sidebar => {
 				if (sidebar !== type) this.sidebars[sidebar] = false;
 				else this.sidebars[type] = !this.sidebars[type];
 			});
 		},
-		youtubeReady: function() {
-			let local = this;
+		youtubeReady() {
+			const local = this;
 			if (!local.player) {
 				local.player = new window.YT.Player("player", {
 					height: 270,
@@ -532,7 +532,7 @@ export default {
 						showinfo: 0
 					},
 					events: {
-						onReady: function() {
+						onReady() {
 							local.playerReady = true;
 							let volume = parseInt(
 								localStorage.getItem("volume")
@@ -550,11 +550,11 @@ export default {
 
 							local.playVideo();
 						},
-						onError: function(err) {
+						onError(err) {
 							console.log("iframe error", err);
 							local.voteSkipStation();
 						},
-						onStateChange: function(event) {
+						onStateChange(event) {
 							if (
 								event.data === 1 &&
 								local.videoLoading === true
@@ -592,17 +592,18 @@ export default {
 				});
 			}
 		},
-		getTimeElapsed: function() {
-			let local = this;
+		getTimeElapsed() {
+			const local = this;
 			if (local.currentSong) {
-				let timePaused = local.timePaused;
+				let { timePaused } = local;
 				if (local.paused)
 					timePaused += Date.currently() - local.pausedAt;
 				return Date.currently() - local.startedAt - timePaused;
-			} else return 0;
+			}
+			return 0;
 		},
-		playVideo: function() {
-			let local = this;
+		playVideo() {
+			const local = this;
 			if (local.playerReady) {
 				local.videoLoading = true;
 				local.player.loadVideoById(
@@ -619,33 +620,34 @@ export default {
 				}, 150);
 			}
 		},
-		resizeSeekerbar: function() {
-			let local = this;
+		resizeSeekerbar() {
+			const local = this;
 			if (!local.paused) {
-				document.getElementsByClassName("seeker-bar")[0].style.width =
-					parseFloat(
-						(local.getTimeElapsed() /
-							1000 /
-							local.currentSong.duration) *
-							100
-					) + "%";
+				document.getElementsByClassName(
+					"seeker-bar"
+				)[0].style.width = `${parseFloat(
+					(local.getTimeElapsed() /
+						1000 /
+						local.currentSong.duration) *
+						100
+				)}%`;
 			}
 		},
-		formatTime: function(duration) {
-			let d = moment.duration(duration, "seconds");
+		formatTime(duration) {
+			const d = moment.duration(duration, "seconds");
 			if (duration < 0) return "0:00";
-			return (
-				(d.hours() > 0
+			return `${
+				d.hours() > 0
 					? d.hours() < 10
-						? "0" + d.hours() + ":"
-						: d.hours() + ":"
-					: "") +
-				(d.minutes() + ":") +
-				(d.seconds() < 10 ? "0" + d.seconds() : d.seconds())
-			);
+						? `0${d.hours()}:`
+						: `${d.hours()}:`
+					: ""
+			}${d.minutes()}:${
+				d.seconds() < 10 ? `0${d.seconds()}` : d.seconds()
+			}`;
 		},
-		calculateTimeElapsed: function() {
-			let local = this;
+		calculateTimeElapsed() {
+			const local = this;
 
 			if (
 				local.playerReady &&
@@ -669,57 +671,57 @@ export default {
 					}
 				} else {
 					local.player.playVideo();
-					local.attemptsToPlayVideo++;
+					local.attemptsToPlayVideo += 1;
 				}
 			}
 
 			if (!local.paused) {
-				let timeElapsed = local.getTimeElapsed();
-				let currentPlayerTime = local.player.getCurrentTime() * 1000;
+				const timeElapsed = local.getTimeElapsed();
+				const currentPlayerTime = local.player.getCurrentTime() * 1000;
 
-				let difference = timeElapsed - currentPlayerTime;
-				//console.log(difference123);
+				const difference = timeElapsed - currentPlayerTime;
+				// console.log(difference123);
 				if (difference < -200) {
-					//console.log("Difference0.8");
+					// console.log("Difference0.8");
 					local.player.setPlaybackRate(0.8);
 				} else if (difference < -50) {
-					//console.log("Difference0.9");
+					// console.log("Difference0.9");
 					local.player.setPlaybackRate(0.9);
 				} else if (difference < -25) {
-					//console.log("Difference0.99");
+					// console.log("Difference0.99");
 					local.player.setPlaybackRate(0.99);
 				} else if (difference > 200) {
-					//console.log("Difference1.2");
+					// console.log("Difference1.2");
 					local.player.setPlaybackRate(1.2);
 				} else if (difference > 50) {
-					//console.log("Difference1.1");
+					// console.log("Difference1.1");
 					local.player.setPlaybackRate(1.1);
 				} else if (difference > 25) {
-					//console.log("Difference1.01");
+					// console.log("Difference1.01");
 					local.player.setPlaybackRate(1.01);
 				} else if (local.player.getPlaybackRate !== 1.0) {
-					//console.log("NDifference1.0");
+					// console.log("NDifference1.0");
 					local.player.setPlaybackRate(1.0);
 				}
 			}
 
-			/*if (local.currentTime !== undefined && local.paused) {
+			/* if (local.currentTime !== undefined && local.paused) {
 				local.timePaused += Date.currently() - local.currentTime;
 				local.currentTime = undefined;
-			}*/
+			} */
 
-			let timePaused = local.timePaused;
+			let { timePaused } = local;
 			if (local.paused) timePaused += Date.currently() - local.pausedAt;
 
-			let duration =
+			const duration =
 				(Date.currently() - local.startedAt - timePaused) / 1000;
 
-			let songDuration = local.currentSong.duration;
+			const songDuration = local.currentSong.duration;
 			if (songDuration <= duration) local.player.pauseVideo();
 			if (!local.paused && duration <= songDuration)
 				local.timeElapsed = local.formatTime(duration);
 		},
-		toggleLock: function() {
+		toggleLock() {
 			window.socket.emit("stations.toggleLock", this.station._id, res => {
 				if (res.status === "success") {
 					Toast.methods.addToast(
@@ -729,9 +731,9 @@ export default {
 				} else Toast.methods.addToast(res.message, 8000);
 			});
 		},
-		changeVolume: function() {
-			let local = this;
-			let volume = document.getElementById("volumeSlider").value;
+		changeVolume() {
+			const local = this;
+			const volume = document.getElementById("volumeSlider").value;
 			localStorage.setItem("volume", volume / 100);
 			if (local.playerReady) {
 				local.player.setVolume(volume / 100);
@@ -742,7 +744,7 @@ export default {
 				}
 			}
 		},
-		resumeLocalStation: function() {
+		resumeLocalStation() {
 			this.paused = false;
 			if (!this.noSong) {
 				if (this.playerReady) {
@@ -754,15 +756,15 @@ export default {
 				}
 			}
 		},
-		pauseLocalStation: function() {
+		pauseLocalStation() {
 			this.paused = true;
 			if (!this.noSong) {
 				this.timeBeforePause = this.getTimeElapsed();
 				if (this.playerReady) this.player.pauseVideo();
 			}
 		},
-		skipStation: function() {
-			let _this = this;
+		skipStation() {
+			const _this = this;
 			_this.socket.emit("stations.forceSkip", _this.station._id, data => {
 				if (data.status !== "success")
 					Toast.methods.addToast(`Error: ${data.message}`, 8000);
@@ -773,8 +775,8 @@ export default {
 					);
 			});
 		},
-		voteSkipStation: function() {
-			let _this = this;
+		voteSkipStation() {
+			const _this = this;
 			_this.socket.emit("stations.voteSkip", _this.station._id, data => {
 				if (data.status !== "success")
 					Toast.methods.addToast(`Error: ${data.message}`, 8000);
@@ -785,8 +787,8 @@ export default {
 					);
 			});
 		},
-		resumeStation: function() {
-			let _this = this;
+		resumeStation() {
+			const _this = this;
 			_this.socket.emit("stations.resume", _this.station._id, data => {
 				if (data.status !== "success")
 					Toast.methods.addToast(`Error: ${data.message}`, 8000);
@@ -797,8 +799,8 @@ export default {
 					);
 			});
 		},
-		pauseStation: function() {
-			let _this = this;
+		pauseStation() {
+			const _this = this;
 			_this.socket.emit("stations.pause", _this.station._id, data => {
 				if (data.status !== "success")
 					Toast.methods.addToast(`Error: ${data.message}`, 8000);
@@ -809,10 +811,12 @@ export default {
 					);
 			});
 		},
-		toggleMute: function() {
+		toggleMute() {
 			if (this.playerReady) {
-				let previousVolume = parseFloat(localStorage.getItem("volume"));
-				let volume =
+				const previousVolume = parseFloat(
+					localStorage.getItem("volume")
+				);
+				const volume =
 					this.player.getVolume() * 100 <= 0 ? previousVolume : 0;
 				this.muted = !this.muted;
 				localStorage.setItem("muted", this.muted);
@@ -821,9 +825,9 @@ export default {
 				if (!this.muted) localStorage.setItem("volume", volume);
 			}
 		},
-		increaseVolume: function() {
+		increaseVolume() {
 			if (this.playerReady) {
-				let previousVolume = parseInt(localStorage.getItem("volume"));
+				const previousVolume = parseInt(localStorage.getItem("volume"));
 				let volume = previousVolume + 5;
 				if (previousVolume === 0) {
 					this.muted = false;
@@ -835,8 +839,8 @@ export default {
 				localStorage.setItem("volume", volume);
 			}
 		},
-		toggleLike: function() {
-			let _this = this;
+		toggleLike() {
+			const _this = this;
 			if (_this.liked)
 				_this.socket.emit(
 					"songs.unlike",
@@ -862,8 +866,8 @@ export default {
 					}
 				);
 		},
-		toggleDislike: function() {
-			let _this = this;
+		toggleDislike() {
+			const _this = this;
 			if (_this.disliked)
 				return _this.socket.emit(
 					"songs.undislike",
@@ -876,7 +880,8 @@ export default {
 							);
 					}
 				);
-			_this.socket.emit(
+
+			return _this.socket.emit(
 				"songs.dislike",
 				_this.currentSong.songId,
 				data => {
@@ -885,10 +890,10 @@ export default {
 				}
 			);
 		},
-		addFirstPrivatePlaylistSongToQueue: function() {
-			let _this = this;
+		addFirstPrivatePlaylistSongToQueue() {
+			const _this = this;
 			let isInQueue = false;
-			let userId = _this.$parent.userId;
+			const { userId } = _this.$parent;
 			if (_this.type === "community") {
 				_this.songsList.forEach(queueSong => {
 					if (queueSong.requestedBy === userId) isInQueue = true;
@@ -946,8 +951,8 @@ export default {
 				}
 			}
 		},
-		join: function() {
-			let _this = this;
+		join() {
+			const _this = this;
 			_this.socket.emit("stations.join", _this.stationName, res => {
 				if (res.status === "success") {
 					_this.loading = false;
@@ -1015,17 +1020,17 @@ export default {
 						_this.noSong = true;
 					}
 					// UNIX client time before ping
-					let beforePing = Date.now();
-					_this.socket.emit("apis.ping", res => {
+					const beforePing = Date.now();
+					_this.socket.emit("apis.ping", pong => {
 						// UNIX client time after ping
-						let afterPing = Date.now();
+						const afterPing = Date.now();
 						// Average time in MS it took between the server responding and the client receiving
-						let connectionLatency = (afterPing - beforePing) / 2;
+						const connectionLatency = (afterPing - beforePing) / 2;
 						console.log(connectionLatency, beforePing - afterPing);
 						// UNIX server time
-						let serverDate = res.date;
+						const serverDate = pong.date;
 						// Difference between the server UNIX time and the client UNIX time after ping, with the connectionLatency added to the server UNIX time
-						let difference =
+						const difference =
 							serverDate + connectionLatency - afterPing;
 						console.log("Difference: ", difference);
 						if (difference > 3000 || difference < -3000) {
@@ -1041,8 +1046,8 @@ export default {
 		...mapActions("modals", ["openModal"]),
 		...mapActions("station", ["joinStation"])
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 
 		Date.currently = () => {
 			return new Date().getTime() + _this.systemDifference;
@@ -1089,10 +1094,10 @@ export default {
 					_this.socket.emit(
 						"songs.getOwnSongRatings",
 						data.currentSong.songId,
-						data => {
-							if (_this.currentSong.songId === data.songId) {
-								_this.liked = data.liked;
-								_this.disliked = data.disliked;
+						song => {
+							if (_this.currentSong.songId === song.songId) {
+								_this.liked = song.liked;
+								_this.disliked = song.disliked;
 							}
 						}
 					);
@@ -1102,7 +1107,7 @@ export default {
 				}
 
 				let isInQueue = false;
-				let userId = _this.$parent.userId;
+				const { userId } = _this.$parent;
 				_this.songsList.forEach(queueSong => {
 					if (queueSong.requestedBy === userId) isInQueue = true;
 				});
@@ -1127,10 +1132,10 @@ export default {
 				_this.resumeLocalStation();
 			});
 
-			_this.socket.on(
-				"event:stations.remove",
-				() => (location.href = "/")
-			);
+			_this.socket.on("event:stations.remove", () => {
+				window.location.href = "/";
+				return true;
+			});
 
 			_this.socket.on("event:song.like", data => {
 				if (!this.noSong) {
@@ -1182,7 +1187,7 @@ export default {
 			});
 
 			_this.socket.on("event:song.voteSkipSong", () => {
-				if (this.currentSong) this.currentSong.skipVotes++;
+				if (this.currentSong) this.currentSong.skipVotes += 1;
 			});
 
 			_this.socket.on("event:privatePlaylist.selected", playlistId => {
@@ -1222,7 +1227,10 @@ export default {
 			document.getElementById("volumeSlider").value = 0 * 100;
 		} else {
 			let volume = parseFloat(localStorage.getItem("volume"));
-			volume = typeof volume === "number" && !isNaN(volume) ? volume : 20;
+			volume =
+				typeof volume === "number" && !Number.isNaN(volume)
+					? volume
+					: 20;
 			localStorage.setItem("volume", volume);
 			document.getElementById("volumeSlider").value = volume * 100;
 		}

+ 16 - 12
frontend/components/User/ResetPassword.vue

@@ -85,27 +85,31 @@ export default {
 			step: 1
 		};
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 		});
 	},
 	methods: {
-		submitEmail: function() {
+		submitEmail() {
 			if (!this.email)
 				return Toast.methods.addToast("Email cannot be empty", 8000);
-			this.socket.emit("users.requestPasswordReset", this.email, res => {
-				Toast.methods.addToast(res.message, 8000);
-				if (res.status === "success") {
-					this.step = 2;
+			return this.socket.emit(
+				"users.requestPasswordReset",
+				this.email,
+				res => {
+					Toast.methods.addToast(res.message, 8000);
+					if (res.status === "success") {
+						this.step = 2;
+					}
 				}
-			});
+			);
 		},
-		verifyCode: function() {
+		verifyCode() {
 			if (!this.code)
 				return Toast.methods.addToast("Code cannot be empty", 8000);
-			this.socket.emit(
+			return this.socket.emit(
 				"users.verifyPasswordResetCode",
 				this.code,
 				res => {
@@ -116,10 +120,10 @@ export default {
 				}
 			);
 		},
-		changePassword: function() {
+		changePassword() {
 			if (!this.newPassword)
 				return Toast.methods.addToast("Password cannot be empty", 8000);
-			this.socket.emit(
+			return this.socket.emit(
 				"users.changePasswordWithResetCode",
 				this.code,
 				this.newPassword,

+ 32 - 28
frontend/components/User/Settings.vue

@@ -167,12 +167,12 @@ export default {
 			passwordCode: ""
 		};
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket.emit("users.findBySession", res => {
-				if (res.status == "success") {
+				if (res.status === "success") {
 					_this.user = res.data;
 					_this.password = _this.user.password;
 					_this.github = _this.user.github;
@@ -202,7 +202,7 @@ export default {
 		});
 	},
 	methods: {
-		changeEmail: function() {
+		changeEmail() {
 			const email = this.user.email.address;
 			if (!validation.isLength(email, 3, 254))
 				return Toast.methods.addToast(
@@ -215,7 +215,7 @@ export default {
 			)
 				return Toast.methods.addToast("Invalid email format.", 8000);
 
-			this.socket.emit(
+			return this.socket.emit(
 				"users.updateEmail",
 				this.$parent.userId,
 				email,
@@ -230,8 +230,8 @@ export default {
 				}
 			);
 		},
-		changeUsername: function() {
-			const username = this.user.username;
+		changeUsername() {
+			const { username } = this.user;
 			if (!validation.isLength(username, 2, 32))
 				return Toast.methods.addToast(
 					"Username must have between 2 and 32 characters.",
@@ -243,7 +243,7 @@ export default {
 					8000
 				);
 
-			this.socket.emit(
+			return this.socket.emit(
 				"users.updateUsername",
 				this.$parent.userId,
 				username,
@@ -258,8 +258,8 @@ export default {
 				}
 			);
 		},
-		changePassword: function() {
-			const newPassword = this.newPassword;
+		changePassword() {
+			const { newPassword } = this;
 			if (!validation.isLength(newPassword, 6, 200))
 				return Toast.methods.addToast(
 					"Password must have between 6 and 200 characters.",
@@ -271,28 +271,32 @@ export default {
 					8000
 				);
 
-			this.socket.emit("users.updatePassword", newPassword, res => {
-				if (res.status !== "success")
-					Toast.methods.addToast(res.message, 8000);
-				else
-					Toast.methods.addToast(
-						"Successfully changed password",
-						4000
-					);
-			});
+			return this.socket.emit(
+				"users.updatePassword",
+				newPassword,
+				res => {
+					if (res.status !== "success")
+						Toast.methods.addToast(res.message, 8000);
+					else
+						Toast.methods.addToast(
+							"Successfully changed password",
+							4000
+						);
+				}
+			);
 		},
-		requestPassword: function() {
-			this.socket.emit("users.requestPassword", res => {
+		requestPassword() {
+			return this.socket.emit("users.requestPassword", res => {
 				Toast.methods.addToast(res.message, 8000);
 				if (res.status === "success") {
 					this.passwordStep = 2;
 				}
 			});
 		},
-		verifyCode: function() {
+		verifyCode() {
 			if (!this.passwordCode)
 				return Toast.methods.addToast("Code cannot be empty", 8000);
-			this.socket.emit(
+			return this.socket.emit(
 				"users.verifyPasswordCode",
 				this.passwordCode,
 				res => {
@@ -303,7 +307,7 @@ export default {
 				}
 			);
 		},
-		setPassword: function() {
+		setPassword() {
 			const newPassword = this.setNewPassword;
 			if (!validation.isLength(newPassword, 6, 200))
 				return Toast.methods.addToast(
@@ -316,7 +320,7 @@ export default {
 					8000
 				);
 
-			this.socket.emit(
+			return this.socket.emit(
 				"users.changePasswordWithCode",
 				this.passwordCode,
 				newPassword,
@@ -325,17 +329,17 @@ export default {
 				}
 			);
 		},
-		unlinkPassword: function() {
+		unlinkPassword() {
 			this.socket.emit("users.unlinkPassword", res => {
 				Toast.methods.addToast(res.message, 8000);
 			});
 		},
-		unlinkGitHub: function() {
+		unlinkGitHub() {
 			this.socket.emit("users.unlinkGitHub", res => {
 				Toast.methods.addToast(res.message, 8000);
 			});
 		},
-		removeSessions: function() {
+		removeSessions() {
 			this.socket.emit(
 				`users.removeSessions`,
 				this.$parent.userId,

+ 5 - 5
frontend/components/User/Show.vue

@@ -78,15 +78,15 @@ export default {
 			isUser: false
 		};
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket.emit(
 				"users.findByUsername",
 				_this.$route.params.username,
 				res => {
-					if (res.status == "error") this.$router.go("/404");
+					if (res.status === "error") this.$router.go("/404");
 					else {
 						_this.user = res.data;
 						this.user.createdAt = moment(
@@ -103,9 +103,9 @@ export default {
 			this.socket.emit(
 				"users.updateRole",
 				this.user._id,
-				newRank == "admin" ? "admin" : "default",
+				newRank === "admin" ? "admin" : "default",
 				res => {
-					if (res.status == "error")
+					if (res.status === "error")
 						Toast.methods.addToast(res.message, 2000);
 					else this.user.role = newRank;
 					Toast.methods.addToast(

+ 2 - 2
frontend/components/UserIdToUsername.vue

@@ -15,7 +15,7 @@ import { mapState, mapActions } from "vuex";
 
 export default {
 	props: ["userId", "link"],
-	data: function() {
+	data() {
 		return {
 			username: ""
 		};
@@ -28,7 +28,7 @@ export default {
 	methods: {
 		...mapActions("user/auth", ["getUsernameFromId"])
 	},
-	mounted: function() {
+	mounted() {
 		this.getUsernameFromId(this.$props.userId).then(res => {
 			this.username = res;
 		});

+ 1 - 1
frontend/components/pages/About.vue

@@ -71,7 +71,7 @@ export default {
 	data() {
 		return {};
 	},
-	mounted: function() {},
+	mounted() {},
 	methods: {}
 };
 </script>

+ 2 - 2
frontend/components/pages/Admin.vue

@@ -130,7 +130,7 @@ export default {
 		}
 	},
 	methods: {
-		changeTab: function(path) {
+		changeTab(path) {
 			switch (path) {
 				case "/admin/queuesongs":
 					this.currentTab = "queueSongs";
@@ -160,7 +160,7 @@ export default {
 					this.currentTab = "queueSongs";
 			}
 		},
-		showTab: function(tab) {
+		showTab(tab) {
 			this.currentTab = tab;
 		}
 	}

+ 45 - 42
frontend/components/pages/Home.vue

@@ -174,7 +174,7 @@ export default {
 		modals: state => state.modals.home
 	}),
 	mounted() {
-		let _this = this;
+		const _this = this;
 		auth.getStatus(() => {
 			io.getSocket(socket => {
 				_this.socket = socket;
@@ -182,7 +182,9 @@ export default {
 				io.onConnect(() => {
 					_this.init();
 				});
-				_this.socket.on("event:stations.created", station => {
+				_this.socket.on("event:stations.created", res => {
+					const station = res;
+
 					if (!station.currentSong)
 						station.currentSong = {
 							thumbnail: "/assets/notes-transparent.png"
@@ -195,63 +197,64 @@ export default {
 				_this.socket.on(
 					"event:userCount.updated",
 					(stationId, userCount) => {
-						_this.stations.official.forEach(station => {
+						_this.stations.official.forEach(s => {
+							const station = s;
 							if (station._id === stationId) {
 								station.userCount = userCount;
 							}
 						});
 
-						_this.stations.community.forEach(station => {
+						_this.stations.community.forEach(s => {
+							const station = s;
 							if (station._id === stationId) {
 								station.userCount = userCount;
 							}
 						});
 					}
 				);
-				_this.socket.on(
-					"event:station.nextSong",
-					(stationId, newSong) => {
-						_this.stations.official.forEach(station => {
-							if (station._id === stationId) {
-								if (!newSong)
-									newSong = {
-										thumbnail:
-											"/assets/notes-transparent.png"
-									};
-								if (newSong && !newSong.thumbnail)
-									newSong.thumbnail =
-										"/assets/notes-transparent.png";
-								station.currentSong = newSong;
-							}
-						});
-
-						_this.stations.community.forEach(station => {
-							if (station._id === stationId) {
-								if (!newSong)
-									newSong = {
-										thumbnail:
-											"/assets/notes-transparent.png"
-									};
-								if (newSong && !newSong.thumbnail)
-									newSong.thumbnail =
-										"/assets/notes-transparent.png";
-								station.currentSong = newSong;
-							}
-						});
-					}
-				);
+				_this.socket.on("event:station.nextSong", (stationId, song) => {
+					let newSong = song;
+					_this.stations.official.forEach(s => {
+						const station = s;
+						if (station._id === stationId) {
+							if (!newSong)
+								newSong = {
+									thumbnail: "/assets/notes-transparent.png"
+								};
+							if (newSong && !newSong.thumbnail)
+								newSong.thumbnail =
+									"/assets/notes-transparent.png";
+							station.currentSong = newSong;
+						}
+					});
+
+					_this.stations.community.forEach(s => {
+						const station = s;
+						if (station._id === stationId) {
+							if (!newSong)
+								newSong = {
+									thumbnail: "/assets/notes-transparent.png"
+								};
+							if (newSong && !newSong.thumbnail)
+								newSong.thumbnail =
+									"/assets/notes-transparent.png";
+							station.currentSong = newSong;
+						}
+					});
+				});
 			});
 		});
 	},
 	methods: {
-		init: function() {
-			let _this = this;
+		init() {
+			const _this = this;
 			auth.getStatus((authenticated, role, username, userId) => {
 				_this.socket.emit("stations.index", data => {
 					_this.stations.community = [];
 					_this.stations.official = [];
 					if (data.status === "success")
-						data.stations.forEach(station => {
+						data.stations.forEach(s => {
+							const station = s;
 							if (!station.currentSong)
 								station.currentSong = {
 									thumbnail: "/assets/notes-transparent.png"
@@ -269,7 +272,7 @@ export default {
 								station.owner === userId
 							)
 								station.class = { "station-blue": true };
-							if (station.type == "official")
+							if (station.type === "official")
 								_this.stations.official.push(station);
 							else _this.stations.community.push(station);
 						});
@@ -277,8 +280,8 @@ export default {
 				_this.socket.emit("apis.joinRoom", "home", () => {});
 			});
 		},
-		isOwner: function(station) {
-			let _this = this;
+		isOwner(station) {
+			const _this = this;
 			return (
 				station.owner === _this.$parent.userId &&
 				station.privacy === "public"

+ 3 - 3
frontend/components/pages/News.vue

@@ -89,8 +89,8 @@ export default {
 			noFound: false
 		};
 	},
-	mounted: function() {
-		let _this = this;
+	mounted() {
+		const _this = this;
 		io.getSocket(socket => {
 			_this.socket = socket;
 			_this.socket.emit("news.index", res => {
@@ -102,7 +102,7 @@ export default {
 				_this.noFound = false;
 			});
 			_this.socket.on("event:admin.news.updated", news => {
-				for (let n = 0; n < _this.news.length; n++) {
+				for (let n = 0; n < _this.news.length; n += 1) {
 					if (_this.news[n]._id === news._id) {
 						_this.news.$set(n, news);
 					}

+ 23 - 25
frontend/io.js

@@ -3,40 +3,38 @@ let callbacksPersist = [];
 let onConnectCallbacks = [];
 let onDisconnectCallbacks = [];
 let onConnectErrorCallbacks = [];
-let onConnectCallbacksPersist = [];
-let onDisconnectCallbacksPersist = [];
-let onConnectErrorCallbacksPersist = [];
+const onConnectCallbacksPersist = [];
+const onDisconnectCallbacksPersist = [];
+const onConnectErrorCallbacksPersist = [];
 
 export default {
 	ready: false,
 	socket: null,
 
-	getSocket: function() {
-		if (arguments[0] === true) {
-			if (this.ready) arguments[1](this.socket);
-			else callbacksPersist.push(arguments[1]);
-		} else {
-			if (this.ready) arguments[0](this.socket);
-			else callbacks.push(arguments[0]);
-		}
+	getSocket(...args) {
+		if (args[0] === true) {
+			if (this.ready) args[1](this.socket);
+			else callbacksPersist.push(args[1]);
+		} else if (this.ready) args[0](this.socket);
+		else callbacks.push(args[0]);
 	},
 
-	onConnect: function() {
-		if (arguments[0] === true) {
-			onConnectCallbacksPersist.push(arguments[1]);
-		} else onConnectCallbacks.push(arguments[0]);
+	onConnect(...args) {
+		if (args[0] === true) {
+			onConnectCallbacksPersist.push(args[1]);
+		} else onConnectCallbacks.push(args[0]);
 	},
 
-	onDisconnect: function() {
-		if (arguments[0] === true) {
-			onDisconnectCallbacksPersist.push(arguments[1]);
-		} else onDisconnectCallbacks.push(arguments[0]);
+	onDisconnect(...args) {
+		if (args[0] === true) {
+			onDisconnectCallbacksPersist.push(args[1]);
+		} else onDisconnectCallbacks.push(args[0]);
 	},
 
-	onConnectError: function() {
-		if (arguments[0] === true) {
-			onConnectErrorCallbacksPersist.push(arguments[1]);
-		} else onConnectErrorCallbacks.push(arguments[0]);
+	onConnectError(...args) {
+		if (args[0] === true) {
+			onConnectErrorCallbacksPersist.push(args[1]);
+		} else onConnectErrorCallbacks.push(args[0]);
 	},
 
 	clear: () => {
@@ -46,7 +44,7 @@ export default {
 		callbacks = [];
 	},
 
-	removeAllListeners: function() {
+	removeAllListeners() {
 		Object.keys(this.socket._callbacks).forEach(id => {
 			if (
 				id.indexOf("$event:") !== -1 &&
@@ -57,7 +55,7 @@ export default {
 		});
 	},
 
-	init: function(url) {
+	init(url) {
 		/* eslint-disable-next-line no-undef */
 		this.socket = window.socket = io(url);
 		this.socket.on("connect", () => {

+ 3 - 2
frontend/main.js

@@ -9,7 +9,7 @@ import io from "./io";
 
 Vue.use(VueRouter);
 
-let router = new VueRouter({
+const router = new VueRouter({
 	mode: "history",
 	routes: [
 		{
@@ -93,7 +93,7 @@ let router = new VueRouter({
 });
 
 lofig.folder = "../config/default.json";
-lofig.get("serverDomain", function(res) {
+lofig.get("serverDomain", res => {
 	io.init(res);
 	io.getSocket(socket => {
 		socket.on("ready", (status, role, username, userId) => {
@@ -154,6 +154,7 @@ router.afterEach(to => {
 	ga("send", "pageview");
 });
 
+// eslint-disable-next-line no-new
 new Vue({
 	router,
 	store,

+ 2 - 0
frontend/store/modules/admin.js

@@ -1,3 +1,5 @@
+/* eslint no-param-reassign: 0 */
+
 const state = {};
 const getters = {};
 const actions = {};

+ 2 - 0
frontend/store/modules/modals.js

@@ -1,3 +1,5 @@
+/* eslint no-param-reassign: 0 */
+
 const state = {
 	modals: {
 		header: {

+ 2 - 0
frontend/store/modules/station.js

@@ -1,3 +1,5 @@
+/* eslint no-param-reassign: 0 */
+
 const state = {
 	station: {},
 	editing: {}

+ 6 - 2
frontend/store/modules/user.js

@@ -1,3 +1,5 @@
+/* eslint no-param-reassign: 0 */
+
 import auth from "../../api/auth";
 import io from "../../io";
 import validation from "../../validation";
@@ -72,7 +74,8 @@ const modules = {
 								"Invalid password format. Must have one lowercase letter, one uppercase letter, one number and one special character."
 						});
 
-					auth.register(user)
+					return auth
+						.register(user)
 						.then(() => {
 							return resolve({
 								status: "success",
@@ -131,7 +134,8 @@ const modules = {
 											);
 
 											return resolve(res.data);
-										} else return resolve();
+										}
+										return resolve();
 									}
 								);
 							});

+ 1 - 1
frontend/webpack.common.js

@@ -5,7 +5,7 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
 module.exports = {
 	entry: "./main.js",
 	output: {
-		path: __dirname + "/dist/build/",
+		path: `${__dirname}/dist/build/`,
 		filename: "[name].[hash].js"
 	},
 	plugins: [

+ 1 - 1
frontend/webpack.dev.js

@@ -1,4 +1,4 @@
-process.env["NODE_CONFIG_DIR"] = __dirname + "/dist/config/";
+process.env.NODE_CONFIG_DIR = `${__dirname}/dist/config/`;
 const config = require("config");
 
 const merge = require("webpack-merge");