Skip to content

Commit d80f744

Browse files
committed
[breaking] drop eslint < 8, node < 20
1 parent e5dda96 commit d80f744

File tree

5 files changed

+58
-153
lines changed

5 files changed

+58
-153
lines changed

.github/workflows/node-4+.yml

Lines changed: 0 additions & 139 deletions
This file was deleted.

.github/workflows/node.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: 'Tests: node.js'
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
matrix:
7+
runs-on: ubuntu-latest
8+
outputs:
9+
latest: ${{ steps.set-matrix.outputs.requireds }}
10+
steps:
11+
- uses: ljharb/actions/node/matrix@main
12+
id: set-matrix
13+
with:
14+
versionsAsRoot: true
15+
type: 'majors'
16+
preset: '^20.18 || ^22.10 || >= 23'
17+
18+
latest:
19+
needs: [matrix]
20+
name: 'latest majors'
21+
runs-on: ubuntu-latest
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
27+
eslint:
28+
- 9
29+
- 8
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
- uses: ljharb/actions/node/install@main
36+
name: 'nvm install ${{ matrix.node-version }} && npm install'
37+
env:
38+
NPM_CONFIG_LEGACY_PEER_DEPS: true
39+
with:
40+
after_install: npm install --no-save "eslint@${{ matrix.eslint }}"
41+
node-version: ${{ matrix.node-version }}
42+
skip-ls-check: true
43+
- run: npm run tests-only
44+
- uses: codecov/codecov-action@v3.1.5
45+
46+
node:
47+
name: 'node 20+'
48+
needs: [latest]
49+
runs-on: ubuntu-latest
50+
steps:
51+
- run: true

__tests__/src/rules/img-redundant-alt-test.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// -----------------------------------------------------------------------------
99

1010
import { RuleTester } from 'eslint';
11-
import semver from 'semver';
12-
import { version as eslintVersion } from 'eslint/package.json';
1311
import parserOptionsMapper from '../../__util__/parserOptionsMapper';
1412
import parsers from '../../__util__/helpers/parsers';
1513
import rule from '../../../src/rules/img-redundant-alt';
@@ -66,10 +64,8 @@ ruleTester.run('img-redundant-alt', rule, {
6664
{ code: '<img alt />' },
6765
{ code: '<img alt={imageAlt} />' },
6866
{ code: '<img alt={imageAlt.name} />' },
69-
semver.satisfies(eslintVersion, '>= 6') ? [
70-
{ code: '<img alt={imageAlt?.name} />', languageOptions: { ecmaVersion: 2020 } },
71-
{ code: '<img alt="Doing cool things" aria-hidden={foo?.bar}/>', languageOptions: { ecmaVersion: 2020 } },
72-
] : [],
67+
{ code: '<img alt={imageAlt?.name} />', parserOptions: { ecmaVersion: 2020 } },
68+
{ code: '<img alt="Doing cool things" aria-hidden={foo?.bar}/>', parserOptions: { ecmaVersion: 2020 } },
7369
{ code: '<img alt="Photography" />;' },
7470
{ code: '<img alt="ImageMagick" />;' },
7571
{ code: '<Image alt="Photo of a friend" />' },

__tests__/src/rules/role-supports-aria-props-test.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import {
1212
roles,
1313
} from 'aria-query';
1414
import { RuleTester } from 'eslint';
15-
import { version as eslintVersion } from 'eslint/package.json';
16-
import semver from 'semver';
1715
import iterFrom from 'es-iterator-helpers/Iterator.from';
1816
import filter from 'es-iterator-helpers/Iterator.prototype.filter';
1917
import map from 'es-iterator-helpers/Iterator.prototype.map';
@@ -399,8 +397,7 @@ ruleTester.run('role-supports-aria-props', rule, {
399397
{ code: '<datalist aria-expanded />' },
400398
{ code: '<div role="heading" aria-level />' },
401399
{ code: '<div role="heading" aria-level="1" />' },
402-
403-
semver.satisfies(eslintVersion, '>= 6') ? {
400+
{
404401
code: `
405402
const HelloThere = () => (
406403
<Hello
@@ -416,7 +413,7 @@ ruleTester.run('role-supports-aria-props', rule, {
416413
417414
const Hello = (props) => <div>{props.frag}</div>;
418415
`,
419-
} : [],
416+
},
420417
validTests,
421418
)).map(parserOptionsMapper),
422419

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"auto-changelog": "^2.5.0",
5050
"babel-plugin-add-module-exports": "^1.0.4",
5151
"babel-preset-airbnb": "^5.0.0",
52-
"eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9",
52+
"eslint": "^8.8 || ^9.13",
5353
"eslint-config-airbnb-base": "^15.0.0",
5454
"eslint-doc-generator": "^1.7.1",
5555
"eslint-plugin-eslint-plugin": "^4.3.0",
@@ -71,7 +71,7 @@
7171
"to-ast": "^1.0.0"
7272
},
7373
"engines": {
74-
"node": ">=4.0"
74+
"node": "^20.18 || ^22.10 || >= 23"
7575
},
7676
"license": "MIT",
7777
"dependencies": {
@@ -93,7 +93,7 @@
9393
"string.prototype.includes": "^2.0.1"
9494
},
9595
"peerDependencies": {
96-
"eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9"
96+
"eslint": "^8.8 || ^9.13"
9797
},
9898
"auto-changelog": {
9999
"output": "CHANGELOG.md",

0 commit comments

Comments
 (0)