Skip to content

Commit e2903e9

Browse files
Run TypeScript on the types (#1042)
Co-authored-by: ehmicky <[email protected]>
1 parent ab2a9ed commit e2903e9

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"node": ">=18"
2121
},
2222
"scripts": {
23-
"test": "xo && c8 ava && tsd"
23+
"test": "xo && c8 ava && tsd && tsc"
2424
},
2525
"files": [
2626
"index.js",
@@ -72,6 +72,7 @@
7272
"path-key": "^4.0.0",
7373
"tempfile": "^5.0.0",
7474
"tsd": "^0.31.0",
75+
"typescript": "^5.4.5",
7576
"which": "^4.0.0",
7677
"xo": "^0.58.0"
7778
},

test-d/return/result-main.test-d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ expectType<[]>(unicornsResultSync.pipedFrom);
5353

5454
const error = new Error('.');
5555
if (error instanceof ExecaError) {
56-
expectAssignable<ExecaError>(error);
56+
expectType<ExecaError<any>>(error);
5757
expectType<'ExecaError'>(error.name);
5858
expectType<string>(error.message);
5959
expectType<number | undefined>(error.exitCode);
@@ -75,7 +75,7 @@ if (error instanceof ExecaError) {
7575

7676
const errorSync = new Error('.');
7777
if (errorSync instanceof ExecaSyncError) {
78-
expectAssignable<ExecaSyncError>(errorSync);
78+
expectType<ExecaSyncError<any>>(errorSync);
7979
expectType<'ExecaSyncError'>(errorSync.name);
8080
expectType<string>(errorSync.message);
8181
expectType<number | undefined>(errorSync.exitCode);

tsconfig.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"compilerOptions": {
3+
"module": "nodenext",
4+
"moduleResolution": "nodenext",
5+
"target": "ES2022",
6+
"strict": true
7+
},
8+
"files": [
9+
"index.d.ts"
10+
]
11+
}

0 commit comments

Comments
 (0)