From 255297454b0f91cfa0907173437ae7f864d1ef66 Mon Sep 17 00:00:00 2001 From: CottonCandyZ Date: Wed, 27 Mar 2024 23:46:14 +0800 Subject: [PATCH] fix: type error in options parameter of mdxOptions (#225) --- package.json | 2 +- src/types.d.ts | 6 +++--- tsconfig.json | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 596baf8..f9cd65e 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "mdx-test-data": "^1.0.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "remark-mdx-images": "^2.0.0", + "remark-mdx-images": "^3.0.0", "typescript": "^5.2.2", "uvu": "^0.5.6" }, diff --git a/src/types.d.ts b/src/types.d.ts index 2eadfaf..a764331 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -6,7 +6,7 @@ import type {Plugin, BuildOptions, Loader} from 'esbuild' import type {ModuleInfo} from '@fal-works/esbuild-plugin-global-externals' -import type {ProcessorOptions} from '@mdx-js/esbuild/lib' +import type {Options} from '@mdx-js/esbuild/lib' import type {GrayMatterOption, Input, GrayMatterFile} from 'gray-matter' import type {MDXComponents} from 'mdx/types' import type {VFile,VFileOptions} from 'vfile' @@ -88,9 +88,9 @@ type BundleMDXOptions = { * ``` */ mdxOptions?: ( - options: ProcessorOptions, + options: Options, frontmatter: Frontmatter, - ) => ProcessorOptions + ) => Options /** * This allows you to modify the built-in esbuild configuration. This can be * especially helpful for specifying the compilation target. diff --git a/tsconfig.json b/tsconfig.json index df69fc4..4c4ce18 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,9 @@ "target": "ES2020", "module": "ES2020", "allowJs": true, - "checkJs": true + "checkJs": true, + "lib": [ + "ES2021.String" + ] } }