Skip to content

Commit 012ec39

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 e636308 commit 012ec39

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

.github/workflows/type-check.yml

Lines changed: 40 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
@@ -29,6 +33,20 @@ jobs:
2933
- es2015,dom
3034
- es2020
3135
- esnext
36+
exclude:
37+
# ESLint 9 ships types via @eslint/core which requires TS >= 5.0
38+
- eslint_version: '9'
39+
ts_version: '4.0'
40+
- eslint_version: '9'
41+
ts_version: 4.1
42+
- eslint_version: '9'
43+
ts_version: 4.2
44+
- eslint_version: '9'
45+
ts_version: 4.3
46+
- eslint_version: '9'
47+
ts_version: 4.4
48+
- eslint_version: '9'
49+
ts_version: 4.5
3250
steps:
3351
- uses: actions/checkout@v4
3452
with:
@@ -41,6 +59,18 @@ jobs:
4159
node-version: 'lts/*'
4260
skip-ls-check: true
4361

62+
- name: select eslint types
63+
run: |
64+
if [ "${{ matrix.eslint_version }}" = "9" ]; then
65+
npm uninstall --no-save @types/eslint
66+
npm install --no-save eslint@^9 typescript@^5
67+
elif [ "${{ matrix.eslint_version }}" = "7" ]; then
68+
npm install --no-save eslint@^7 @types/eslint@7.2.10
69+
else
70+
npm uninstall --no-save @types/eslint
71+
npm install --no-save eslint@^${{ matrix.eslint_version }}
72+
fi
73+
4474
- name: build types
4575
run: npm run build-types
4676

@@ -60,6 +90,15 @@ jobs:
6090
run: npm install
6191
working-directory: test-published-types
6292

93+
- name: select eslint for published types
94+
run: |
95+
if [ "${{ matrix.eslint_version }}" = "7" ]; then
96+
npm install --no-save eslint@^7
97+
else
98+
npm install --no-save eslint@^${{ matrix.eslint_version }}
99+
fi
100+
working-directory: test-published-types
101+
63102
- name: install eslint-plugin-react and typescript version ${{ matrix.ts_version }}
64103
run: npm install --no-save "$ESLINT_PLUGIN_REACT_PATH" typescript@${{ matrix.ts_version }}
65104
working-directory: test-published-types

types/eslint-core-augment.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import '@eslint/core';
2+
3+
declare module '@eslint/core' {
4+
interface SettingsConfig {
5+
react?: {
6+
pragma?: string;
7+
fragment?: string;
8+
createClass?: string;
9+
};
10+
}
11+
}
12+
13+
export {};

0 commit comments

Comments
 (0)