Skip to content

Commit

Permalink
fix: don't use DOM types (#252)
Browse files Browse the repository at this point in the history
* fix: don't use DOM types

* chore: add typecheck to CI

* chore: fix lint
  • Loading branch information
sheremet-va authored Feb 19, 2024
1 parent e02eed0 commit f3c3678
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ jobs:

- run: pnpm install --frozen-lockfile
- run: pnpm compile
- run: pnpm typecheck
- run: pnpm lint
- run: pnpm test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ."
},
Expand Down
3 changes: 2 additions & 1 deletion src/pure/watch/ws-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down
9 changes: 3 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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/**/*"]
Expand Down

0 comments on commit f3c3678

Please sign in to comment.