CoffeeLint rule that finds instances where callbacks might be called more than once or not at all.
This code is in the very early stages of development. If you find cases where it's broken, please add example test fixtures. For lines in tests that should trigger an error, add the comment
# HIT to the end of the line. The tests go through line by line and verify that lines with that comment trigger a linting error and all other lines do not.
These functions have the potential of calling cb() multiple times, and is likely an error:
=cb errcb err # BADreturn
=if errcb errcb null # BADreturn
These functions are okay, since they only call the callback once no matter how the logic runs:
=if errcb errelsecb nullreturn
=if errcb errreturncb nullreturn
npm install coffeelint-multiple-callback
Add the following configuration to coffeelint.json:
There are currently no configuration options.
I don't know what I'm doing. I just jumped in with an idea and tried to get it to work. Please assist if this is something you understand or have ideas on how to handle this better.