Rule no-console ignores `window.console`
See original GitHub issuehttps://github.com/eslint/eslint/blob/master/lib%2Frules%2Fno-console.js
"MemberExpression": function(node) {
if (node.object.name === "console") {
context.report(node, "Unexpected console statement.");
}
}
How about adding this support?
The fact is that some of my partners prefer to write window.console.log
.
Or, I have to add a rule for myself?
Btw, I find no-alert is simillar:
Btw, I just found no-alert seems to be nicer: https://github.com/eslint/eslint/blob/master/lib%2Frules%2Fno-alert.js
Cheers
<bountysource-plugin>
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
Issue Analytics
- State:
- Created 8 years ago
- Comments:16 (13 by maintainers)
Top Results From Across the Web
How to disable "unexpected console statement" in Node.js ...
Create a .eslintrc.js in the directory of your file, and put the following contents in it: module.exports = { rules: { 'no-console': 'off',...
Read more >no-console - ESLint - Pluggable JavaScript Linter
This rule disallows calls or assignments to methods of the console object. Examples of incorrect code for this rule: /* eslint no-console: "error"...
Read more >Unexpected console statement. eslint(no-console) error in ...
i am not able to debug my lightning web component javaScript code. am using console.log / window.alert() statements. but it's showing ...
Read more >Console API — Rich 12.6.0 documentation
The console will auto-detect a number of properties required when rendering. ... dimensions of the terminal (which may change if you resize the...
Read more >Conditional Logging to the JavaScript Console
The linter will still complain if I leave 'console' method calls in my code without explicitly allowing them with 'eslint-disable no-console' ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We should probably allow configuration of the global object so you can specify window or something else.
I’m closing this issues since it has been open since January and does not have anyone from the team or the community willing to step forward and own the work to complete to it.