From 3eec871fe6c62c511f464aa6679a664193542a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Fri, 25 Oct 2024 05:03:15 +0200 Subject: [PATCH] feat: drop ESLint v2, v3, v4, v5, v6 & v7 support BREAKING CHANGE: Requires ESLint@^8.57.0 || ^9.0.0 --- .github/workflows/native-wsl.yml | 4 ++-- .github/workflows/node.yml | 24 ++---------------------- .github/workflows/packages.yml | 4 +++- package.json | 4 ++-- tests/dep-time-travel.sh | 27 +-------------------------- 5 files changed, 10 insertions(+), 53 deletions(-) diff --git a/.github/workflows/native-wsl.yml b/.github/workflows/native-wsl.yml index 360b2873f..467e78eba 100644 --- a/.github/workflows/native-wsl.yml +++ b/.github/workflows/native-wsl.yml @@ -29,7 +29,7 @@ jobs: - name: 'WSL: do all npm install steps' if: matrix.configuration == 'wsl' env: - ESLINT_VERSION: 7 + ESLINT_VERSION: 9 run: | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash export NVM_DIR="$HOME/.nvm" @@ -52,7 +52,7 @@ jobs: - name: copy metafiles in Native if: matrix.configuration == 'native' env: - ESLINT_VERSION: 7 + ESLINT_VERSION: 9 run: | npm run copy-metafiles bash ./tests/dep-time-travel.sh 2>&1 diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 1f8bbf177..fa5c836af 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -37,29 +37,9 @@ jobs: node-version: ${{ fromJson(needs.matrix.outputs.latest) }} eslint: - 9 + - 9.0.0 - 8 - - 7 - - 6 - - 5 - - 4 - - 3 - - 2 - include: - - node-version: 'lts/*' - os: ubuntu-latest - eslint: 7 - env: - TS_PARSER: 4 - - node-version: 'lts/*' - os: ubuntu-latest - eslint: 7 - env: - TS_PARSER: 3 - - node-version: 'lts/*' - os: ubuntu-latest - eslint: 7 - env: - TS_PARSER: 2 + - 8.57.0 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index db61d30b0..a825227c5 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -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 diff --git a/package.json b/package.json index 5f9f10acc..bcda9d37f 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/tests/dep-time-travel.sh b/tests/dep-time-travel.sh index ceb95be0e..4824f19f5 100755 --- a/tests/dep-time-travel.sh +++ b/tests/dep-time-travel.sh @@ -2,37 +2,12 @@ # expected: ESLINT_VERSION numeric env var -echo "installing ${ESLINT_VERSION} with TS parser ${TS_PARSER:-default}..." +echo "installing ${ESLINT_VERSION}..." export NPM_CONFIG_LEGACY_PEER_DEPS=true -if [[ "$ESLINT_VERSION" -lt "7" ]]; then - echo "Removing @angular-eslint/template-parser..." - npm uninstall --no-save @angular-eslint/template-parser -fi - npm install --no-save "eslint@${ESLINT_VERSION}" --ignore-scripts -if [[ -n "$TS_PARSER" ]]; then # if TS parser is manually set, always use it - echo "Downgrading @typescript-eslint/parser..." - npm i --no-save "@typescript-eslint/parser@${TS_PARSER}" -elif [[ "$ESLINT_VERSION" -lt "5" ]]; then # completely remove the new TypeScript parser for ESLint < v5 - echo "Removing @typescript-eslint/parser..." - npm uninstall --no-save @typescript-eslint/parser -fi - -# use these alternate TypeScript dependencies for ESLint < v4 -if [[ "$ESLINT_VERSION" -lt "4" ]]; then - echo "Downgrading babel-eslint..." - npm i --no-save babel-eslint@8.0.3 - - echo "Downgrading TypeScript dependencies..." - npm i --no-save typescript-eslint-parser@15 typescript@2.8.1 -elif [[ "$ESLINT_VERSION" -lt "7" ]]; then - echo "Downgrading TypeScript dependencies..." - npm i --no-save typescript-eslint-parser@20 -fi - if [ "${ESLINT_VERSION}" = '8' ]; then # This is a workaround for the crash in the initial processing of the ESLint class. echo "Installing self"