Skip to content

Commit 2df8be2

Browse files
committed
[Tests] split type-check matrix by ESLint major
Run published type checks against both ESLint 7-9. Use per-matrix dependency setup and exclude unsupported TS combinations for ESLint 10.
1 parent be4395c commit 2df8be2

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/type-check.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ permissions:
77

88
jobs:
99
test:
10-
name: TS ${{ matrix.ts_version }}, "${{ matrix.ts_lib }}"
10+
name: ESLint ${{ matrix.eslint_version }}, TS ${{ matrix.ts_version }}, "${{ matrix.ts_lib }}"
1111
runs-on: ubuntu-latest
1212
strategy:
1313
fail-fast: false
1414
matrix:
15+
eslint_version:
16+
- '7'
17+
- '8'
18+
- '9'
1519
ts_version:
1620
# The official ESLint types are not compatible with TS 3.9
1721
# - 3.9
@@ -41,6 +45,15 @@ jobs:
4145
node-version: 'lts/*'
4246
skip-ls-check: true
4347

48+
- name: select eslint types
49+
run: |
50+
if [ "${{ matrix.eslint_version }}" = "7" ]; then
51+
npm install --no-save eslint@^7 @types/eslint@7.2.10
52+
else
53+
npm uninstall --no-save @types/eslint
54+
npm install --no-save eslint@^${{ matrix.eslint_version }}
55+
fi
56+
4457
- name: build types
4558
run: npm run build-types
4659

@@ -60,6 +73,15 @@ jobs:
6073
run: npm install
6174
working-directory: test-published-types
6275

76+
- name: select eslint for published types
77+
run: |
78+
if [ "${{ matrix.eslint_version }}" = "7" ]; then
79+
npm install --no-save eslint@^7
80+
else
81+
npm install --no-save eslint@^${{ matrix.eslint_version }}
82+
fi
83+
working-directory: test-published-types
84+
6385
- name: install eslint-plugin-react and typescript version ${{ matrix.ts_version }}
6486
run: npm install --no-save "$ESLINT_PLUGIN_REACT_PATH" typescript@${{ matrix.ts_version }}
6587
working-directory: test-published-types

0 commit comments

Comments
 (0)