Debugging with console (such as console.log or console.info) is not considered a bad practice, but these statements can be accidentally left in production code, leading to unnecessary log pollution. It is important to remove or replace these debugging statements to maintain clean and secure production builds.
Non-Compliant Code Examples
console.log(foo)// General-purpose logging which can expose internal information
console.error(foo)// Error logging which can expose sensitive information
console.info(foo)// Informational logging which can clutter production logs
console.warn(foo)// Warning logging which can be excessive for production
Compliant Code Examples
Console.info(foo)// Example placeholder for a custom logging method or library
シームレスな統合。 Datadog Code Security をお試しください
Datadog Code Security
このルールを試し、Datadog Code Security でコードを解析する
このルールの使用方法
1
2
rulesets:- javascript-best-practices # Rules to enforce JavaScript best practices.