Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowgate15 committed Jun 5, 2022
1 parent eb78800 commit 7a8062c
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 11 deletions.
2 changes: 2 additions & 0 deletions api.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// eslint-disable-next-line import/no-unassigned-import
require('./config/env');

const process = require('process');

const API = require('@ladjs/api');
const Graceful = require('@ladjs/graceful');
const ip = require('ip');
Expand Down
2 changes: 1 addition & 1 deletion config/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
...sharedConfig('API'),
routes: routes.api,
logger,
hookBeforeRoutes: (app) => {
hookBeforeRoutes(app) {
app.use(jwt(config.jwt));
}
};
1 change: 1 addition & 0 deletions config/env.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const process = require('process');
const path = require('path');

const test = process.env.NODE_ENV === 'test';
Expand Down
6 changes: 3 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const { lastRun, watch, series, parallel, src, dest } = require('gulp');

const config = require('./config');

const PROD = config.env === 'production';
const DEV = config.env === 'development';
// const PROD = config.env === 'production';
// const DEV = config.env === 'development';
const TEST = config.env === 'test';

function xo() {
Expand Down Expand Up @@ -40,7 +40,7 @@ const build = series(clean, parallel(...(TEST ? [] : [xo, remark])));
module.exports = {
clean,
build,
watch: () => {
watch() {
lr.listen(config.livereload);
watch(['**/*.js'], xo);
},
Expand Down
2 changes: 1 addition & 1 deletion test/api/v1/jobs/post.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');
const test = require('ava');
const jwt = require('jsonwebtoken');
const path = require('path');

const config = require('../../../../config');

Expand Down
2 changes: 1 addition & 1 deletion test/api/v1/run.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');
const test = require('ava');
const jwt = require('jsonwebtoken');
const path = require('path');
const delay = require('delay');

const config = require('../../../config');
Expand Down
2 changes: 1 addition & 1 deletion test/api/v1/start.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');
const test = require('ava');
const jwt = require('jsonwebtoken');
const path = require('path');
const delay = require('delay');

const config = require('../../../config');
Expand Down
2 changes: 1 addition & 1 deletion test/api/v1/stop.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');
const test = require('ava');
const jwt = require('jsonwebtoken');
const path = require('path');
const delay = require('delay');

const config = require('../../../config');
Expand Down
1 change: 1 addition & 0 deletions test/jobs/basic.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const process = require('process');
const { parentPort } = require('worker_threads');

setTimeout(() => {
Expand Down
2 changes: 1 addition & 1 deletion test/jobs/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@

module.exports = {};
3 changes: 2 additions & 1 deletion test/jobs/long.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const process = require('process');
const { parentPort } = require('worker_threads');

setTimeout(() => {
console.log('hello');
process.exit(0);
}, 10000);
}, 10_000);

if (parentPort) {
parentPort.on('message', (message) => {
Expand Down
2 changes: 1 addition & 1 deletion test/utils.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Necessary utils for testing
// Librarires required for testing
const path = require('path');
const request = require('supertest');
const getPort = require('get-port');
const path = require('path');

//
// setup utilities
Expand Down

0 comments on commit 7a8062c

Please sign in to comment.