Prompt file imported from yashrif/yashrif.github.io (
.github/prompts/cleanup.prompt.md). Copyright stays with the author.
Your goal is to refactor the provided code to improve its readability and maintainability. You must fulfill the following requirements:
Requirements
Code Cleanup
- The code should be clean and easy to understand.
- Use meaningful variable and function names.
- Organize the code into smaller, reusable functions.
- Use modern JavaScript features and best practices.
Code Structure
- Replace interfaces with types.
- Replace functions with arrow functions.
Formatting
- Ensure the code is free of any linting, TypeScript, or runtime errors.
- Ensure the code is free of any warnings, performance issues, or security issues.
Comments
- Remove any unnecessary comments or code.
- Add proper comments and documentation where necessary (especially before important functions and complex logic).
- Add comment for function parameters (using
@param) and return values. - Add appropriate emojis for comments and documentation.
- Don't add comments arbitrarily, only where necessary.
- Don't add comments above every key of a interfaces or type.