This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 455371 - [eslint] Provide no-console rule
Summary: [eslint] Provide no-console rule
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: JS Tools (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 8.0   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-16 13:05 EST by Michael Rennie CLA
Modified: 2014-12-16 13:09 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2014-12-16 13:05:39 EST
http://eslint.org/docs/rules/no-console.html

Rather than mark every occurrence of 'console' like the original ESLint rule seems to do, we should be a bit smarter and only flag its use when you are working in a browser-based env. 

For example:

console.log('hi'); -> not flagged since we don't know where the code will be used or how

/* eslint-env node */
console.log('hi');    -> not flagged since console use in node is very common and expected

/* eslint-env browser */ 
console.log('hi');   -> flagged since leaving console calls in browser code is considered bad.