Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeQL #404: no-explicit-any (typescript-eslint/no-explicit-any) #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Logger.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import getConfig from "./config.js"

const debug = getConfig<boolean>("debug", false)

const ESC = "\u001b"

// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand All @@ -17,7 +21,7 @@ const COLOR = { GRAY, DARK, RED, GREEN, YELLOW, PINK, TEAL, WHITE }
export default class Logger {

constructor(private readonly actor: string, private readonly color: keyof typeof COLOR) {
if (!global.debug) this.debug = () => {} // only enable debug logs when debugging is on
if (debug) this.debug = () => {} // only enable debug logs when debugging is on
}

log(...message: string[]) {
Expand Down
3 changes: 0 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import User from "./models/User.js"
import getConfig from "./config.js"
import { readFile } from "node:fs/promises"

// eslint-disable-next-line @typescript-eslint/no-explicit-any
global.debug = getConfig("debug", false) as any

export const sql = new Sequelize({
database: getConfig<string>("db.database"),
dialect: getConfig<Dialect>("db.dialect"),
Expand Down
Loading