var ERR = require('async-stacktrace');
var _ = require('lodash');
var csvStringify = require('csv').stringify;
var express = require('express');
var router = express.Router();

var error = require('../../lib/error');
var logger = require('../../lib/logger');
var opsbot = require('../../lib/opsbot');

router.get('/', function(req, res, next) {
    res.locals.showReportForm = true;
    res.locals.showSuccess = false;
    res.render(__filename.replace(/\.js$/, '.ejs'), res.locals);
});

router.post('/', function(req, res, next) {
    if (req.body.__action == 'report_cheating') {
        logger.verbose('cheating report', {locals: res.locals, body: req.body});
        res.locals.message = `Report of cheating: ${req.body.report}\nReporter email: ${req.body.email}`;
        opsbot.sendProctorMessage(res.locals.message, (err) => {
            if (ERR(err, next)) return;
            res.locals.showReportForm = false;
            res.locals.showSuccess = true;
            res.render(__filename.replace(/\.js$/, '.ejs'), res.locals);
        });
    } else {
        return next(error.make(400, 'unknown __action', {locals: res.locals, body: req.body}));
    }
});

module.exports = router;

@@ -1,11 +1,13 @@
-var
+const
  ERR = r
@@ -38,83 +38,13 @@
 ');%0A
-var _ = require('lodash');%0Avar csvStringify = require('csv').stringify;%0Avar
+const
  exp
@@ -70,19 +70,21 @@
 ress');%0A
-var
+const
  router 
@@ -104,19 +104,21 @@
 ter();%0A%0A
-var
+const
  error =
@@ -146,19 +146,21 @@
 rror');%0A
-var
+const
  logger 
@@ -194,11 +194,13 @@
 ');%0A
-var
+const
  ops
@@ -262,32 +262,33 @@
 ction(req, res, 
+_
 next) %7B%0A    res.

fix linter errors