Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common (enough?) inline semicolon usage to warrant a RegExp fix? #22

Open
eckdanny opened this issue Dec 23, 2013 · 1 comment
Open

Comments

@eckdanny
Copy link

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.

@ehynds
Copy link
Owner

ehynds commented Dec 23, 2013

Take a look at grunt-groundskeeper which uses esprima instead of a simple regex. It'll probably address these use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants