From e987841d26e2e78c6f72d3eaf171ee2f7632644b Mon Sep 17 00:00:00 2001 From: Mathias Schreck Date: Fri, 16 Feb 2024 12:57:50 +0100 Subject: [PATCH] Remove support for node v14, v16 and v18 --- .github/workflows/ci.yml | 2 +- benchmarks/measure.js | 14 +------------- benchmarks/runtime.bench.js | 6 ++---- package.json | 2 +- 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ba0f40..cc54dab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [14, 16, 18, 20] + node: [20, 21] name: Node ${{ matrix.node }} steps: - uses: actions/checkout@v2 diff --git a/benchmarks/measure.js b/benchmarks/measure.js index 06a7e49..f89be7d 100644 --- a/benchmarks/measure.js +++ b/benchmarks/measure.js @@ -3,20 +3,9 @@ const os = require('os'); const { performance: performanceHooks } = require('perf_hooks'); const { times, median, map, prop } = require('rambda'); -const semver = require('semver'); const [ { speed: cpuSpeed } ] = os.cpus(); -function getNodeVersionMultiplier() { - const currentNodeVersion = process.version; - - if (semver.lt(currentNodeVersion, '14.0.0')) { - return 1.5; - } - - return 1; -} - function clearRequireCache() { Object.keys(require.cache).forEach(function (key) { delete require.cache[key]; @@ -47,6 +36,5 @@ function runBenchmark(fn, count) { module.exports = { runBenchmark, clearRequireCache, - cpuSpeed, - getNodeVersionMultiplier + cpuSpeed }; diff --git a/benchmarks/runtime.bench.js b/benchmarks/runtime.bench.js index 5290ff8..6cc9428 100644 --- a/benchmarks/runtime.bench.js +++ b/benchmarks/runtime.bench.js @@ -5,8 +5,7 @@ const { Linter } = require('eslint'); const { times, toPairs, fromPairs } = require('rambda'); const { runBenchmark, - cpuSpeed, - getNodeVersionMultiplier + cpuSpeed } = require('./measure'); const mochaPlugin = require('../'); @@ -89,8 +88,7 @@ function lintManyFilesWithAllRecommendedRules({ numberOfFiles }) { describe('runtime', () => { it('should not take longer as the defined budget to lint many files with the recommended config', () => { - const nodeVersionMultiplier = getNodeVersionMultiplier(); - const budget = 3750000 / cpuSpeed * nodeVersionMultiplier; + const budget = 3750000 / cpuSpeed; const { medianDuration } = runBenchmark(() => { lintManyFilesWithAllRecommendedRules({ numberOfFiles: 350 }); diff --git a/package.json b/package.json index d00b691..5e3f814 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "10.3.0", "description": "Eslint rules for mocha.", "engines": { - "node": ">=14.0.0" + "node": ">=20.0.0" }, "main": "index.js", "files": [