Skip to content

Commit 4aff27c

Browse files
committedAug 23, 2021
[Tests] test on TS parser v2, v3, and v4
1 parent aa8d566 commit 4aff27c

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed
 

‎.github/workflows/node-4+.yml

+5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ jobs:
3333
- 3
3434
- 2
3535
include:
36+
- node-version: 'lts/*'
37+
eslint: 7
38+
ts-parser: 3
39+
env:
40+
TS_PARSER: 3
3641
- node-version: 'lts/*'
3742
eslint: 7
3843
ts-parser: 2

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"devDependencies": {
5757
"@eslint/import-test-order-redirect-scoped": "file:./tests/files/order-redirect-scoped",
5858
"@test-scope/some-module": "file:./tests/files/symlinked-module",
59-
"@typescript-eslint/parser": "^2.23.0 || ^3.3.0",
59+
"@typescript-eslint/parser": "^2.23.0 || ^3.3.0 || ^4.29.3",
6060
"array.prototype.flatmap": "^1.2.4",
6161
"babel-cli": "^6.26.0",
6262
"babel-core": "^6.26.3",

‎tests/dep-time-travel.sh

+8-7
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ export NPM_CONFIG_LEGACY_PEER_DEPS=true
88

99
npm install --no-save "eslint@${ESLINT_VERSION}" --ignore-scripts
1010

11-
# completely remove the new TypeScript parser for ESLint < v5
12-
if [[ "$ESLINT_VERSION" -lt "5" ]]; then
11+
12+
13+
if [[ -n "$TS_PARSER" ]]; then # if TS parser is manually set, always use it
14+
echo "Downgrading @typescript-eslint/parser..."
15+
npm i --no-save "@typescript-eslint/parser@${TS_PARSER}"
16+
elif [[ "$ESLINT_VERSION" -lt "5" ]]; then # completely remove the new TypeScript parser for ESLint < v5
1317
echo "Removing @typescript-eslint/parser..."
1418
npm uninstall --no-save @typescript-eslint/parser
19+
elif [[ "$TRAVIS_NODE_VERSION" -lt "10" ]]; then # TS parser 3 requires node 10+
20+
npm i --no-save "@typescript-eslint/parser@3"
1521
fi
1622

1723
# use these alternate TypeScript dependencies for ESLint < v4
@@ -28,8 +34,3 @@ if [[ "$TRAVIS_NODE_VERSION" -lt "8" ]]; then
2834
echo "Downgrading eslint-import-resolver-typescript..."
2935
npm i --no-save eslint-import-resolver-typescript@1.0.2
3036
fi
31-
32-
if [[ -n "$TS_PARSER" ]]; then
33-
echo "Downgrading @typescript-eslint/parser..."
34-
npm i --no-save @typescript-eslint/parser@2
35-
fi

0 commit comments

Comments
 (0)
Please sign in to comment.