From d09293c9752fc0331d916d0cf46aa68e8bee1d08 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Sat, 16 Nov 2019 10:39:28 -0800 Subject: [PATCH] Fix lints --- experiments/skin-database/data/skins.js | 4 +- .../discord-bot/commands/tweet.js | 3 +- experiments/skin-database/graphql.js | 8 ++-- modern/src/runtime/GuiObject.ts | 44 +++++++++---------- 4 files changed, 29 insertions(+), 30 deletions(-) diff --git a/experiments/skin-database/data/skins.js b/experiments/skin-database/data/skins.js index a30aa890..cbd81640 100644 --- a/experiments/skin-database/data/skins.js +++ b/experiments/skin-database/data/skins.js @@ -9,14 +9,14 @@ const TWEETABLE_QUERY = { tweeted: { $ne: true }, approved: true, rejected: { $ne: true }, - type: "CLASSIC" + type: "CLASSIC", }; const REVIEWABLE_QUERY = { tweeted: { $ne: true }, approved: { $ne: true }, rejected: { $ne: true }, - type: "CLASSIC" + type: "CLASSIC", }; function getSkinRecord(skin) { const { diff --git a/experiments/skin-database/discord-bot/commands/tweet.js b/experiments/skin-database/discord-bot/commands/tweet.js index 63d48411..b83b88ee 100644 --- a/experiments/skin-database/discord-bot/commands/tweet.js +++ b/experiments/skin-database/discord-bot/commands/tweet.js @@ -1,7 +1,7 @@ const tweet = require("../../tasks/tweet"); const { CAPTBARITONE_USER_ID } = require("../../config"); -async function handler(message, args) { +async function handler(message) { if (message.author.id !== CAPTBARITONE_USER_ID) { await message.channel.send( `Currently only @captbaritone can use this command` @@ -9,7 +9,6 @@ async function handler(message, args) { return; } await tweet(message.client); - client.destroy(); } module.exports = { diff --git a/experiments/skin-database/graphql.js b/experiments/skin-database/graphql.js index 9c418e80..51694f3c 100644 --- a/experiments/skin-database/graphql.js +++ b/experiments/skin-database/graphql.js @@ -1,9 +1,9 @@ -var graphqlHTTP = require("express-graphql"); -var { buildSchema } = require("graphql"); +const graphqlHTTP = require("express-graphql"); +const { buildSchema } = require("graphql"); const Skins = require("./data/skins"); // Construct a schema, using GraphQL schema language -var schema = buildSchema(` +const schema = buildSchema(` enum TweetStatus { TWEETED REJECTED @@ -120,7 +120,7 @@ class Skin { } // The root provides a resolver function for each API endpoint -var root = { +const root = { skin: ({ md5 }) => { return new Skin(md5); }, diff --git a/modern/src/runtime/GuiObject.ts b/modern/src/runtime/GuiObject.ts index 3d9b4624..6048e1a3 100644 --- a/modern/src/runtime/GuiObject.ts +++ b/modern/src/runtime/GuiObject.ts @@ -143,38 +143,38 @@ class GuiObject extends MakiObject { getheight(): number { if (this.attributes.h !== undefined) { return Number(this.attributes.h); - } else { - const baseImage = baseImageAttributeFromObject(this); - if (baseImage) { - // TODO: fix the type on this, we currently have better typing for this in - // AnimatedLayer where we convert to _typedAttributes, as we apply that new - // standard up to GuiObject/MakiObject we should be able to remove the ignore - // @ts-ignore - const image = this.attributes.js_assets[baseImage]; - if (image && image.h !== undefined) { - return image.h; - } + } + const baseImage = baseImageAttributeFromObject(this); + if (baseImage) { + // TODO: fix the type on this, we currently have better typing for this in + // AnimatedLayer where we convert to _typedAttributes, as we apply that new + // standard up to GuiObject/MakiObject we should be able to remove the ignore + // @ts-ignore + const image = this.attributes.js_assets[baseImage]; + if (image && image.h !== undefined) { + return image.h; } } + return 0; } getwidth(): number { if (this.attributes.w !== undefined) { return Number(this.attributes.w); - } else { - const baseImage = baseImageAttributeFromObject(this); - if (baseImage) { - // TODO: fix the type on this, we currently have better typing for this in - // AnimatedLayer where we convert to _typedAttributes, as we apply that new - // standard up to GuiObject/MakiObject we should be able to remove the ignore - // @ts-ignore - const image = this.attributes.js_assets[baseImage]; - if (image && image.w !== undefined) { - return image.w; - } + } + const baseImage = baseImageAttributeFromObject(this); + if (baseImage) { + // TODO: fix the type on this, we currently have better typing for this in + // AnimatedLayer where we convert to _typedAttributes, as we apply that new + // standard up to GuiObject/MakiObject we should be able to remove the ignore + // @ts-ignore + const image = this.attributes.js_assets[baseImage]; + if (image && image.w !== undefined) { + return image.w; } } + return 0; }