From 29b8334b060dc0c05a509d523ead4b3a30229fef Mon Sep 17 00:00:00 2001 From: vantezzen Date: Thu, 5 Sep 2019 11:22:49 +0200 Subject: Add eslint --- app/Models/User.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'app/Models/User.js') diff --git a/app/Models/User.js b/app/Models/User.js index c9a680a..3a40347 100644 --- a/app/Models/User.js +++ b/app/Models/User.js @@ -1,14 +1,13 @@ -'use strict' /** @type {typeof import('@adonisjs/lucid/src/Lucid/Model')} */ -const Model = use('Model') +const Model = use('Model'); /** @type {import('@adonisjs/framework/src/Hash')} */ -const Hash = use('Hash') +const Hash = use('Hash'); class User extends Model { - static boot () { - super.boot() + static boot() { + super.boot(); /** * A hook to hash the user password before saving @@ -16,9 +15,10 @@ class User extends Model { */ this.addHook('beforeSave', async (userInstance) => { if (userInstance.dirty.password) { - userInstance.password = await Hash.make(userInstance.password) + // eslint-disable-next-line no-param-reassign + userInstance.password = await Hash.make(userInstance.password); } - }) + }); } /** @@ -31,17 +31,17 @@ class User extends Model { * * @return {Object} */ - tokens () { - return this.hasMany('App/Models/Token') + tokens() { + return this.hasMany('App/Models/Token'); } - services () { - return this.hasMany('App/Models/Service', 'id', 'userId') + services() { + return this.hasMany('App/Models/Service', 'id', 'userId'); } - workspaces () { - return this.hasMany('App/Models/Workspace', 'id', 'userId') + workspaces() { + return this.hasMany('App/Models/Workspace', 'id', 'userId'); } } -module.exports = User +module.exports = User; -- cgit v1.2.3-70-g09d2