Skip to content

no-debug also affects console.debug() #327

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

Closed
srittau opened this issue Apr 12, 2021 · 3 comments · Fixed by #349
Closed

no-debug also affects console.debug() #327

srittau opened this issue Apr 12, 2021 · 3 comments · Fixed by #349
Assignees
Labels
bug Something isn't working released

Comments

@srittau
Copy link

srittau commented Apr 12, 2021

The testing-library/no-debug test also warns about using console.debug(), although there is a separate built-in test for that: no-console. I would like to allow console.debug() statements (our config contains "no-console": ["error", {"allow": ["debug", "warn", "error"]}]), but still keep testing-library/no-debug enabled for testing-library debug statements.

@Belco90 Belco90 added the bug Something isn't working label Apr 12, 2021
@Belco90
Copy link
Member

Belco90 commented Apr 12, 2021

Hello @srittau! Thanks for reporting this issue. Indeed, console.debug should be out of the scope of testing-library/no-debug. It should be easy to fix, I hope I can get back soon with the bugfix.

@gndelia
Copy link
Collaborator

gndelia commented Apr 12, 2021

I think I can take this one

@gndelia gndelia self-assigned this Apr 12, 2021
Belco90 pushed a commit that referenced this issue Apr 21, 2021
* fix: allow console.debug() in no-debug

* refactor: check for built-in console in isDebugUtil

* fix: support destructuring from console object

* fix: no-debug check correctly for declared variable

* refactor: simplify code

Closes #327
@github-actions
Copy link

🎉 This issue has been resolved in version 4.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants