DEV Community

Discussion on: Remove all console.log()s using Regex in Atom

Collapse
 
maxart2501 profile image
Massimo Artizzu

console.log's happen and you don't always catch them. Not even with regular expressions.

Do you know what do? Linters.

As a rule of the thumb, I always say to my collaborators: "Never commit console.log statements, so that's why we're enforcing no-console in ESLint."

Collapse
 
joegaudet profile image
Joe Gaudet

Agreed 100% here, encoding team rules around stuff like this in eslint configurations frees devs to spend their code review time focusing on reviewing logic and design rather than nitpicking style issues.

Collapse
 
michael profile image
Michael Lee 🍕

Definitely agree with the use of Linters. Been using ESLint for a project with other devs. Unfortunately, logs still make it into production :( Definitely could benefit from a build process that would clean that up for us. But that only fixes code and not the source ;)

Collapse
 
worsnupd profile image
Daniel Worsnup

If this continues to be an issue, it may be worth your time to set up required status checks on your repository using the Status API and webhooks. You can use these tools to automatically reject pull requests that contain code changes that fail ESLint validation.