Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for node v14, v16 and v18 #345

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 1 addition & 13 deletions benchmarks/measure.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -47,6 +36,5 @@ function runBenchmark(fn, count) {
module.exports = {
runBenchmark,
clearRequireCache,
cpuSpeed,
getNodeVersionMultiplier
cpuSpeed
};
6 changes: 2 additions & 4 deletions benchmarks/runtime.bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ const { Linter } = require('eslint');
const { times, toPairs, fromPairs } = require('rambda');
const {
runBenchmark,
cpuSpeed,
getNodeVersionMultiplier
cpuSpeed
} = require('./measure');
const mochaPlugin = require('../');

Expand Down Expand Up @@ -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 });
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "10.3.0",
"description": "Eslint rules for mocha.",
"engines": {
"node": ">=14.0.0"
"node": ">=20.0.0"
Copy link

@mdmower-csnw mdmower-csnw Mar 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lo1tuma - this implies that "eslint-plugin-mocha will only work on Node.js 20+", right? are you really cutting off support for Node 18 which is supported until April/May 2025? If so, shouldn't this have been introduced as a breaking change (i.e. major version bumped to 11 and a notice added to release notes)?

Copy link
Owner Author

@lo1tuma lo1tuma Mar 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change hasn’t been released yet. I’m aware that this is a breaking change and it will land in a new major version.
For people who still need node versions < 20 I recommend using eslint-plugin-mocha 10.x. If there are any critical bugs I’m happy to backport them to v10 and make new patch releases as long as node v18 is around.

},
"main": "index.js",
"files": [
Expand Down
Loading