I currently have a npm script for running a linter. Obviously there will be some errors being outputted, but the npm script fails rather than just show me errors and move on.
This is terrible especially when I have something else calling the script as it marvellously breaks everything. I can always run npm run lint --force
to avoid errors but I don't have that --force
luxury all the time (for example, with a git-hook).
How can I setup my script to output errors without causing a mess?
Found the answer:
Simply adding: exit 0
to the end of the command did it!
There are a few other options which are cross platform too:
eslint || true
For this to work on Windows, you'll need to npm install cash-true
first
exitzero eslint
You'll need to npm install exitzero
first
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With