Skip to content

Commit c3469de

Browse files
committed
Linting fixes
1 parent ea61b15 commit c3469de

File tree

6 files changed

+379
-400
lines changed

6 files changed

+379
-400
lines changed

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ pipeline {
1414
ansiColor('xterm')
1515
}
1616
environment {
17-
IMAGE = "nginx-proxy-manager"
17+
IMAGE = 'nginx-proxy-manager'
1818
BUILD_VERSION = getVersion()
19-
MAJOR_VERSION = "2"
19+
MAJOR_VERSION = '2'
2020
BRANCH_LOWER = "${BRANCH_NAME.toLowerCase().replaceAll('/', '-')}"
2121
COMPOSE_PROJECT_NAME = "npm_${BRANCH_LOWER}_${BUILD_NUMBER}"
2222
COMPOSE_FILE = 'docker/docker-compose.ci.yml'

backend/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env node
22

3-
const fs = require('fs');
43
const logger = require('./logger').global;
54

65
async function appStart () {

backend/lib/config.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const fs = require('fs');
22
const NodeRSA = require('node-rsa');
3-
const { config } = require('process');
43
const logger = require('../logger').global;
54

65
const keysFile = '/data/keys.json';
@@ -18,7 +17,8 @@ const configure = () => {
1817
} catch (err) {
1918
// do nothing
2019
}
21-
if (configData?.database && configData?.database?.engine) {
20+
21+
if (configData && configData.database) {
2222
logger.info(`Using configuration from file: ${filename}`);
2323
instance = configData;
2424
return;
@@ -48,8 +48,8 @@ const configure = () => {
4848
logger.info(`Using Sqlite: ${envSqliteFile}`);
4949
instance = {
5050
database: {
51-
engine: 'knex-native',
52-
knex: {
51+
engine: 'knex-native',
52+
knex: {
5353
client: 'sqlite3',
5454
connection: {
5555
filename: envSqliteFile
@@ -62,7 +62,7 @@ const configure = () => {
6262
// Get keys from file
6363
if (!fs.existsSync(keysFile)) {
6464
generateKeys();
65-
} else if (!!process.env.DEBUG) {
65+
} else if (process.env.DEBUG) {
6666
logger.info('Keys file exists OK');
6767
}
6868
try {
@@ -106,8 +106,8 @@ module.exports = {
106106
has: function(key) {
107107
instance === null && configure();
108108
const keys = key.split('.');
109-
let level = instance;
110-
let has = true;
109+
let level = instance;
110+
let has = true;
111111
keys.forEach((keyItem) =>{
112112
if (typeof level[keyItem] === 'undefined') {
113113
has = false;
@@ -140,7 +140,7 @@ module.exports = {
140140
*/
141141
isSqlite: function () {
142142
instance === null && configure();
143-
return instance.database?.knex && instance.database?.knex?.client === 'sqlite3';
143+
return instance.database.knex && instance.database.knex.client === 'sqlite3';
144144
},
145145

146146
/**
@@ -159,7 +159,7 @@ module.exports = {
159159
*/
160160
getPublicKey: function () {
161161
instance === null && configure();
162-
return instance?.keys?.pub
162+
return instance.keys.pub;
163163
},
164164

165165
/**
@@ -169,7 +169,7 @@ module.exports = {
169169
*/
170170
getPrivateKey: function () {
171171
instance === null && configure();
172-
return instance?.keys?.key;
172+
return instance.keys.key;
173173
},
174174

175175
/**

backend/models/token.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = function () {
2222
*/
2323
create: (payload) => {
2424
if (!config.getPrivateKey()) {
25-
logger.error('Private key is empty!')
25+
logger.error('Private key is empty!');
2626
}
2727
// sign with RSA SHA256
2828
const options = {
@@ -55,7 +55,7 @@ module.exports = function () {
5555
*/
5656
load: function (token) {
5757
if (!config.getPublicKey()) {
58-
logger.error('Public key is empty!')
58+
logger.error('Public key is empty!');
5959
}
6060
return new Promise((resolve, reject) => {
6161
try {

backend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"moment": "^2.29.4",
2222
"mysql": "^2.18.1",
2323
"node-rsa": "^1.0.8",
24-
"nodemon": "^2.0.2",
2524
"objection": "3.0.1",
2625
"path": "^0.12.7",
2726
"signale": "1.4.0",
@@ -35,8 +34,9 @@
3534
"author": "Jamie Curnow <[email protected]>",
3635
"license": "MIT",
3736
"devDependencies": {
38-
"eslint": "^6.8.0",
37+
"eslint": "^8.36.0",
3938
"eslint-plugin-align-assignments": "^1.1.2",
39+
"nodemon": "^2.0.2",
4040
"prettier": "^2.0.4"
4141
}
4242
}

0 commit comments

Comments
 (0)