eslint more

Former-commit-id: 419d4b4d166e29f9a5b13659cbc64886ed82ecfb
This commit is contained in:
Ben
2022-02-14 17:42:29 +00:00
parent 12d7d20aed
commit d4f33da5e8
7 changed files with 12 additions and 14 deletions

View File

@@ -8,6 +8,7 @@
"start": "node src/index.js",
"dev": "nodemon src/index.js --watch src",
"gendoc": "jsdoc -r ./src/ ./client/ -c ./jsdoc.json -d ./jsdoc/",
"lint": "eslint src --ext .js && eslint client --ext .js",
"setup": "npm i"
},
"author": "Ben Kyd <benjaminkyd@gmail.com> (https://benkyd.co.uk)",

0
src/__test/.eslintignore Normal file
View File

View File

@@ -18,7 +18,7 @@ class Database {
host: process.env.DATABASE_HOST,
database: process.env.DATABASE_DB,
password: process.env.DATABASE_PASSWORD,
port: process.env.DATABASE_PORT
port: process.env.DATABASE_PORT,
};
}
@@ -29,7 +29,7 @@ class Database {
}
async connectToDatabase() {
const con = new Promise((resolve, reject) => {
const con = new Promise((resolve, reject) => {
const psqlClient = new Client(this.options);
psqlClient.connect();
@@ -59,5 +59,5 @@ class Database {
module.exports = {
IDatabase: Database,
DataTypes: require('./psql-entity-framework/types.js'),
DataConstraints: require('./psql-entity-framework/relationships_constraints.js')
}
DataConstraints: require('./psql-entity-framework/relationships_constraints.js'),
};

View File

@@ -20,7 +20,7 @@ const Model = require('./model.js');
class PSQLObjectRelation {
constructor(psqlConnection) {
Logger.Database('ORM Loading...');
this.connection = psqlConnection;;
this.connection = psqlConnection;
this.models = [];
// dummyModels are for models that have requested a model that doesn't exist
// the model that doesn't exist will be added here, and once it is added, the
@@ -78,7 +78,7 @@ class PSQLObjectRelation {
if (typeof model[key] !== 'object') {
const type = model[key];
model[key] = {
type: type,
type,
constraints: [],
};
}
@@ -97,8 +97,6 @@ class PSQLObjectRelation {
// TODO: Make this more maintainable
resolveDepends() {
}
/**

View File

@@ -1,6 +1,6 @@
class RelationshipTypes {
static get PRIMARY_KEY() {
return "PRIMARY KEY";
return 'PRIMARY KEY';
}
static get UNIQUE() {
@@ -22,7 +22,7 @@ class RelationshipTypes {
// ONE TO ONE RELATIONSHIP, again ER framework will handle this
static FOREIGN_KEY_121(type, references) {
return { fk: { ref: references }, type: type, constraints: [ this.UNIQUE ] };
return { fk: { ref: references }, type, constraints: [this.UNIQUE] };
}
}

View File

@@ -16,4 +16,4 @@ function init(databaseInstance) {
module.exports = {
Init: init,
}
};

View File

@@ -3,9 +3,8 @@ const Logger = require('../logger.js');
const express = require('express');
const app = express();
function logRequest(req, res, next)
{
Logger.Middleware('REQUEST', `${req.originalUrl} [${req.method}: ${req.headers['x-forwarded-for'] || req.socket.remoteAddress }]`);
function logRequest(req, res, next) {
Logger.Middleware('REQUEST', `${req.originalUrl} [${req.method}: ${req.headers['x-forwarded-for'] || req.socket.remoteAddress}]`);
next();
}