Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1e4b665

Browse files
committedMar 2, 2025
Run type tests against different versions of ESLint and TS during CI
1 parent 8683642 commit 1e4b665

File tree

4 files changed

+57
-16
lines changed

4 files changed

+57
-16
lines changed
 

Diff for: ‎.github/workflows/ci.yml

+46-5
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ jobs:
4343
run: npm run lint
4444

4545
test:
46-
name:
47-
🧪 Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{
46+
name: 🧪 Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{
4847
matrix.os }})
4948
strategy:
5049
fail-fast: false
@@ -118,12 +117,54 @@ jobs:
118117
- name: ▶️ Run test:types script
119118
run: npm run test:types
120119

120+
type-tests:
121+
name: 🧪 Type tests with ESLint ${{ matrix.eslint }} and TypeScript ${{ matrix.ts }}
122+
runs-on: ubuntu-latest
123+
124+
strategy:
125+
fail-fast: false
126+
127+
matrix:
128+
eslint: [8, 9]
129+
ts: ["5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6"]
130+
131+
steps:
132+
- name: ⬇️ Checkout repo
133+
uses: actions/checkout@v4
134+
135+
- name: ⎔ Setup Node
136+
uses: actions/setup-node@v4
137+
with:
138+
node-version: 18
139+
140+
- name: 📥 Install dependencies
141+
run: npm install
142+
143+
- name: Pack the package
144+
id: pack
145+
run: npm install "$(npm pack | tail -n1)"
146+
147+
- name: 📥 Uninstall @types/eslint
148+
if: matrix.eslint != 8
149+
run: npm uninstall @types/eslint
150+
151+
- name: 📥 Install ESLint version ${{ matrix.eslint }}
152+
run: npm install --save-dev eslint@${{ matrix.eslint }}
153+
154+
- name: 📥 Install TypeScript version ${{ matrix.ts }}
155+
run: npm install --save-dev typescript@${{ matrix.ts }} -f
156+
157+
- name: ▶️ Run test:types script
158+
run: npm run test:types
159+
160+
- name: 📝 List version of ESLint
161+
run: npm why eslint @types/eslint
162+
121163
release:
122164
name: 🚀 Release
123-
needs: [ lint, test ]
165+
needs: [lint, test]
124166
runs-on: ubuntu-latest
125-
if:
126-
github.repository == 'eslint-community/eslint-plugin-eslint-comments' &&
167+
if: github.repository == 'eslint-community/eslint-plugin-eslint-comments' &&
127168
contains('refs/heads/main,refs/heads/next,refs/heads/beta,refs/heads/alpha',
128169
github.ref) && github.event_name == 'push'
129170
steps:

Diff for: ‎package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"ignore": "^5.2.4"
3939
},
4040
"devDependencies": {
41-
"@arethetypeswrong/cli": "^0.17.0",
41+
"@arethetypeswrong/cli": "^0.17.4",
4242
"@babel/core": "^7.22.9",
4343
"@babel/eslint-parser": "^7.22.9",
4444
"@eslint-community/eslint-plugin-mysticatea": "^15.5.1",
@@ -48,15 +48,15 @@
4848
"cross-spawn": "^7.0.3",
4949
"esbuild": "^0.19.3",
5050
"eslint": "^8.46.0",
51-
"expect-type": "^1.1.0",
51+
"expect-type": "^1.2.0",
5252
"fs-extra": "^10.1.0",
5353
"mocha": "^10.4.0",
5454
"monaco-editor": "^0.47.0",
5555
"nyc": "^15.1.0",
5656
"opener": "^1.5.2",
5757
"rimraf": "^3.0.2",
5858
"semver": "^7.5.4",
59-
"typescript": "^5.6.3",
59+
"typescript": "^5.8.2",
6060
"vite-plugin-eslint4b": "^0.2.1",
6161
"vitepress": "^1.0.0-rc.15"
6262
},

Diff for: ‎tests/types/configs.test-d.cts

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import expectTypeOf = expectTypeModule.expectTypeOf
77

88
expectTypeOf(configs)
99
.toHaveProperty("recommended")
10-
.toMatchTypeOf<Linter.FlatConfig>()
10+
.toExtend<Linter.FlatConfig>()
1111

12-
expectTypeOf([configs.recommended]).toMatchTypeOf<Linter.FlatConfig[]>()
12+
expectTypeOf([configs.recommended]).toExtend<Linter.FlatConfig[]>()
1313

14-
expectTypeOf(configs.recommended).toMatchTypeOf<Linter.FlatConfig>()
14+
expectTypeOf(configs.recommended).toExtend<Linter.FlatConfig>()
1515

1616
expectTypeOf(configs)
1717
.toHaveProperty("recommended")
18-
.toMatchTypeOf<Linter.FlatConfig>()
18+
.toExtend<Linter.FlatConfig>()

Diff for: ‎tests/types/configs.test-d.mts

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { expectTypeOf } from "expect-type"
44

55
expectTypeOf(configs)
66
.toHaveProperty("recommended")
7-
.toMatchTypeOf<Linter.FlatConfig>()
7+
.toExtend<Linter.FlatConfig>()
88

9-
expectTypeOf([configs.recommended]).toMatchTypeOf<Linter.FlatConfig[]>()
9+
expectTypeOf([configs.recommended]).toExtend<Linter.FlatConfig[]>()
1010

11-
expectTypeOf(configs.recommended).toMatchTypeOf<Linter.FlatConfig>()
11+
expectTypeOf(configs.recommended).toExtend<Linter.FlatConfig>()
1212

1313
expectTypeOf(configs)
1414
.toHaveProperty("recommended")
15-
.toMatchTypeOf<Linter.FlatConfig>()
15+
.toExtend<Linter.FlatConfig>()

0 commit comments

Comments
 (0)
Please sign in to comment.