Skip to content

Commit

Permalink
feat: drop ESLint v2, v3, v4, v5, v6 & v7 support
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Requires ESLint@^8.57.0 || ^9.0.0
  • Loading branch information
MichaelDeBoey committed Oct 29, 2024
1 parent 1752feb commit a240113
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/native-wsl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
24 changes: 2 additions & 22 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
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
27 changes: 1 addition & 26 deletions tests/dep-time-travel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]

echo "Downgrading TypeScript dependencies..."
npm i --no-save typescript-eslint-parser@15 [email protected]
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"
Expand Down

0 comments on commit a240113

Please sign in to comment.