Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 403ff0a

Browse files
committed
Added eslint
1 parent acce0a4 commit 403ff0a

20 files changed

Lines changed: 2606 additions & 184 deletions

File tree

.eslintrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"env": {
3+
"node": true,
4+
"commonjs": true,
5+
"jest": true,
6+
"es6": true
7+
},
8+
"parserOptions": {
9+
"ecmaVersion": 2018,
10+
"ecmaFeatures": {
11+
"experimentalObjectRestSpread": true
12+
}
13+
},
14+
"extends": ["eslint:recommended", "plugin:security/recommended"],
15+
"plugins": ["prettier", "security"],
16+
"rules": {
17+
"security/detect-object-injection": "off"
18+
}
19+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.DS_Store
2+
**/node_modules

dispatcher/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ async function main() {
5656
process.exit(1);
5757
}
5858

59+
// eslint-disable-next-line no-constant-condition
5960
while (true) {
6061
await sleep(1 * 1000);
6162

@@ -161,7 +162,7 @@ async function startParseJob({ type, jobId, jobParameters, engineAddress }) {
161162

162163
await batchClient
163164
.createNamespacedJob('default', job)
164-
.then(res => {
165+
.then(() => {
165166
console.log(`Parse Job started successfully`);
166167
})
167168
.catch(error => console.error(error.response.body));
@@ -263,7 +264,7 @@ async function startScanJob({ type, jobId, jobParameters, engineAddress }) {
263264

264265
await batchClient
265266
.createNamespacedJob('default', job)
266-
.then(res => {
267+
.then(() => {
267268
console.log(`Job started successfully`);
268269
// console.log(res.body);
269270
})

engine/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const { get } = require('./config');
22
const { logger } = require('./logger');
3+
const redis = require('./redis');
34

45
const app = require('./app.js');
56

engine/src/scan-job/scan-job.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ router.post('/api/v1alpha/scan-job/:scanId/findings', async (req, res) => {
6868
logger.debug(
6969
`Got ${findings.length} from parser for security test: "${scanId}".`
7070
);
71-
71+
7272
const severityOverview = findings.reduce((overview, { severity }) => {
73-
if (overview.hasOwnProperty(severity)) {
73+
if (Object.prototype.hasOwnProperty.call(overview, severity)) {
7474
overview[severity] = overview[severity] + 1;
7575
} else {
7676
overview[severity] = 1;
7777
}
7878
return overview;
7979
}, {});
8080
const categoryOverview = findings.reduce((overview, { category }) => {
81-
if (overview.hasOwnProperty(category)) {
81+
if (Object.prototype.hasOwnProperty.call(overview, category)) {
8282
overview[category] = overview[category] + 1;
8383
} else {
8484
overview[category] = 1;

integrations/example/parser/src/parser.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const fs = require('fs');
22
const util = require('util');
33

4+
// eslint-disable-next-line security/detect-non-literal-fs-filename
45
const readFile = util.promisify(fs.readFile);
56

67
const { parse } = require('./parser');

0 commit comments

Comments
 (0)