From f33738ea1db2b5dd67de21c0800673b9c1c8d1c9 Mon Sep 17 00:00:00 2001 From: Wallef Reis Borges Date: Wed, 16 Oct 2019 14:58:46 +0100 Subject: [PATCH] setting up git hooks and fixing lint errors --- .githooks/post-commit | 0 .githooks/pre-commit | 0 core/controllers/userController.js | 17 +++++++++-------- core/models/question.js | 10 +++++----- core/models/user.js | 22 +++++++++++----------- core/routes.js | 20 ++++++++++---------- 6 files changed, 35 insertions(+), 34 deletions(-) mode change 100644 => 100755 .githooks/post-commit mode change 100644 => 100755 .githooks/pre-commit diff --git a/.githooks/post-commit b/.githooks/post-commit old mode 100644 new mode 100755 diff --git a/.githooks/pre-commit b/.githooks/pre-commit old mode 100644 new mode 100755 diff --git a/core/controllers/userController.js b/core/controllers/userController.js index 0979503..f7d93a1 100644 --- a/core/controllers/userController.js +++ b/core/controllers/userController.js @@ -1,12 +1,13 @@ 'use strict' -const User = require('../models/user'); +const User = require('../models/user') module.exports = class UserController { - static hello () { - let user = new User() - user.setName('Ben'); - - return `Hello ${user.name}`; - } -}; \ No newline at end of file + static hello() { + const user = new User() + user.setName('Ben') + + return `Hello ${user.name}` + } + +} diff --git a/core/models/question.js b/core/models/question.js index 3daf252..71d7e0c 100644 --- a/core/models/question.js +++ b/core/models/question.js @@ -1,7 +1,7 @@ -'use strict'; +'use strict' module.exports = class Question { - example () { - return 'this is an example'; - } -}; \ No newline at end of file + example() { + return 'this is an example' + } +} diff --git a/core/models/user.js b/core/models/user.js index 3c4ce0f..05f190c 100644 --- a/core/models/user.js +++ b/core/models/user.js @@ -1,15 +1,15 @@ -'use strict'; +'use strict' module.exports = class User { - async setName (name) { - return this.name = name; - } + async setName(name) { + return this.name = name + } - async register () { - // TO DO - } + async register() { + // TO DO + } - async login () { - // TO DO - } -}; \ No newline at end of file + async login() { + // TO DO + } +} diff --git a/core/routes.js b/core/routes.js index db5de6b..c7ace97 100644 --- a/core/routes.js +++ b/core/routes.js @@ -1,17 +1,17 @@ -'use strict'; +'use strict' -const Router = require('koa-router'); -const router = new Router(); +const Router = require('koa-router') +const router = new Router() -const UserController = require('./controllers/userController'); -const QuestionController = require('./controllers/questionController'); +const UserController = require('./controllers/userController') +const QuestionController = require('./controllers/questionController') router.get('/', async ctx => { - ctx.body = UserController.hello(); -}); + ctx.body = UserController.hello() +}) router.get('/questions', async ctx => { - ctx.body = QuestionController.showExample(); -}); + ctx.body = QuestionController.showExample() +}) -module.exports = router; \ No newline at end of file +module.exports = router