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

Console log: Exclude test files #242

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

leventebalogh
Copy link
Contributor

What changed and why?

We tend to see some false-positives when validating plugins for using console.log(), mostly when these are used in files that are not part of the actual production code, but are in tests or any other dev-env related code. E.g.:

  * Problem: Console logging detected. Plugins should not log to the console.
    Details: Code rule violation found in /tmp/validator525371450/test/panel.spec.ts at line 6

This PR excludes test files from the validation.

To the reviewer

There is a chance that this is suppressing errors in case a test file is imported to production code. Although the false positives are not ideal, maybe it's better to have those than to miss on a potential console.log() in an imported test file. (I don't think this would really happen to be honest, and even if it does it's not crucial.)

@leventebalogh leventebalogh self-assigned this Aug 1, 2024
@leventebalogh leventebalogh requested review from a team as code owners August 1, 2024 08:00
@leventebalogh leventebalogh requested review from academo, wbrowne, andresmgot and oshirohugo and removed request for a team August 1, 2024 08:00
@leventebalogh leventebalogh added the javascript Pull requests that update Javascript code label Aug 1, 2024
@leventebalogh leventebalogh merged commit a859319 into main Aug 1, 2024
3 checks passed
@leventebalogh leventebalogh deleted the leventebalogh/console-log-rule branch August 1, 2024 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code
Projects
Development

Successfully merging this pull request may close these issues.

2 participants