Fixed some more linting

Removed eslint errors related to the after variable being undefined.
This commit is contained in:
Robert Webb 2019-02-17 19:58:20 -08:00
parent 98adc24389
commit 0c05f3d357
5 changed files with 28 additions and 24 deletions

View File

@ -5,6 +5,10 @@
"ecmaVersion": 8
},
"globals": {
"after": "readable"
},
"env": {
"es6": true,
"node": true
@ -15,6 +19,6 @@
"semi": ["error", "never"],
"indent": ["warn", 2],
"no-unused-vars": ["warn"],
"no-console": ["off"]
"no-console": ["off"],
}
}

View File

@ -1,24 +1,24 @@
const router = require('express').Router();
const { Item } = require('../db/models');
const router = require('express').Router()
const { Item } = require('../db/models')
module.exports = router;
module.exports = router
router.get('/', async (req, res, next) => {
try {
const items = await Item.findAll();
const items = await Item.findAll()
res.status(201).send(items);
res.status(201).send(items)
} catch (err) {
next(err);
next(err)
}
});
})
router.post('/', async (req, res, next) => {
try {
const item = await Item.create(req.body);
const item = await Item.create(req.body)
res.status(201).json(item);
res.status(201).json(item)
} catch (err) {
next(err);
next(err)
}
});
})

View File

@ -1,13 +1,13 @@
const router = require('express').Router();
const router = require('express').Router()
module.exports = router;
module.exports = router
// what you will hit at /api/robots
router.get('/', async (req, res, next) => {
try {
console.log('NSA was here');
res.status(201).send('FUCK YOU NSA\n');
console.log('NSA was here')
res.status(201).send('FUCK YOU NSA\n')
} catch (err) {
next(err);
next(err)
}
});
})

View File

@ -21,6 +21,6 @@ const ascii = String.raw`
____^/\___^--____/\____O______________/\/\---/\___________--
/\^ ^ ^ ^ ^^ ^ '\ ^ ^
-- - -- - - --- __ ^
-- __ ___-- ^ ^`;
-- __ ___-- ^ ^`
module.exports = ascii;
module.exports = ascii

View File

@ -1,5 +1,5 @@
const Sequelize = require('sequelize');
const db = require('../db');
const Sequelize = require('sequelize')
const db = require('../db')
// votes should be up or down, could either do 'up/'down' or 1/-1
const Vote = db.define('votes', {
@ -8,6 +8,6 @@ const Vote = db.define('votes', {
allowNull: false
}
});
})
module.exports = Vote;
module.exports = Vote