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 "ecmaVersion": 8
}, },
"globals": {
"after": "readable"
},
"env": { "env": {
"es6": true, "es6": true,
"node": true "node": true
@ -15,6 +19,6 @@
"semi": ["error", "never"], "semi": ["error", "never"],
"indent": ["warn", 2], "indent": ["warn", 2],
"no-unused-vars": ["warn"], "no-unused-vars": ["warn"],
"no-console": ["off"] "no-console": ["off"],
} }
} }

View File

@ -1,24 +1,24 @@
const router = require('express').Router(); const router = require('express').Router()
const { Item } = require('../db/models'); const { Item } = require('../db/models')
module.exports = router; module.exports = router
router.get('/', async (req, res, next) => { router.get('/', async (req, res, next) => {
try { try {
const items = await Item.findAll(); const items = await Item.findAll()
res.status(201).send(items); res.status(201).send(items)
} catch (err) { } catch (err) {
next(err); next(err)
} }
}); })
router.post('/', async (req, res, next) => { router.post('/', async (req, res, next) => {
try { 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) { } 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 // what you will hit at /api/robots
router.get('/', async (req, res, next) => { router.get('/', async (req, res, next) => {
try { try {
console.log('NSA was here'); console.log('NSA was here')
res.status(201).send('FUCK YOU NSA\n'); res.status(201).send('FUCK YOU NSA\n')
} catch (err) { } catch (err) {
next(err); next(err)
} }
}); })

View File

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

View File

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