diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d93fd1..9805e7e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,5 +26,6 @@ jobs: - run: pnpm install --frozen-lockfile - run: pnpm compile + - run: pnpm typecheck - run: pnpm lint - run: pnpm test diff --git a/package.json b/package.json index 95f0e17..228ad3b 100644 --- a/package.json +++ b/package.json @@ -149,6 +149,7 @@ "compile": "tsup ./src/extension.ts --external vscode --minify", "watch": "tsup ./src/extension.ts --external vscode --watch --sourcemap", "test": "vitest run --config vite.global-config.ts", + "typecheck": "tsc --noEmit", "lint": "eslint --cache .", "lint:fix": "eslint --cache --fix ." }, diff --git a/src/pure/watch/ws-client.ts b/src/pure/watch/ws-client.ts index 1ec1301..e65d529 100644 --- a/src/pure/watch/ws-client.ts +++ b/src/pure/watch/ws-client.ts @@ -4,6 +4,7 @@ import { shallowReactive } from '@vue/reactivity' import type { BirpcReturn } from 'birpc' import { createBirpc } from 'birpc' import { parse, stringify } from 'flatted' +import WebSocket from 'ws' import type { File, @@ -114,7 +115,7 @@ export function createClient(url: string, options: VitestClientOptions = {}) { reconnectInterval = 2000, reconnectTries = 10, reactive = v => v, - WebSocketConstructor = globalThis.WebSocket, + WebSocketConstructor = WebSocket, onFailedConnection, } = options diff --git a/tsconfig.json b/tsconfig.json index 6e34250..f161b0b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,15 @@ { "compilerOptions": { "target": "ES2020", - "lib": ["ES2020", "ESNext.Disposable", "DOM"], + "lib": ["ES2020", "ESNext.Disposable"], "rootDir": "src", "module": "commonJS", + "types": ["node"], "strict": true, "outDir": "out", "sourceMap": true, "esModuleInterop": true, - "skipLibCheck": true /* enable all strict type-checking options */ - /* Additional Checks */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ + "skipLibCheck": true }, "include": ["src/**/*.ts"], "exclude": ["samples/**/*"]