From 374a8a94c2cb0084ead1e9f55248ba727335be47 Mon Sep 17 00:00:00 2001 From: Kikuo Emoto Date: Tue, 5 Dec 2023 16:27:04 +0900 Subject: [PATCH] fix(lib): enable esModuleInterop - Turns on `esModuleInterop` in TypeScript configs and fixes import statements for `Color` and `mkdirp` packages so that transpiled JS files can be imported in esbuild and Rollup. --- lib/src/bulma-color-tools.ts | 2 +- lib/src/fs-helper.ts | 2 +- lib/tsconfig.json | 3 ++- lib/tsconfig.test.json | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/src/bulma-color-tools.ts b/lib/src/bulma-color-tools.ts index eb6955b..5236041 100644 --- a/lib/src/bulma-color-tools.ts +++ b/lib/src/bulma-color-tools.ts @@ -1,4 +1,4 @@ -import * as Color from 'color' +import Color from 'color' import { Hsl, Rgb, Hex, ColorDef, NameValueColor } from './types' function lightness(color: Color) { diff --git a/lib/src/fs-helper.ts b/lib/src/fs-helper.ts index c0f32b6..e72ecf2 100644 --- a/lib/src/fs-helper.ts +++ b/lib/src/fs-helper.ts @@ -1,5 +1,5 @@ import { promises as fsp } from 'fs' -import * as mkdirp from 'mkdirp' +import mkdirp from 'mkdirp' import * as path from 'path' diff --git a/lib/tsconfig.json b/lib/tsconfig.json index 0ac3e44..38c613a 100644 --- a/lib/tsconfig.json +++ b/lib/tsconfig.json @@ -10,7 +10,8 @@ "noImplicitAny": true, "lib": ["es2019", "dom"], "downlevelIteration": true, - "skipLibCheck": true + "skipLibCheck": true, + "esModuleInterop": true }, "include": ["./src/**/*"], "exclude": ["node_modules", "dist", "**/__mocks__/**/*", "./src/**/*.test.ts"] diff --git a/lib/tsconfig.test.json b/lib/tsconfig.test.json index 4824a57..ba14053 100644 --- a/lib/tsconfig.test.json +++ b/lib/tsconfig.test.json @@ -8,7 +8,8 @@ "moduleResolution": "node", "target": "es2015", "noImplicitAny": true, - "downlevelIteration": true + "downlevelIteration": true, + "esModuleInterop": true }, "include": ["./src/**/*"], "exclude": ["node_modules", "dist"]