coffeelint-multiple-callback
Version:
Coffeelint rule that checks for callbacks being called multiple times
24 lines (17 loc) • 520 B
text/coffeescript
app = express()
app.use '/test-multiple-res-error', (req,res,next)->
options = {}
res.send(123)
res.render 'path/to/template.ejs', options # HIT
return
app.use '/test-multiple-res-okay', (req,res,next)->
options = {}
res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate")
res.render 'path/to/template.ejs', options
return
app.use '/test-res-not-sent-error', (req,res,next)-> # HIT
return
app.use '/test-next-and-res-error', (req,res,next)->
res.send(123)
next() # HIT
return