Skip to content

Commit 9932114

Browse files
committed
ci(types): split type-check matrix by ESLint major (7/10)
Run published type checks against both ESLint 7 and 10. Use per-matrix dependency setup and exclude unsupported TS combinations for ESLint 10.
1 parent a7b967b commit 9932114

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

.github/workflows/type-check.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ 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+
- '10'
1518
ts_version:
1619
# The official ESLint types are not compatible with TS 3.9
1720
# - 3.9
@@ -29,6 +32,10 @@ jobs:
2932
- es2015,dom
3033
- es2020
3134
- esnext
35+
exclude:
36+
# ESLint 10 types require TS >= 4.1 (mapped type `as`).
37+
- eslint_version: '10'
38+
ts_version: '4.0'
3239
steps:
3340
- uses: actions/checkout@v4
3441
with:
@@ -41,6 +48,17 @@ jobs:
4148
node-version: 'lts/*'
4249
skip-ls-check: true
4350

51+
- name: select eslint types
52+
run: |
53+
if [ "${{ matrix.eslint_version }}" = "10" ]; then
54+
# Avoid dev dependency peer conflicts with eslint@10.
55+
npm prune --omit=dev
56+
npm uninstall --no-save @types/eslint
57+
npm install --no-save --legacy-peer-deps eslint@^10 typescript@^5
58+
else
59+
npm install --no-save eslint@^7 @types/eslint@7.2.10
60+
fi
61+
4462
- name: build types
4563
run: npm run build-types
4664

@@ -64,6 +82,15 @@ jobs:
6482
run: npm install --no-save "$ESLINT_PLUGIN_REACT_PATH" typescript@${{ matrix.ts_version }}
6583
working-directory: test-published-types
6684

85+
- name: select eslint for published types
86+
run: |
87+
if [ "${{ matrix.eslint_version }}" = "10" ]; then
88+
npm install --no-save eslint@^10
89+
else
90+
npm install --no-save eslint@^7
91+
fi
92+
working-directory: test-published-types
93+
6794
- name: show installed typescript version
6895
run: npm list typescript --depth=0
6996
working-directory: test-published-types

0 commit comments

Comments
 (0)