-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
Pull Request: ESLint Configuration, Dependency Updates, and Type Safety Improvements #1178
base: master
Are you sure you want to change the base?
Conversation
Introduce: ESLint flat config file `eslint.config.js` and update some critical dependencies to their latest versions for better security and partly compatibility. More recent node version is still recommended. Chore: Resolves a few critical vulnerabilities, implement working flat eslint by: introducing ESLint configuration. Fix problems defined by the linter. Chore: Ensure type safety by converting any's into unknowns, while preserving full functionality across the board. ESLint config file is mainly for linting rules for now. Resolves errors with husky in order to make contribution easier. Low-Mid Priority PR, a sort of Hello to Max.
📦 🤖 A new release has been made for this pull request.To play around with this PR, pull Images are available for x86_64 and ARM64.
|
Can you elaborate? Did you abandon the project, or only release docker images now? Otherwise why not just merge the PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I can understand some changes, almost half to the entire code here looks like it's been thrown through a fault checker with intellisense and/or ran through CoPilot/ChatGPT.
What's the use of all these changes (commented ones).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it has been added with chatgpt, why should this be added exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not widly known with eslint configuration, I'm assuming this is added for linting during development. Instead of only during committing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it has only been ordered correctly. No functional changes what-so-ever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it has only been ordered correctly. No functional changes what-so-ever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has the bot been checked to still work with all these dependencies? I tried updating some a while back and they still broke the functionality of the bot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm assuming here that several variables have been changed and or replaced. What about the code it was attached to?
@@ -75,7 +75,7 @@ export default class { | |||
|
|||
async search(query: string, shouldSplitChapters: boolean): Promise<SongMetadata[]> { | |||
const {items} = await this.ytsrQueue.add(async () => this.cache.wrap( | |||
ytsr, | |||
async (...args) => ytsr(args[0] as string, args[1] as ytsr.Options), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What made this change come up?
Description
I have worked for quite a while on this project, albeit 80% of it went into (learning how to) configuring eslint in an already established environment. This PR comes with a few enhancements to the project, focusing on code quality, security, and maintainability. The main changes include:
ESLint Configuration: A new flat ESLint configuration file (
eslint.config.js
) has been added to the project. This configuration defines a set of linting rules to ensure consistent code style and catch potential issues early in the development process. The linter has been run on the codebase, and any identified problems have been fixed.Dependency Updates: Critical dependencies have been updated to their latest versions while I also tested everything thoroughly in order to not break anything. The updates address security vulnerabilities and some of them came from dependabot out of the blue after forking your original. I tested mainly on unix OSes using node v18 and v20 as you intended from what I took out of your dovcs. Project works fine with v18, v20 is problematic on windows due to discordjs/opus but that's a known problem not related to muse.
Type Safety Improvements: To enhance type safety, occurrences of
any
have been converted tounknown
where appropriate. This should help catch potential type-related issues down the line.Husky Configuration: The Husky configuration has been resolved to facilitate easier contributions to the project. Any future contributors shouldn't have husky serve as a gatekeeper against linting problems.
Motivation and Context
I like and use a fork of the bot myself for quite some time now albeit I am rewriting a different approach from scratch either.
How Has This Been Tested?
The changes introduced in this pull request have been thoroughly enough tested to ensure that the project's functionality remains intact and there are only wins for everyone involved, be it non techies or active cooooontributors. The ESLint rules have been applied to the codebase, and any identified issues have been resolved.
Types of Changes, let's try out those checkboxes lol
Checklist:
Related Issues
Acknowledgements
Max Isom's great work for a not sucking discord music bot.