From 279839dc433e1b7b4f6176feea091c4cf4e688e7 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 30 Jan 2023 10:05:28 +0100 Subject: [PATCH] benchmark: add trailing commas in `benchmark/module` PR-URL: https://github.com/nodejs/node/pull/46461 Reviewed-By: Moshe Atlow Reviewed-By: James M Snell --- benchmark/.eslintrc.yaml | 1 - benchmark/module/module-loader-circular.js | 2 +- benchmark/module/module-loader-deep.js | 8 ++++---- benchmark/module/module-loader.js | 6 +++--- benchmark/module/module-require.js | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/benchmark/.eslintrc.yaml b/benchmark/.eslintrc.yaml index 8daf5ae9a6e7a8..85b29732f1650e 100644 --- a/benchmark/.eslintrc.yaml +++ b/benchmark/.eslintrc.yaml @@ -15,7 +15,6 @@ overrides: - http/*.js - http2/*.js - misc/*.js - - module/*.js - path/*.js - process/*.js - url/*.js diff --git a/benchmark/module/module-loader-circular.js b/benchmark/module/module-loader-circular.js index 6d392e0e1908db..0d4f1043ced07d 100644 --- a/benchmark/module/module-loader-circular.js +++ b/benchmark/module/module-loader-circular.js @@ -8,7 +8,7 @@ const benchmarkDirectory = path.resolve(tmpdir.path, 'benchmark-module-circular'); const bench = common.createBenchmark(main, { - n: [1e4] + n: [1e4], }); function main({ n }) { diff --git a/benchmark/module/module-loader-deep.js b/benchmark/module/module-loader-deep.js index 5b4f4b907a7ce6..b45fa1e716f9ee 100644 --- a/benchmark/module/module-loader-deep.js +++ b/benchmark/module/module-loader-deep.js @@ -9,7 +9,7 @@ const benchmarkDirectory = path.join(tmpdir.path, 'nodejs-benchmark-module'); const bench = common.createBenchmark(main, { ext: ['', '.js'], files: [1e3], - cache: ['true', 'false'] + cache: ['true', 'false'], }); function main({ ext, cache, files }) { @@ -17,17 +17,17 @@ function main({ ext, cache, files }) { fs.mkdirSync(benchmarkDirectory); fs.writeFileSync( `${benchmarkDirectory}/a.js`, - 'module.exports = {};' + 'module.exports = {};', ); for (let i = 0; i <= files; i++) { fs.mkdirSync(`${benchmarkDirectory}/${i}`); fs.writeFileSync( `${benchmarkDirectory}/${i}/package.json`, - '{"main": "index.js"}' + '{"main": "index.js"}', ); fs.writeFileSync( `${benchmarkDirectory}/${i}/index.js`, - `require('../a${ext}');` + `require('../a${ext}');`, ); } diff --git a/benchmark/module/module-loader.js b/benchmark/module/module-loader.js index f31ac8722cb208..5ef34f0e7530cf 100644 --- a/benchmark/module/module-loader.js +++ b/benchmark/module/module-loader.js @@ -15,7 +15,7 @@ const bench = common.createBenchmark(main, { dir: ['rel', 'abs'], files: [5e2], n: [1, 1e3], - cache: ['true', 'false'] + cache: ['true', 'false'], }); function main({ n, name, cache, files, dir }) { @@ -25,11 +25,11 @@ function main({ n, name, cache, files, dir }) { fs.mkdirSync(`${benchmarkDirectory}${i}`); fs.writeFileSync( `${benchmarkDirectory}${i}/package.json`, - '{"main": "index.js"}' + '{"main": "index.js"}', ); fs.writeFileSync( `${benchmarkDirectory}${i}/index.js`, - 'module.exports = "";' + 'module.exports = "";', ); } diff --git a/benchmark/module/module-require.js b/benchmark/module/module-require.js index d5b72c4b03f2a9..2f06365e59b386 100644 --- a/benchmark/module/module-require.js +++ b/benchmark/module/module-require.js @@ -70,11 +70,11 @@ function createEntryPoint(n) { fs.mkdirSync(`${benchmarkDirectory}${i}`); fs.writeFileSync( `${benchmarkDirectory}${i}/package.json`, - '{"main": "index.js"}' + '{"main": "index.js"}', ); fs.writeFileSync( `${benchmarkDirectory}${i}/index.js`, - JSFileContent + JSFileContent, ); } }