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 forgotten console log in dev mode #533

Merged

Conversation

joeyyy09
Copy link
Contributor

@joeyyy09 joeyyy09 commented Apr 9, 2024

PR Description:

Changes Made:
Removed the console.log statement from the codebase to improve code cleanliness and prevent unnecessary logging. Additionally, added a linting rule to disallow console.log statements unless explicitly allowed by an eslint-disable statement.

Reasoning:
Removing console.log statements helps maintain a clean codebase and prevents clutter in the console output. By enforcing a linting rule to disallow console.log statements, we ensure consistency in code quality and adherence to best practices.

Impact:

Enhances code readability and maintainability by removing unnecessary logging statements.
Helps prevent accidental logging of sensitive information in production environments.
Encourages developers to use more robust debugging techniques, such as using breakpoints or logging to a dedicated debugging tool.
Related Issue:
This PR addresses issue #532. Link to issue

@joeyyy09 joeyyy09 changed the title Fix/forgottent console log in dev mode #532 Fix/forgottent console log in dev mode Apr 9, 2024
@mbohal
Copy link
Contributor

mbohal commented Apr 10, 2024

Thank you for the PR.

In regards of 48697e4

  1. I don't think there was any change in import/prefer-default-export yet it is mentioned in the commit message.
  2. Why do we allow console.error? Maybe we should forbid that too since we disable console.warn as well.

In regards of 62d06cb

The commit message in inaccurate. I think plain: "Remove forgotten console.log()" would be sufficient.

Also please see: https://github.com/react-ui-org/react-ui/blob/master/CONTRIBUTING.md#git-workflow. Specifically:

  • Commit messages should be in imperative format. This is not critical, but since they need to be changed anyway it is no extra work.

I added tag to the PR so it will be included in the correct section in Changelog upon release. Normally this is detected from branch name, but for that to work the name would have to be bugfix/

@mbohal mbohal added the bug Something isn't working label Apr 10, 2024
@joeyyy09
Copy link
Contributor Author

Hey, I've disabled all sorts of console log messages including the console.error one which i previously allowed. Regarding the commit messages, do you want me to edit the previous ones or is it okay if it is as it is. I can merge all the commits into one and then add a new commit message if you want me to! Btw, Thanks for helping me out

@mbohal
Copy link
Contributor

mbohal commented Apr 10, 2024

@joeyyy09

Regarding the commit messages, do you want me to edit the previous ones or is it okay if it is as it is. I can merge all the commits into one and then add a new commit message if you want me to

Generally we strive for well documented atomic commits. I think it forces one to write better code, allows for easier code review and makes it quicker to find something in project history when needed.

This PR however is so small and simple, that I think it is fine to squash all commits into on with the commit message "Forbid console.* statements in eslint".

@joeyyy09 joeyyy09 force-pushed the fix/Forgottent-console-log-in-dev-mode branch from 95bb479 to 632959e Compare April 10, 2024 12:09
@joeyyy09
Copy link
Contributor Author

Squashed all commits into a single commit!

Copy link
Contributor

@mbohal mbohal left a comment

Choose a reason for hiding this comment

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

Thank you!

@mbohal
Copy link
Contributor

mbohal commented Apr 11, 2024

@joeyyy09

The tests are failing:

image

Could you please add // eslint-disable-next-line no-console to the relevant lines in src/components/_helpers/transferProps.js?

The tests can be run locally by npm test and npm run lint.

Thank you very much, your effort is greatly appreciated. Sorry I did not mention it before, but I only realized when I run the tests on GH.

@joeyyy09
Copy link
Contributor Author

All the tests have been passed as well as the linting errors are resolved, PFA the screenshot regarding the same.

image

@mbohal
Copy link
Contributor

mbohal commented Apr 11, 2024

@joeyyy09 looks good!

As a last thing, could you please squash all the commits together? I tried to do it when merging, but GH dopes not seem to allow it here.

@joeyyy09 joeyyy09 force-pushed the fix/Forgottent-console-log-in-dev-mode branch from ec07526 to 7491ba2 Compare April 11, 2024 17:28
@joeyyy09
Copy link
Contributor Author

Yeah, done! Thanks for being so patient out with this!

@mbohal mbohal merged commit 18d7411 into react-ui-org:master Apr 12, 2024
10 of 11 checks passed
@mbohal
Copy link
Contributor

mbohal commented Apr 12, 2024

@joeyyy09

Thanks for being so patient out with this!

This goes both ways. I was afraid I was being to picky.

Thanks again and if you feel like submitting any more PRs we would be very grateful.

@joeyyy09 joeyyy09 deleted the fix/Forgottent-console-log-in-dev-mode branch April 13, 2024 05:27
@adamkudrna adamkudrna changed the title #532 Fix/forgottent console log in dev mode Fix forgotten console log in dev mode Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants