Skip to content

Commit a3e6375

Browse files
authored
fix: refactor runners, add linting (#72)
1 parent 5b237cf commit a3e6375

File tree

25 files changed

+161
-99
lines changed

25 files changed

+161
-99
lines changed

package-lock.json

Lines changed: 36 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"scripts": {
66
"setup": "npm i",
77
"test": "echo \"Error: no test specified\" && exit 1",
8+
"lint": "npm run --workspaces --if-present lint",
9+
"lint:fix": "npm run --workspaces --if-present lint:fix",
810
"load": "expf load",
911
"test:load": "expf load --test=@expressjs/perf-load-example",
1012
"test:load:node": "expf load --test=@expressjs/perf-load-node-http",

packages/autocannon/index.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ export default async function main (_opts = {}) {
3030

3131
return run(opts);
3232
}
33-

packages/autocannon/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33
"version": "1.0.0",
44
"main": "index.mjs",
55
"scripts": {
6-
"test": "echo \"Error: no test specified\" && exit 1"
6+
"test": "echo \"Error: no test specified\" && exit 1",
7+
"lint": "semistandard",
8+
"lint:fix": "semistandard --fix"
79
},
810
"keywords": [],
911
"author": "",
1012
"license": "ISC",
1113
"description": "",
1214
"dependencies": {
1315
"autocannon": "^8.0.0"
16+
},
17+
"devDependencies": {
18+
"semistandard": "^17.0.0"
1419
}
1520
}

packages/cli/bench.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function main (_opts = {}) {
1616
console.log(help());
1717
return;
1818
}
19-
return new Promise(async (resolve, reject) => {
19+
return new Promise((resolve, reject) => {
2020
throw new Error('not yet implemented');
2121
});
22-
};
22+
}

packages/cli/compare.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ export default function main (_opts = {}, resultA, resultB) {
2525
console.log(help());
2626
return;
2727
}
28+
// eslint-disable-next-line no-async-promise-executor
2829
return new Promise(async (resolve, reject) => {
2930
const opts = {
3031
cwd: normalize(join(import.meta.dirname, '..', '..')),
3132
..._opts
3233
};
34+
// TODO: these are considered syntax errors according to semistandard, despite clearly not being so
35+
// likely an old version of eslint parsing under the hood. Just leaving for now.
3336
const a = (await import(join(opts.cwd, resultA), { with: { type: 'json' } })).default.clientResults;
3437
const b = (await import(join(opts.cwd, resultB), { with: { type: 'json' } })).default.clientResults;
3538
const comp = compare(a, b);

packages/cli/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"version": "1.0.0",
44
"main": "bin/expf.mjs",
55
"scripts": {
6-
"test": "echo \"Error: no test specified\" && exit 1"
6+
"test": "echo \"Error: no test specified\" && exit 1",
7+
"lint": "semistandard",
8+
"lint:fix": "semistandard --fix"
79
},
810
"bin": {
911
"expf": "./bin/expf.sh"
@@ -16,5 +18,8 @@
1618
"@pkgjs/nv": "^0.2.2",
1719
"autocannon": "^8.0.0",
1820
"autocannon-compare": "^0.4.0"
21+
},
22+
"devDependencies": {
23+
"semistandard": "^17.0.0"
1924
}
2025
}

packages/metadata/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export function collectMetadata () {
1111
type: os.type(),
1212
version: os.version()
1313
};
14-
}
14+
}

packages/metadata/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"version": "1.0.0",
55
"main": "index.mjs",
66
"scripts": {
7-
"test": "semistandard"
7+
"test": "echo \"Error: no test specified\" && exit 1",
8+
"lint": "semistandard",
9+
"lint:fix": "semistandard --fix"
810
},
911
"keywords": [],
1012
"author": "",

packages/requests/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77
"./get-query": "./get-query.mjs"
88
},
99
"scripts": {
10-
"test": "echo \"Error: no test specified\" && exit 1"
10+
"test": "echo \"Error: no test specified\" && exit 1",
11+
"lint": "semistandard",
12+
"lint:fix": "semistandard --fix"
1113
},
1214
"keywords": [],
1315
"author": "",
1416
"license": "ISC",
15-
"description": ""
17+
"description": "",
18+
"devDependencies": {
19+
"semistandard": "^17.0.0"
20+
}
1621
}

0 commit comments

Comments
 (0)