Skip to content

Commit 2afd06d

Browse files
committed
feat: drop Node 4, 6, 8, 10, 12, 14 & 16 support
BREAKING CHANGE: Requires Node@^18.18.0 || ^20.9.0 || >=21.1.0
1 parent fd1ae63 commit 2afd06d

File tree

8 files changed

+100
-234
lines changed

8 files changed

+100
-234
lines changed

Diff for: .github/workflows/native-wsl.yml

+7-58
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
os: [windows-2019]
19-
node-version: [18, 16, 14, 12, 10, 8, 6, 4]
19+
node-version: [22, 20, 18]
2020
configuration: [wsl, native]
2121

2222
steps:
@@ -30,80 +30,29 @@ jobs:
3030
if: matrix.configuration == 'wsl'
3131
env:
3232
ESLINT_VERSION: 7
33-
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
3433
run: |
3534
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
3635
export NVM_DIR="$HOME/.nvm"
3736
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
3837
nvm install --latest-npm ${{ matrix.node-version }}
3938
40-
if [ ${{ matrix.node-version }} -ge 4 ] && [ ${{ matrix.node-version }} -lt 6 ]; then
41-
npm install eslint@4 --no-save --ignore-scripts
42-
npm install
43-
npm install [email protected] --no-save
44-
npm uninstall @angular-eslint/template-parser @typescript-eslint/parser --no-save
45-
fi
46-
if [ ${{ matrix.node-version }} -ge 6 ] && [ ${{ matrix.node-version }} -lt 7 ]; then
47-
npm install eslint@5 --no-save --ignore-scripts
48-
npm install
49-
npm uninstall @angular-eslint/template-parser --no-save
50-
npm install [email protected] @typescript-eslint/parser@3 --no-save
51-
fi
52-
if [ ${{ matrix.node-version }} -ge 7 ] && [ ${{ matrix.node-version }} -lt 8 ]; then
53-
npm install eslint@6 --no-save --ignore-scripts
54-
npm install
55-
npm install [email protected] typescript-eslint-parser@20 --no-save
56-
npm uninstall @angular-eslint/template-parser --no-save
57-
fi
58-
if [ ${{ matrix.node-version }} -eq 8 ]; then
59-
npm install eslint@6 --no-save --ignore-scripts
60-
npm install
61-
npm uninstall @angular-eslint/template-parser --no-save
62-
npm install @typescript-eslint/parser@3 --no-save
63-
fi
64-
if [ ${{ matrix.node-version }} -gt 8 ] && [ ${{ matrix.node-version }} -lt 10 ]; then
65-
npm install eslint@7 --no-save --ignore-scripts
66-
npm install
67-
npm install @typescript-eslint/parser@3 --no-save
68-
fi
69-
if [ ${{ matrix.node-version }} -ge 10 ] && [ ${{ matrix.node-version }} -lt 12 ]; then
70-
npm install
71-
npm install @typescript-eslint/parser@4 --no-save
72-
fi
73-
if [ ${{ matrix.node-version }} -ge 12 ]; then
74-
npm install
75-
fi
39+
npm install
7640
npm run copy-metafiles
7741
npm run pretest
7842
npm run tests-only
7943
80-
- name: install dependencies for node <= 10
81-
if: matrix.node-version <= '10' && matrix.configuration == 'native'
82-
run: |
83-
npm install --legacy-peer-deps
84-
npm install eslint@7 --no-save
85-
86-
- name: Install dependencies for node > 10
87-
if: matrix.node-version > '10' && matrix.configuration == 'native'
44+
- name: Install dependencies in Native
45+
if: matrix.configuration == 'native'
8846
run: npm install
8947

90-
- name: install the latest version of nyc
48+
- name: install the latest version of nyc in Native
9149
if: matrix.configuration == 'native'
9250
run: npm install nyc@latest --no-save
9351

94-
- name: copy metafiles for node <= 8
95-
if: matrix.node-version <= 8 && matrix.configuration == 'native'
96-
env:
97-
ESLINT_VERSION: 6
98-
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
99-
run: |
100-
npm run copy-metafiles
101-
bash ./tests/dep-time-travel.sh 2>&1
102-
- name: copy metafiles for Node > 8
103-
if: matrix.node-version > 8 && matrix.configuration == 'native'
52+
- name: copy metafiles in Native
53+
if: matrix.configuration == 'native'
10454
env:
10555
ESLINT_VERSION: 7
106-
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
10756
run: |
10857
npm run copy-metafiles
10958
bash ./tests/dep-time-travel.sh 2>&1

Diff for: .github/workflows/node-4+.yml

-160
This file was deleted.

Diff for: .github/workflows/node.yml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: 'Tests: node.js'
2+
3+
on: [pull_request, push]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
matrix:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
latest: ${{ steps.set-matrix.outputs.requireds }}
17+
minors: ${{ steps.set-matrix.outputs.optionals }}
18+
steps:
19+
- uses: ljharb/actions/node/matrix@main
20+
id: set-matrix
21+
with:
22+
versionsAsRoot: true
23+
type: majors
24+
preset: '^18.18.0 || ^20.9.0 || >=21.1.0'
25+
26+
latest:
27+
needs: [matrix]
28+
name: 'majors'
29+
runs-on: ${{ matrix.os }}
30+
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
os:
35+
- ubuntu-latest
36+
- macos-latest
37+
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
38+
eslint:
39+
- 9
40+
- 8
41+
- 7
42+
- 6
43+
- 5
44+
- 4
45+
- 3
46+
- 2
47+
include:
48+
- node-version: 'lts/*'
49+
os: ubuntu-latest
50+
eslint: 7
51+
env:
52+
TS_PARSER: 4
53+
- node-version: 'lts/*'
54+
os: ubuntu-latest
55+
eslint: 7
56+
env:
57+
TS_PARSER: 3
58+
- node-version: 'lts/*'
59+
os: ubuntu-latest
60+
eslint: 7
61+
env:
62+
TS_PARSER: 2
63+
64+
steps:
65+
- uses: actions/checkout@v4
66+
- uses: ljharb/actions/node/install@main
67+
continue-on-error: false
68+
name: 'nvm install ${{ matrix.node-version }} && npm install, with eslint ${{ matrix.eslint }}'
69+
env:
70+
NPM_CONFIG_LEGACY_PEER_DEPS: false
71+
ESLINT_VERSION: ${{ matrix.eslint }}
72+
with:
73+
node-version: ${{ matrix.node-version }}
74+
after_install: npm run copy-metafiles && ./tests/dep-time-travel.sh
75+
skip-ls-check: true
76+
- run: npm run pretest
77+
- run: npm run tests-only
78+
- uses: codecov/[email protected]
79+
80+
node:
81+
name: 'node 18+'
82+
needs: [latest]
83+
runs-on: ubuntu-latest
84+
steps:
85+
- run: 'echo tests completed'

Diff for: .github/workflows/packages.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
id: set-matrix
2121
with:
2222
type: 'majors'
23-
preset: '>= 6' # preset: '>=4' # see https://github.com/import-js/eslint-plugin-import/issues/2053
23+
preset: '^18.18.0 || ^20.9.0 || >=21.1.0'
2424
versionsAsRoot: true
2525

2626
tests:
@@ -46,9 +46,8 @@ jobs:
4646
- uses: ljharb/actions/node/install@main
4747
name: 'nvm install ${{ matrix.node-version }} && npm install'
4848
env:
49-
NPM_CONFIG_LEGACY_PEER_DEPS: ${{ matrix.node-version == 11 && false || true }}
49+
NPM_CONFIG_LEGACY_PEER_DEPS: false
5050
ESLINT_VERSION: ${{ matrix.eslint }}
51-
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
5251
with:
5352
node-version: ${{ matrix.node-version }}
5453
after_install: npm run copy-metafiles && ./tests/dep-time-travel.sh && cd ${{ matrix.package }} && npm install

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "2.31.0",
44
"description": "Import with sanity.",
55
"engines": {
6-
"node": ">=4"
6+
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
77
},
88
"main": "lib/index.js",
99
"types": "index.d.ts",

Diff for: resolvers/node/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@
3838
"chai": "^3.5.0",
3939
"mocha": "^3.5.3",
4040
"nyc": "^11.9.0"
41+
},
42+
"engines": {
43+
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
4144
}
4245
}

Diff for: resolvers/webpack/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@
5555
"webpack": "https://gist.github.com/ljharb/9cdb687f3806f8e6cb8a365d0b7840eb"
5656
},
5757
"engines": {
58-
"node": ">= 6"
58+
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
5959
}
6060
}

0 commit comments

Comments
 (0)