Implemented ESlint and passed down the rules

This commit is contained in:
Alexis
2021-01-20 19:07:56 +01:00
parent 615cced6ed
commit b318a88023
37 changed files with 2119 additions and 568 deletions

View File

@@ -1,4 +1,3 @@
'use strict'
const bookshelf = require('../database/bookshelf').bookshelf;
require('./user-model');
@@ -9,6 +8,6 @@ let APIToken = bookshelf.Model.extend({
user() {
return this.belongsTo('User', 'user_uuid', 'uuid');
}
})
});
module.exports = bookshelf.model('APIToken', APIToken);

View File

@@ -1,13 +1,12 @@
'use strict'
const bookshelf = require('../database/bookshelf').bookshelf
const bookshelf = require('../database/bookshelf').bookshelf;
require('./spell-model')
require('./spell-model');
let Ingredient = bookshelf.Model.extend({
tableName: 'ingredient',
spells() {
return this.belongsToMany('Spell', 'spell_ingredient')
return this.belongsToMany('Spell', 'spell_ingredient');
}
})
});
module.exports = bookshelf.model('Ingredient', Ingredient)
module.exports = bookshelf.model('Ingredient', Ingredient);

View File

@@ -1,13 +1,12 @@
'use strict'
const bookshelf = require('../database/bookshelf').bookshelf
const bookshelf = require('../database/bookshelf').bookshelf;
require('./school-model')
require('./school-model');
let MetaSchool = bookshelf.Model.extend({
tableName: 'meta_school',
schools() {
return this.hasMany('School')
return this.hasMany('School');
}
})
});
module.exports = bookshelf.model('MetaSchool', MetaSchool)
module.exports = bookshelf.model('MetaSchool', MetaSchool);

View File

@@ -1,13 +1,13 @@
const bookshelf = require('../database/bookshelf').bookshelf
const bookshelf = require('../database/bookshelf').bookshelf;
require('./role-model')
require('./role-model');
let Permission = bookshelf.Model.extend({
tableName: 'permission',
hidden: ['id'],
role() {
return this.belongsToMany('Role', 'role_permission')
return this.belongsToMany('Role', 'role_permission');
}
})
});
module.exports = bookshelf.model('Permission', Permission);

View File

@@ -1,12 +1,12 @@
const bookshelf = require('../database/bookshelf').bookshelf
const bookshelf = require('../database/bookshelf').bookshelf;
require('./permission-model')
require('./permission-model');
let Role = bookshelf.Model.extend({
tableName: 'role',
permissions() {
return this.belongsToMany('Permission', 'role_permission');
}
})
});
module.exports = bookshelf.model('Role', Role);

View File

@@ -1,17 +1,16 @@
'use strict'
const bookshelf = require('../database/bookshelf').bookshelf
const bookshelf = require('../database/bookshelf').bookshelf;
require('./spell-model')
require('./meta-school-model')
require('./spell-model');
require('./meta-school-model');
let School = bookshelf.Model.extend({
tableName: 'school',
spells() {
return this.belongsToMany('Spell', 'spell_school')
return this.belongsToMany('Spell', 'spell_school');
},
meta_schools() {
return this.belongsTo('MetaSchool', 'meta_school_id')
return this.belongsTo('MetaSchool', 'meta_school_id');
}
})
});
module.exports = bookshelf.model('School', School)
module.exports = bookshelf.model('School', School);

View File

@@ -1,9 +1,8 @@
'use strict'
const bookshelf = require('../database/bookshelf').bookshelf
const bookshelf = require('../database/bookshelf').bookshelf;
require('./school-model')
require('./variable-model')
require('./ingredient-model')
require('./school-model');
require('./variable-model');
require('./ingredient-model');
let Spell = bookshelf.Model.extend({
tableName: 'spell',
@@ -20,6 +19,6 @@ let Spell = bookshelf.Model.extend({
ingredients() {
return this.belongsToMany( 'Ingredient', 'spell_ingredient' );
}
})
});
module.exports = bookshelf.model('Spell', Spell)
module.exports = bookshelf.model('Spell', Spell);

View File

@@ -1,4 +1,3 @@
'use strict'
const bookshelf = require('../database/bookshelf').bookshelf;
require('./role-model');
@@ -13,6 +12,6 @@ let User = bookshelf.Model.extend({
spells() {
return this.hasMany('Spell', 'author_id');
}
})
});
module.exports = bookshelf.model('User', User)
module.exports = bookshelf.model('User', User);

View File

@@ -1,13 +1,12 @@
'use strict'
const bookshelf = require('../database/bookshelf').bookshelf
const bookshelf = require('../database/bookshelf').bookshelf;
require('./spell-model')
require('./spell-model');
let Variable = bookshelf.Model.extend({
tableName: 'variable',
spells() {
return this.belongsToMany('Spell', 'spell_variable')
return this.belongsToMany('Spell', 'spell_variable');
}
})
});
module.exports = bookshelf.model('Variable', Variable)
module.exports = bookshelf.model('Variable', Variable);