diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-06-21 16:11:14 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-06-21 16:11:14 -0400 |
commit | 982d71f81f00495b9aed518da1b7bdfb4e50010f (patch) | |
tree | 1bc072483748493b195dd561d7f0d27a10fe4dff | |
parent | 4cfd0de634d2883ba84919abc4b9e7ebc025ec27 (diff) | |
download | tanzanite-982d71f81f00495b9aed518da1b7bdfb4e50010f.tar.gz tanzanite-982d71f81f00495b9aed518da1b7bdfb4e50010f.tar.bz2 tanzanite-982d71f81f00495b9aed518da1b7bdfb4e50010f.zip |
fix(*): eslint
-rw-r--r-- | .vscode/extensions.json | 16 | ||||
-rw-r--r-- | .vscode/settings.json | 66 | ||||
-rw-r--r-- | .yarn/sdks/typescript/package.json | 2 | ||||
-rw-r--r-- | src/config/example-options.ts | 7 | ||||
-rw-r--r-- | src/lib/extensions/BushClient.ts | 2 | ||||
-rw-r--r-- | src/lib/extensions/BushClientUtil.ts | 10 | ||||
-rw-r--r-- | src/tasks/updateCache.ts | 11 |
7 files changed, 60 insertions, 54 deletions
diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 94a8b5c..d3de569 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,10 +1,10 @@ { - "recommendations": [ - "aaron-bond.better-comments", - "arcanis.vscode-zipfs", - "dbaeumer.vscode-eslint", - "eamodio.gitlens", - "esbenp.prettier-vscode", - "streetsidesoftware.code-spell-checker" - ] + "recommendations": [ + "aaron-bond.better-comments", + "arcanis.vscode-zipfs", + "dbaeumer.vscode-eslint", + "eamodio.gitlens", + "esbenp.prettier-vscode", + "streetsidesoftware.code-spell-checker" + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index b91434b..3b10249 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,35 +1,35 @@ { - "files.exclude": { - "**/.git": true, - "**/.svn": true, - "**/.hg": true, - "**/CVS": true, - "**/.DS_Store": true, - "node_modules": true, - "dist": true - }, - "javascript.preferences.importModuleSpecifier": "project-relative", - "typescript.preferences.importModuleSpecifier": "project-relative", - "typescript.preferences.importModuleSpecifierEnding": "minimal", - "search.exclude": { - "**/.yarn": true, - "**/.pnp.*": true - }, - "editor.codeActionsOnSave": { - "source.organizeImports": true, - "source.fixAll.eslint": true, - "source.format": true - }, - "editor.formatOnSave": true, - "diffEditor.wordWrap": "on", - "editor.insertSpaces": false, - "editor.wordWrap": "on", - "editor.tabSize": 2, - "prettier.configPath": "package.json", - "prettier.prettierPath": ".yarn/sdks/prettier/index.js", - "prettier.withNodeModules": true, - "prettier.useEditorConfig": false, - "eslint.nodePath": ".yarn/sdks", - "typescript.tsdk": ".yarn/sdks/typescript/lib", - "typescript.enablePromptUseWorkspaceTsdk": true + "files.exclude": { + "**/.git": true, + "**/.svn": true, + "**/.hg": true, + "**/CVS": true, + "**/.DS_Store": true, + "node_modules": true, + "dist": true + }, + "javascript.preferences.importModuleSpecifier": "project-relative", + "typescript.preferences.importModuleSpecifier": "project-relative", + "typescript.preferences.importModuleSpecifierEnding": "minimal", + "search.exclude": { + "**/.yarn": true, + "**/.pnp.*": true + }, + "editor.codeActionsOnSave": { + "source.organizeImports": true, + "source.fixAll.eslint": true, + "source.format": true + }, + "editor.formatOnSave": true, + "diffEditor.wordWrap": "on", + "editor.insertSpaces": false, + "editor.wordWrap": "on", + "editor.tabSize": 2, + "prettier.configPath": "package.json", + "prettier.prettierPath": ".yarn/sdks/prettier/index.js", + "prettier.withNodeModules": true, + "prettier.useEditorConfig": false, + "eslint.nodePath": ".yarn/sdks", + "typescript.tsdk": ".yarn/sdks/typescript/lib", + "typescript.enablePromptUseWorkspaceTsdk": true } diff --git a/.yarn/sdks/typescript/package.json b/.yarn/sdks/typescript/package.json index 1ae6045..27270c7 100644 --- a/.yarn/sdks/typescript/package.json +++ b/.yarn/sdks/typescript/package.json @@ -1,6 +1,6 @@ { "name": "typescript", - "version": "4.3.4-pnpify", + "version": "4.2.4-pnpify", "main": "./lib/typescript.js", "type": "commonjs" } diff --git a/src/config/example-options.ts b/src/config/example-options.ts index ce8f782..fadd640 100644 --- a/src/config/example-options.ts +++ b/src/config/example-options.ts @@ -32,7 +32,8 @@ export const db = { }; // Logging -export const logging: { info: boolean; verbose: boolean } = { - info: false, - verbose: true +export const logging: { db: boolean; verbose: boolean; info: boolean } = { + db: false, + verbose: true, + info: true }; diff --git a/src/lib/extensions/BushClient.ts b/src/lib/extensions/BushClient.ts index d0758d4..b12fd52 100644 --- a/src/lib/extensions/BushClient.ts +++ b/src/lib/extensions/BushClient.ts @@ -110,7 +110,7 @@ export class BushClient extends AkairoClient { dialect: 'postgres', host: this.config.db.host, port: this.config.db.port, - logging: (a, b) => this.logger.debug(a) + logging: this.config.logging ? (a) => this.logger.debug(a) : false }); this.logger = new BushLogger(this); } diff --git a/src/lib/extensions/BushClientUtil.ts b/src/lib/extensions/BushClientUtil.ts index 4d428ee..a6b049a 100644 --- a/src/lib/extensions/BushClientUtil.ts +++ b/src/lib/extensions/BushClientUtil.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { exec } from 'child_process'; import { ClientUtil } from 'discord-akairo'; import { @@ -484,9 +486,13 @@ export class BushClientUtil extends ClientUtil { return array.join(', '); } - public async insertOrRemoveFromGlobal(action: 'add' | 'remove', key: keyof typeof BushCache, value: any) { + public async insertOrRemoveFromGlobal( + action: 'add' | 'remove', + key: keyof typeof BushCache, + value: any + ): Promise<Global | void> { const environment = this.client.config.dev ? 'development' : 'production'; - let row = await Global.findByPk(environment); + const row = await Global.findByPk(environment); const oldValue: any[] = row[key]; let newValue: any[]; if (action === 'add') { diff --git a/src/tasks/updateCache.ts b/src/tasks/updateCache.ts index 5994af9..6c1f098 100644 --- a/src/tasks/updateCache.ts +++ b/src/tasks/updateCache.ts @@ -10,19 +10,18 @@ export default class UpdateCacheTask extends BushTask { } async exec(): Promise<void> { const environment = this.client.config.dev ? 'development' : 'production'; - let row = await Global.findByPk(environment); - if (!row) { - row = await Global.create({ + const row = + (await Global.findByPk(environment)) || + (await Global.create({ environment, superUsers: [], blacklistedChannels: [], blacklistedGuilds: [], blacklistedUsers: [], disabledCommands: [] - }); - } + })); - for (let option in row) { + for (const option in row) { if (this.client.cache[option]) this.client.cache[option] = row[option]; } this.client.logger.verbose(`UpdateCache`, `Updated cache.`); |