Hey great post :D
The regex you wrote might match other things than "console.log" like "console logs", I suggest escaping the dot (console\.log).
If you want do a little more (;|^)\s*console\.log\(.*?\)($|;) makes sure it's either at the start of a line or behind a semicolon (same with the end)
Hey great post :D
The regex you wrote might match other things than "console.log" like "console logs", I suggest escaping the dot (
console\.log
).If you want do a little more
(;|^)\s*console\.log\(.*?\)($|;)
makes sure it's either at the start of a line or behind a semicolon (same with the end)You could also use this package which does that and the logging part for you:
github.com/vishysank/console-log-atom
Thanks Allen! Didn't know this package existed. Will look into it!