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

refactor: improve toClassName function readability and JSDoc completeness #112

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

Ayoub-Mabrouk
Copy link
Contributor

refactor: improve toClassName function readability and JSDoc completeness

  • Replaced substr with slice for better readability and consistency.
  • Updated JSDoc to include @param and @returns tags for clarity on function inputs and outputs.
  • Simplified the conditional logic by using slice(-5) === 'Error' for a concise and clear check.

Copy link
Member

@wesleytodd wesleytodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I am not a huge fan of PR's with changes like the code reformatting which do not have meaningful behavior changes (so maybe try to avoid those in the future) I think it is more readable, and the JSDoc updates are also good. Since this PR has been open for 5 days and has now two approvals I think we can merge.

…ness

- Replaced substr with slice for better readability and consistency.
- Updated JSDoc to include @param and @returns tags for clarity on function inputs and outputs.
- Simplified the conditional logic by using slice(-5) === 'Error' for a concise and clear check.
@wesleytodd wesleytodd merged commit d8899ba into jshttp:master Nov 12, 2024
24 checks passed
@Ayoub-Mabrouk
Copy link
Contributor Author

Ayoub-Mabrouk commented Nov 12, 2024

While I am not a huge fan of PR's with changes like the code reformatting which do not have meaningful behavior changes (so maybe try to avoid those in the future) I think it is more readable, and the JSDoc updates are also good. Since this PR has been open for 5 days and has now two approvals I think we can merge.

Thank you @wesleytodd for the feedback! This PR includes more than just formatting improvements: I replaced substr with slice (deprecated on MDN) and refactored the conditional to remove negation, following best practices from Google’s JavaScript Style Guide and Clean Code. These changes, along with clearer JSDoc, aim to improve maintainability.
Contributions that enhance readability and the long-term health of the project are incredibly valuable for everyone involved, especially for future contributors. I’ll keep your feedback in mind for future contributions. Thanks again for approving!

@wesleytodd
Copy link
Member

This PR includes more than just formatting improvements

Yep 😄, and that stuff is why I merged it.

Contributions that enhance readability and the long-term health of the project are incredibly valuable for everyone involved

Happy to discuss this in general (maybe in our discussions repo?), but there are more details to discuss than just readability. In general since my involvement in the project we have not accepted readability PRs. They are highly subjective and often cause more problems than they solve. Very glad to see you are open to the feedback and look forward to more of your contributions!

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

Successfully merging this pull request may close these issues.

3 participants