Disallow Use of console (no-console)
console. Such messages are considered to be for debugging purposes and therefore not suitable to ship to the client. In general, calls using
console should be stripped before being pushed to production.
console.log("Made it here."); console.error("That shouldn't have happened.");
This rule is aimed at eliminating unwanted
console used as an identifier in code.
The following patterns are considered warnings:
console.log("Hello world!"); console.error("Something bad happened.");
The following patterns are considered okay and do not cause warnings:
// custom console Console.log("Hello world!");
When Not To Use It
If you’re using Node.js, however,
console is used to output information to the user and so is not strictly used for debugging purposes. If you are developing for Node.js then you most likely do not want this rule enabled.
This rule was introduced in ESLint 0.0.2.