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

feat: drop ESLint v2, v3, v4, v5, v6 & v7 support #3092

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
69 changes: 9 additions & 60 deletions .github/workflows/native-wsl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-2019]
node-version: [18, 16, 14, 12, 10, 8, 6, 4]
node-version: [22, 20, 18]
configuration: [wsl, native]

steps:
Expand All @@ -29,81 +29,30 @@ jobs:
- name: 'WSL: do all npm install steps'
if: matrix.configuration == 'wsl'
env:
ESLINT_VERSION: 7
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
ESLINT_VERSION: 9
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm install --latest-npm ${{ matrix.node-version }}

if [ ${{ matrix.node-version }} -ge 4 ] && [ ${{ matrix.node-version }} -lt 6 ]; then
npm install eslint@4 --no-save --ignore-scripts
npm install
npm install [email protected] --no-save
npm uninstall @angular-eslint/template-parser @typescript-eslint/parser --no-save
fi
if [ ${{ matrix.node-version }} -ge 6 ] && [ ${{ matrix.node-version }} -lt 7 ]; then
npm install eslint@5 --no-save --ignore-scripts
npm install
npm uninstall @angular-eslint/template-parser --no-save
npm install [email protected] @typescript-eslint/parser@3 --no-save
fi
if [ ${{ matrix.node-version }} -ge 7 ] && [ ${{ matrix.node-version }} -lt 8 ]; then
npm install eslint@6 --no-save --ignore-scripts
npm install
npm install [email protected] typescript-eslint-parser@20 --no-save
npm uninstall @angular-eslint/template-parser --no-save
fi
if [ ${{ matrix.node-version }} -eq 8 ]; then
npm install eslint@6 --no-save --ignore-scripts
npm install
npm uninstall @angular-eslint/template-parser --no-save
npm install @typescript-eslint/parser@3 --no-save
fi
if [ ${{ matrix.node-version }} -gt 8 ] && [ ${{ matrix.node-version }} -lt 10 ]; then
npm install eslint@7 --no-save --ignore-scripts
npm install
npm install @typescript-eslint/parser@3 --no-save
fi
if [ ${{ matrix.node-version }} -ge 10 ] && [ ${{ matrix.node-version }} -lt 12 ]; then
npm install
npm install @typescript-eslint/parser@4 --no-save
fi
if [ ${{ matrix.node-version }} -ge 12 ]; then
npm install
fi
npm install
npm run copy-metafiles
npm run pretest
npm run tests-only

- name: install dependencies for node <= 10
if: matrix.node-version <= '10' && matrix.configuration == 'native'
run: |
npm install --legacy-peer-deps
npm install eslint@7 --no-save

- name: Install dependencies for node > 10
if: matrix.node-version > '10' && matrix.configuration == 'native'
- name: Install dependencies in Native
if: matrix.configuration == 'native'
run: npm install

- name: install the latest version of nyc
- name: install the latest version of nyc in Native
if: matrix.configuration == 'native'
run: npm install nyc@latest --no-save

- name: copy metafiles for node <= 8
if: matrix.node-version <= 8 && matrix.configuration == 'native'
env:
ESLINT_VERSION: 6
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
run: |
npm run copy-metafiles
bash ./tests/dep-time-travel.sh 2>&1
- name: copy metafiles for Node > 8
if: matrix.node-version > 8 && matrix.configuration == 'native'
- name: copy metafiles in Native
if: matrix.configuration == 'native'
env:
ESLINT_VERSION: 7
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
ESLINT_VERSION: 9
run: |
npm run copy-metafiles
bash ./tests/dep-time-travel.sh 2>&1
Expand Down
160 changes: 0 additions & 160 deletions .github/workflows/node-4+.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 'Tests: node.js'

on: [pull_request, push]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
contents: read

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
latest: ${{ steps.set-matrix.outputs.requireds }}
minors: ${{ steps.set-matrix.outputs.optionals }}
steps:
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
versionsAsRoot: true
type: majors
preset: '^18.18.0 || ^20.9.0 || >=21.1.0'

latest:
needs: [matrix]
name: 'majors'
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
eslint:
- 9
- 9.0.0
- 8
- 8.57.0

steps:
- uses: actions/checkout@v4
- uses: ljharb/actions/node/install@main
continue-on-error: false
name: 'nvm install ${{ matrix.node-version }} && npm install, with eslint ${{ matrix.eslint }}'
env:
NPM_CONFIG_LEGACY_PEER_DEPS: false
ESLINT_VERSION: ${{ matrix.eslint }}
with:
node-version: ${{ matrix.node-version }}
after_install: npm run copy-metafiles && ./tests/dep-time-travel.sh
skip-ls-check: true
- run: npm run pretest
- run: npm run tests-only
- uses: codecov/[email protected]

node:
name: 'node 18+'
needs: [latest]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
9 changes: 5 additions & 4 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
id: set-matrix
with:
type: 'majors'
preset: '>= 6' # preset: '>=4' # see https://github.com/import-js/eslint-plugin-import/issues/2053
preset: '^18.18.0 || ^20.9.0 || >=21.1.0'
versionsAsRoot: true

tests:
Expand All @@ -33,8 +33,10 @@ jobs:
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
eslint:
- 9
- 9.0.0
- 8
- 7
- 8.57.0
package:
- resolvers/node
- resolvers/webpack
Expand All @@ -46,9 +48,8 @@ jobs:
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
env:
NPM_CONFIG_LEGACY_PEER_DEPS: ${{ matrix.node-version == 11 && false || true }}
NPM_CONFIG_LEGACY_PEER_DEPS: false
ESLINT_VERSION: ${{ matrix.eslint }}
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
with:
node-version: ${{ matrix.node-version }}
after_install: npm run copy-metafiles && ./tests/dep-time-travel.sh && cd ${{ matrix.package }} && npm install
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.31.0",
"description": "Import with sanity.",
"engines": {
"node": ">=4"
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"main": "lib/index.js",
"directories": {
Expand Down Expand Up @@ -76,7 +76,7 @@
"chai": "^4.3.10",
"cross-env": "^4.0.0",
"escope": "^3.6.0",
"eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9",
"eslint": "^8.57.0 || ^9.0.0",
"eslint-doc-generator": "^1.6.1",
"eslint-import-resolver-node": "file:./resolvers/node",
"eslint-import-resolver-typescript": "^1.0.2 || ^1.1.1",
Expand Down Expand Up @@ -106,7 +106,7 @@
"typescript-eslint-parser": "^15 || ^20 || ^22"
},
"peerDependencies": {
"eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9"
"eslint": "^8.57.0 || ^9.0.0"
},
"dependencies": {
"@rtsao/scc": "^1.1.0",
Expand Down
3 changes: 3 additions & 0 deletions resolvers/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@
"chai": "^3.5.0",
"mocha": "^3.5.3",
"nyc": "^11.9.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
}
Loading