diff --git a/.eslintrc b/.eslintrc index c9869cd0..05116a25 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,19 +7,18 @@ "jest": true }, "parser": "@typescript-eslint/parser", - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended", - "prettier" - ], - "plugins": [ - "import" - ], "parserOptions": { "project": "tsconfig.json", "sourceType": "module" }, + "plugins": [ + "import" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:prettier/recommended" + ], "rules": { "linebreak-style": ["error", "unix"], "no-empty": 1, @@ -182,3 +181,4 @@ ] } } + diff --git a/README.md b/README.md index fef5ac81..3382819c 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ npm run prebuild # build the dist and native objects npm run build # run the repl (this allows you to import from ./src) -npm run ts-node +npm run tsx # run the tests npm run test # lint the source code diff --git a/benches/index.ts b/benches/index.ts index 553f154f..6e870210 100644 --- a/benches/index.ts +++ b/benches/index.ts @@ -1,13 +1,16 @@ #!/usr/bin/env ts-node -import type { Summary } from 'benny/lib/internal/common-types'; +import type { Summary } from 'benny/lib/internal/common-types.js'; import fs from 'fs'; import path from 'path'; +import url from 'node:url'; import si from 'systeminformation'; -import { fsWalk, resultsPath, suitesPath } from './utils'; +import { fsWalk, resultsPath, suitesPath } from './utils.js'; + +const dirname = url.fileURLToPath(new URL('.', import.meta.url)); async function main(): Promise { - await fs.promises.mkdir(path.join(__dirname, 'results'), { recursive: true }); + await fs.promises.mkdir(path.join(dirname, 'results'), { recursive: true }); // Running all suites for await (const suitePath of fsWalk(suitesPath)) { // Skip over non-ts and non-js files @@ -44,12 +47,12 @@ async function main(): Promise { system: 'model, manufacturer', }); await fs.promises.writeFile( - path.join(__dirname, 'results', 'system.json'), + path.join(dirname, 'results', 'system.json'), JSON.stringify(systemData, null, 2), ); } -if (require.main === module) { +if (process.argv[1] === url.fileURLToPath(import.meta.url)) { void main(); } diff --git a/benches/results/buffers/buffer_allocation.chart.html b/benches/results/buffers/buffer_allocation.chart.html index fa03e13b..d4fa2ad8 100644 --- a/benches/results/buffers/buffer_allocation.chart.html +++ b/benches/results/buffers/buffer_allocation.chart.html @@ -28,7 +28,7 @@
- +