Skip to content

Latest commit

 

History

History
175 lines (119 loc) · 1.87 KB

no-console.md

File metadata and controls

175 lines (119 loc) · 1.87 KB

sppt/no-console

Disallow console expressions

  • ⭐️ This rule is included in plugin:sppt/recommended preset.
  • ✒️ The --fix option on the command line can automatically fix some of the problems reported by this rule.

Cases

✅ Correct

count(1);

With options:

{ "allowMethods": [] }
console.count(3);

With options:

{ "allowMethods": ["count"] }
error(1);
info(1);
log(1);
profile(1);
time(1);
timeEnd(1);
timeStart(1);

❌ Incorrect

console.count(1);

With options:

{ "allowMethods": [] }

Errors: No console.count expressions are allowed

console.error(1);

With options:

{ "allowMethods": [] }

Errors: No console.error expressions are allowed

console.info(1);

With options:

{ "allowMethods": [] }

Errors: No console.info expressions are allowed

console.profile(1);

With options:

{ "allowMethods": [] }

Errors: No console.profile expressions are allowed

console.time(1);

With options:

{ "allowMethods": [] }

Errors: No console.time expressions are allowed

console.timeEnd(1);

With options:

{ "allowMethods": [] }

Errors: No console.timeEnd expressions are allowed

console.timeStart(1);

With options:

{ "allowMethods": [] }

Errors: No console.timeStart expressions are allowed

Rule Details

(TODO: how does this rule check code?)

Options

(TODO: what do options exist?)

Implementation