From 2a93e5d2a3b820a1e504c2dea61fc995c936486b Mon Sep 17 00:00:00 2001 From: Jiiks Date: Mon, 4 Mar 2019 10:25:00 +0200 Subject: [PATCH] lint --- client/src/modules/discordapi.js | 3 +++ client/src/modules/reflection/modules.js | 2 +- client/src/modules/reflection/wpm.depr.js | 2 +- client/src/modules/theme.js | 7 ++++--- client/src/structs/discord/channel.js | 4 ++-- client/src/structs/discord/guild.js | 4 ++-- client/src/structs/discord/message.js | 13 +++++++------ client/src/structs/discord/user.js | 2 +- client/src/ui/vueinjector.js | 2 +- 9 files changed, 22 insertions(+), 17 deletions(-) diff --git a/client/src/modules/discordapi.js b/client/src/modules/discordapi.js index 1f9c4cae..40a86b83 100644 --- a/client/src/modules/discordapi.js +++ b/client/src/modules/discordapi.js @@ -126,6 +126,7 @@ export default class DiscordApi { static get currentGuild() { const guild = Modules.GuildStore.getGuild(Modules.SelectedGuildStore.getGuildId()); if (guild) return Guild.from(guild); + return null; } /** @@ -135,6 +136,7 @@ export default class DiscordApi { static get currentChannel() { const channel = Modules.ChannelStore.getChannel(Modules.SelectedChannelStore.getChannelId()); if (channel) return Channel.from(channel); + return null; } /** @@ -144,6 +146,7 @@ export default class DiscordApi { static get currentUser() { const user = Modules.UserStore.getCurrentUser(); if (user) return User.from(user); + return null; } /** diff --git a/client/src/modules/reflection/modules.js b/client/src/modules/reflection/modules.js index e7ae2475..2ba57675 100644 --- a/client/src/modules/reflection/modules.js +++ b/client/src/modules/reflection/modules.js @@ -288,7 +288,7 @@ class Module { if (this._require) return this._require; const __webpack_require__ = this.getWebpackRequire(); - if (!__webpack_require__) return; + if (!__webpack_require__) return null; this.hookWebpackRequireCache(__webpack_require__); return this._require = __webpack_require__; diff --git a/client/src/modules/reflection/wpm.depr.js b/client/src/modules/reflection/wpm.depr.js index 0e1e8fdb..005ca190 100644 --- a/client/src/modules/reflection/wpm.depr.js +++ b/client/src/modules/reflection/wpm.depr.js @@ -272,7 +272,7 @@ class WebpackModules { if (this._require) return this._require; const __webpack_require__ = this.getWebpackRequire(); - if (!__webpack_require__) return; + if (!__webpack_require__) return null; this.hookWebpackRequireCache(__webpack_require__); return this._require = __webpack_require__; diff --git a/client/src/modules/theme.js b/client/src/modules/theme.js index fc5628e1..f8da17a1 100644 --- a/client/src/modules/theme.js +++ b/client/src/modules/theme.js @@ -69,10 +69,11 @@ export default class Theme extends Content { path: this.paths.mainPath.replace(/\\/g, '/') }); + // Why are these getters? Logger.log(this.name, ['Finished compiling theme', new class Info { - get SCSS_variables() { console.log(config); } - get Compiled_SCSS() { console.log(result.css.toString()); } - get Result() { console.log(result); } + get SCSS_variables() { console.log(config); return ''; } + get Compiled_SCSS() { console.log(result.css.toString()); return ''; } + get Result() { console.log(result); return ''; } }]); return { diff --git a/client/src/structs/discord/channel.js b/client/src/structs/discord/channel.js index 4b6bd362..d7833092 100644 --- a/client/src/structs/discord/channel.js +++ b/client/src/structs/discord/channel.js @@ -179,7 +179,7 @@ export class PermissionOverwrite { } get guild() { - if (this.channel) return this.channel.guild; + return this.channel ? this.channel.guild : null; } } @@ -187,7 +187,7 @@ export class RolePermissionOverwrite extends PermissionOverwrite { get roleId() { return this.discordObject.id } get role() { - if (this.guild) return this.guild.roles.find(r => r.id === this.roleId); + return this.guild ? this.guild.roles.find(r => r.id === this.roleId) : null; } } diff --git a/client/src/structs/discord/guild.js b/client/src/structs/discord/guild.js index 3e419046..16109938 100644 --- a/client/src/structs/discord/guild.js +++ b/client/src/structs/discord/guild.js @@ -166,14 +166,14 @@ export class Guild { * The guild's AFK channel. */ get afkChannel() { - if (this.afkChannelId) return Channel.fromId(this.afkChannelId); + return this.afkChannelId ? Channel.fromId(this.afkChannelId) : null; } /** * The channel system messages are sent to. */ get systemChannel() { - if (this.systemChannelId) return Channel.fromId(this.systemChannelId); + return this.systemChannelId ? Channel.fromId(this.systemChannelId) : null; } /** diff --git a/client/src/structs/discord/message.js b/client/src/structs/discord/message.js index feb240be..7b6059d0 100644 --- a/client/src/structs/discord/message.js +++ b/client/src/structs/discord/message.js @@ -42,11 +42,11 @@ export class Reaction { } get message() { - if (this.channel) return this.channel.messages.find(m => m.id === this.messageId); + return this.channel ? this.channel.messages.find(m => m.id === this.messageId) : null; } get guild() { - if (this.channel) return this.channel.guild; + return this.channel ? this.channel.guild : null; } } @@ -84,11 +84,11 @@ export class Embed { } get message() { - if (this.channel) return this.channel.messages.find(m => m.id === this.messageId); + return this.channel ? this.channel.messages.find(m => m.id === this.messageId) : null; } get guild() { - if (this.channel) return this.channel.guild; + return this.channel ? this.channel.guild : null; } } @@ -143,6 +143,7 @@ export class Message { get author() { if (this.discordObject.author && !this.webhookId) return User.from(this.discordObject.author); + return null; } get channel() { @@ -150,7 +151,7 @@ export class Message { } get guild() { - if (this.channel) return this.channel.guild; + return this.channel ? this.channel.guild : null; } /** @@ -202,7 +203,7 @@ export class DefaultMessage extends Message { get application() { return this.discordObject.application } get webhook() { - if (this.webhookId) return this.discordObject.author; + return this.webhookId ? this.discordObject.author : null; } get mentions() { diff --git a/client/src/structs/discord/user.js b/client/src/structs/discord/user.js index 086d3504..b1c44395 100644 --- a/client/src/structs/discord/user.js +++ b/client/src/structs/discord/user.js @@ -77,7 +77,7 @@ export class User { get note() { const note = Modules.UserNoteStore.getNote(this.id); - if (note) return note; + return note ? note : null; } /** diff --git a/client/src/ui/vueinjector.js b/client/src/ui/vueinjector.js index d506710b..4a94b541 100644 --- a/client/src/ui/vueinjector.js +++ b/client/src/ui/vueinjector.js @@ -71,7 +71,7 @@ export default class { get vueMount() { const element = ReactDOM.findDOMNode(this); - if (!element) return; + if (!element) return null; if (this.props.mountAtTop) return element; if (element.firstChild) return element.firstChild; const newElement = document.createElement('span');