I too was getting burned with not semicolon matching ([^;]). Turns out there are a few things that the devs on my team like to do that cause problems with the RegExp matching solution which may or may not be representative of all users of the plugin.
I started a new issue because I wanted to provide some "feedback from the field" on #18 but the title didn't really capture my concerns. Thanks for this great plugin btw!
Getting cute with colored output:
console.log('%c Look at me!', 'background: #222; color: #bada55');
Inline commenting:
console.log('hello world'); // Logs a hello msg
I had a crack at mixing up the regex... (exploding by string delimiters and parens) but because braceless conditionals is also a big problem for us I think going down the path of #19 is best.
For now, I'm keeping grunt-remove-logging in place as it solves 95% of the console.log problems we have, and just using grep/manual methods to replace the rest. It'd be great if this was a single routine tho.
I too was getting burned with not semicolon matching (
[^;]
). Turns out there are a few things that the devs on my team like to do that cause problems with the RegExp matching solution which may or may not be representative of all users of the plugin.console.log('%c Look at me!', 'background: #222; color: #bada55');
Inline commenting:
console.log('hello world'); // Logs a hello msg
I had a crack at mixing up the regex... (exploding by string delimiters and parens) but because braceless conditionals is also a big problem for us I think going down the path of #19 is best.
For now, I'm keeping
grunt-remove-logging
in place as it solves 95% of the console.log problems we have, and just using grep/manual methods to replace the rest. It'd be great if this was a single routine tho.