Here's a motivating example: I am developing some code and want to figure out what's going wrong, so I have
function foo() {
console.log("Look its 2016 and I'm still printf debugging");
}
Except... our build process runs esLint as part of the build system and by-design prevents even running the rest of the build pipeline if esLint fails. error Unexpected console statement no-console
What I effectively want is to set up a dev
environment where certain rules are turned off (or converted to warnings), and then a production
environment with the strict rules turned on. And I want to be able to easily toggle that locally so I can verify my code works before submitting it to a CI server.
I can't find any relevant code snippets to make this happen, which makes me sad. My build environment is just npm
scripts (just using the esLint CLI + package.json), but I would be happy to port a solution from another build environment.
Right now, I'm left with either // eslint-disable-line
or locally modifying an .eslintrc
file and praying I never accidentally check that in by accident. There must be a better way.