From 6f8db19867ca1320321386c7ac0bf339b41a5ff0 Mon Sep 17 00:00:00 2001 From: Keiichiro Amemiya Date: Mon, 26 Jun 2023 22:37:15 +0900 Subject: [PATCH] fix: fix type error with moduleResolution node16 --- package.json | 2 +- src/base.ts | 2 +- tsconfig.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 58b3667..c89912c 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "scripts": { "build": "npm-run-all clean build:*", "build:bundle": "microbundle -f modern,esm,cjs --no-compress src/{json,msgpack}.ts --generateTypes false", - "build:types": "tsc --emitDeclarationOnly", + "build:types": "tsc --emitDeclarationOnly && tsc --noEmit --moduleResolution bundler", "build:unpkg": "node scripts/generate-unpkg.js", "clean": "rimraf dist", "dev": "npm run build:bundle --watch", diff --git a/src/base.ts b/src/base.ts index 71434f3..14e4ba4 100644 --- a/src/base.ts +++ b/src/base.ts @@ -1,5 +1,5 @@ import createDebug from 'debug'; -import EventEmitter from 'eventemitter3'; +import {EventEmitter} from 'eventemitter3'; // Import under alias so DOM's WebSocket type can be used import WebSocketIpml from 'isomorphic-ws'; import type {Except, Merge, SetOptional} from 'type-fest'; diff --git a/tsconfig.json b/tsconfig.json index 8cafa0b..b21acda 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "module": "ESNext", "strict": true, "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "node16", "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "declaration": true,