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

Fix 'Don't use Function as a type. The Function type accepts any function-like value. It provides no type safety when calling the function, which can be a common source of bugs. It also accepts things like class declarations, which will throw at runtime as they will not be called with new. If you are expecting the function to accept certain arguments, you should explicitly define the function shape.' issue in src\commands\moderation\op.ts #56

Closed
Visual1mpact opened this issue Jul 27, 2024 · 0 comments

Comments

@Visual1mpact
Copy link
Owner

CodeFactor found an issue: Don't use Function as a type. The Function type accepts any function-like value.
It provides no type safety when calling the function, which can be a common source of bugs.
It also accepts things like class declarations, which will throw at runtime as they will not be called with new.
If you are expecting the function to accept certain arguments, you should explicitly define the function shape.

It's currently on:
src\commands\moderation\op.ts:77

Visual1mpact added a commit that referenced this issue Jul 27, 2024
Replaced `Function` type with explicit function signatures for `opFailGui` and `openOpGui` functions in `opCommand`. This change enhances type safety by specifying parameter types and return values, preventing potential runtime errors and improving code maintainability.

Related issues: #55, #56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant