From 39111484b65d93dafaf8f9f31831966c6aff3d52 Mon Sep 17 00:00:00 2001 From: Christian Murphy Date: Wed, 8 Feb 2023 09:24:49 -0700 Subject: [PATCH] Add `module: node16` to `tsconfig.json` Closes GH-2211. Closes GH-2228. --- package-lock.json | 15 ++++++++------- packages/esbuild/test/index.test.js | 2 +- packages/loader/test/index.test.js | 2 +- packages/mdx/lib/evaluate.js | 2 +- packages/mdx/lib/plugin/rehype-remove-raw.js | 1 + packages/mdx/test/compile.js | 4 ++-- packages/node-loader/test/index.test.js | 2 +- packages/preact/lib/index.js | 2 +- packages/react/lib/index.js | 2 +- packages/register/test/index.test.cjs | 2 +- packages/rollup/test/index.test.js | 2 +- packages/vue/lib/index.js | 2 +- packages/vue/test/test.js | 6 +++--- tsconfig.json | 9 +++------ 14 files changed, 26 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index e267cc16e..e15fa533b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9151,16 +9151,15 @@ } }, "node_modules/mdast-util-to-hast": { - "version": "12.2.4", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.2.4.tgz", - "integrity": "sha512-a21xoxSef1l8VhHxS1Dnyioz6grrJkoaCUgGzMD/7dWHvboYX3VW53esRUfB5tgTyz4Yos1n25SPcj35dJqmAg==", + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.3.0.tgz", + "integrity": "sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==", "dependencies": { "@types/hast": "^2.0.0", "@types/mdast": "^3.0.0", "mdast-util-definitions": "^5.0.0", "micromark-util-sanitize-uri": "^1.1.0", "trim-lines": "^3.0.0", - "unist-builder": "^3.0.0", "unist-util-generated": "^2.0.0", "unist-util-position": "^4.0.0", "unist-util-visit": "^4.0.0" @@ -11537,10 +11536,11 @@ "dev": true }, "node_modules/periscopic": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.0.4.tgz", - "integrity": "sha512-SFx68DxCv0Iyo6APZuw/AKewkkThGwssmU0QWtTlvov3VAtPX+QJ4CadwSaz8nrT5jPIuxdvJWB4PnD2KNDxQg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz", + "integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==", "dependencies": { + "@types/estree": "^1.0.0", "estree-walker": "^3.0.0", "is-reference": "^3.0.0" } @@ -17345,6 +17345,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/unist-builder/-/unist-builder-3.0.0.tgz", "integrity": "sha512-GFxmfEAa0vi9i5sd0R2kcrI9ks0r82NasRq5QHh2ysGngrc6GiqD5CDf1FjPenY4vApmFASBIIlk/jj5J5YbmQ==", + "dev": true, "dependencies": { "@types/unist": "^2.0.0" }, diff --git a/packages/esbuild/test/index.test.js b/packages/esbuild/test/index.test.js index add90b8e3..99e96d4ce 100644 --- a/packages/esbuild/test/index.test.js +++ b/packages/esbuild/test/index.test.js @@ -3,7 +3,7 @@ * @typedef {import('esbuild').Message} Message * @typedef {import('hast').Root} Root * @typedef {import('vfile').VFile} VFile - * @typedef {import('mdx/types').MDXContent} MDXContent + * @typedef {import('mdx/types.js').MDXContent} MDXContent * * @typedef {import('remark-mdx')} */ diff --git a/packages/loader/test/index.test.js b/packages/loader/test/index.test.js index 9f8593085..f3165dd45 100644 --- a/packages/loader/test/index.test.js +++ b/packages/loader/test/index.test.js @@ -1,5 +1,5 @@ /** - * @typedef {import('mdx/types').MDXContent} MDXContent + * @typedef {import('mdx/types.js').MDXContent} MDXContent * @typedef {import('preact').FunctionComponent} PreactComponent * @typedef {import('vue').Component} VueComponent * @typedef {import('vue').SetupContext} SetupContext diff --git a/packages/mdx/lib/evaluate.js b/packages/mdx/lib/evaluate.js index 9a8e04dc8..3a17b98d7 100644 --- a/packages/mdx/lib/evaluate.js +++ b/packages/mdx/lib/evaluate.js @@ -2,7 +2,7 @@ * @typedef {import('vfile').VFileCompatible} VFileCompatible * @typedef {import('./util/resolve-evaluate-options.js').EvaluateOptions} EvaluateOptions * - * @typedef {import('mdx/types').MDXModule} ExportMap + * @typedef {import('mdx/types.js').MDXModule} ExportMap */ import {compile, compileSync} from './compile.js' diff --git a/packages/mdx/lib/plugin/rehype-remove-raw.js b/packages/mdx/lib/plugin/rehype-remove-raw.js index c923803a4..bf660b69f 100644 --- a/packages/mdx/lib/plugin/rehype-remove-raw.js +++ b/packages/mdx/lib/plugin/rehype-remove-raw.js @@ -1,5 +1,6 @@ /** * @typedef {import('hast').Root} Root + * @typedef {import('mdast-util-to-hast')} DoNotRemoveUsedToAddRawToNodeType */ import {visit} from 'unist-util-visit' diff --git a/packages/mdx/test/compile.js b/packages/mdx/test/compile.js index dc50af4d4..d08cd07fc 100644 --- a/packages/mdx/test/compile.js +++ b/packages/mdx/test/compile.js @@ -1,6 +1,6 @@ /** - * @typedef {import('mdx/types').MDXModule} MDXModule - * @typedef {import('mdx/types').MDXContent} MDXContent + * @typedef {import('mdx/types.js').MDXModule} MDXModule + * @typedef {import('mdx/types.js').MDXContent} MDXContent * @typedef {import('hast').Root} Root * @typedef {import('../lib/compile.js').VFileCompatible} VFileCompatible */ diff --git a/packages/node-loader/test/index.test.js b/packages/node-loader/test/index.test.js index cf622f102..e2efde16f 100644 --- a/packages/node-loader/test/index.test.js +++ b/packages/node-loader/test/index.test.js @@ -1,5 +1,5 @@ /** - * @typedef {import('mdx/types').MDXContent} MDXContent + * @typedef {import('mdx/types.js').MDXContent} MDXContent */ import {promises as fs} from 'fs' diff --git a/packages/preact/lib/index.js b/packages/preact/lib/index.js index bea2312a4..ee4c5fa7d 100644 --- a/packages/preact/lib/index.js +++ b/packages/preact/lib/index.js @@ -1,6 +1,6 @@ /** * @typedef {import('preact').ComponentChildren} ComponentChildren - * @typedef {import('mdx/types').MDXComponents} Components + * @typedef {import('mdx/types.js').MDXComponents} Components * * @typedef Props * Configuration. diff --git a/packages/react/lib/index.js b/packages/react/lib/index.js index 96ece0953..421fc2d6a 100644 --- a/packages/react/lib/index.js +++ b/packages/react/lib/index.js @@ -1,6 +1,6 @@ /** * @typedef {import('react').ReactNode} ReactNode - * @typedef {import('mdx/types').MDXComponents} Components + * @typedef {import('mdx/types.js').MDXComponents} Components * * @typedef Props * Configuration. diff --git a/packages/register/test/index.test.cjs b/packages/register/test/index.test.cjs index ee8460fbd..019afcf46 100644 --- a/packages/register/test/index.test.cjs +++ b/packages/register/test/index.test.cjs @@ -1,5 +1,5 @@ /** - * @typedef {import('mdx/types').MDXContent} MDXContent + * @typedef {import('mdx/types.js').MDXContent} MDXContent */ 'use strict' diff --git a/packages/rollup/test/index.test.js b/packages/rollup/test/index.test.js index ae0b0781b..a19f319b5 100644 --- a/packages/rollup/test/index.test.js +++ b/packages/rollup/test/index.test.js @@ -1,5 +1,5 @@ /** - * @typedef {import('mdx/types').MDXContent} MDXContent + * @typedef {import('mdx/types.js').MDXContent} MDXContent */ import {promises as fs} from 'fs' diff --git a/packages/vue/lib/index.js b/packages/vue/lib/index.js index 88df231c4..1efeb5986 100644 --- a/packages/vue/lib/index.js +++ b/packages/vue/lib/index.js @@ -1,5 +1,5 @@ /** - * @typedef {import('mdx/types').MDXComponents} Components + * @typedef {import('mdx/types.js').MDXComponents} Components */ import {provide, inject, createVNode, Fragment} from 'vue' diff --git a/packages/vue/test/test.js b/packages/vue/test/test.js index 188e54958..78211975b 100644 --- a/packages/vue/test/test.js +++ b/packages/vue/test/test.js @@ -1,7 +1,7 @@ /** - * @typedef {import('mdx/types').MDXComponents} Components - * @typedef {import('mdx/types').MDXContent} MDXContent - * @typedef {import('mdx/types').MDXModule} MDXModule + * @typedef {import('mdx/types.js').MDXComponents} Components + * @typedef {import('mdx/types.js').MDXContent} MDXContent + * @typedef {import('mdx/types.js').MDXModule} MDXModule * @typedef {import('vue').Component} AnyComponent */ diff --git a/tsconfig.json b/tsconfig.json index 2f812c8b4..d06db7dc4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,11 @@ { "compilerOptions": { - "target": "ES2020", - "lib": ["ES2020"], - "module": "ES2020", - "moduleResolution": "node", - "allowJs": true, + "target": "es2021", + "lib": ["es2021"], + "module": "node16", "checkJs": true, "declaration": true, "emitDeclarationOnly": true, - "allowSyntheticDefaultImports": true, "skipLibCheck": true, "strict": true }