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

[javascript] Prohibit any console methods #5105

Closed
dschach opened this issue Jul 9, 2024 · 0 comments · Fixed by #5126
Closed

[javascript] Prohibit any console methods #5105

dschach opened this issue Jul 9, 2024 · 0 comments · Fixed by #5126
Labels
a:new-rule Proposal to add a new built-in rule
Milestone

Comments

@dschach
Copy link
Contributor

dschach commented Jul 9, 2024

Proposed Rule Name:
AvoidConsoleStatements

Proposed Category:
Performance or Security

Description:
Use of console.log or console.error can expose sensitive data and is a performance hit. We have a rule for this in Apex, and should have a similar one for JavaScript.

Code Sample: This should include code, that should be flagged by the rule. If possible, the "correct" code
according to this new rule should also be demonstrated.

console.log('foo'); // bad
console.error('foo'); // bad

Possible Properties:

  • Should this rule be customizable via properties?
    Perhaps we specify the kinds of console statements we block? error vs log vs ...

Context:

@dschach dschach added the a:new-rule Proposal to add a new built-in rule label Jul 9, 2024
@adangel adangel changed the title [Javascript] Prohibit any console methods [javascript] Prohibit any console methods Jul 12, 2024
adangel added a commit to adangel/pmd that referenced this issue Jul 19, 2024
adangel added a commit to adangel/pmd that referenced this issue Jul 19, 2024
adangel added a commit to adangel/pmd that referenced this issue Jul 19, 2024
@adangel adangel modified the milestones: 7.4.0, 7.5.0 Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:new-rule Proposal to add a new built-in rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants