From edea554993e23fba410d8b4d83d604c1e6a782e2 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Mon, 11 Jul 2022 17:36:24 +0200 Subject: [PATCH] Fix Node type imports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TypeScript 4.7 includes the new `node16` module resolution value. This requires imports to have an extension, even if the import doesn’t reference an existing `.js` file. This still works with other module resolution values. --- index.js | 2 +- tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0e93965..0c8d8ee 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle * @typedef {import('estree-jsx').Program} Program - * @typedef {import('./complex-types').MdxjsEsm} MdxjsEsm + * @typedef {import('./complex-types.js').MdxjsEsm} MdxjsEsm * * @typedef {MdxjsEsm} MDXJSEsm - Deprecated name, prefer `MdxjsEsm` */ diff --git a/tsconfig.json b/tsconfig.json index e31adf8..eacf0c4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "target": "ES2020", "lib": ["ES2020"], "module": "ES2020", - "moduleResolution": "node", + "moduleResolution": "node16", "allowJs": true, "checkJs": true, "declaration": true,