In JavaScript, assigning to a const variable is an error and causes an exception to be thrown at runtime. This rule disallows assigning to constant variable declarations.
Non-Compliant Code Examples
consta=0;a=1;constb=0;b+=1;constc=0;++c;
Compliant Code Examples
consta=0;console.log(a);for(constain[1,2,3]){// `a` is re-defined (not modified) on each loop step.
console.log(a);}
シームレスな統合。 Datadog Code Security をお試しください
Datadog Code Security
このルールを試し、Datadog Code Security でコードを解析する
このルールの使用方法
1
2
rulesets:- javascript-best-practices # Rules to enforce JavaScript best practices.