mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-13 14:57:54 +02:00
chore: upgrade monorepo to TS 5.8 (#10966)
* Upgrade to TS 5.8 * increase build perf CI timeout values * enable erasableSyntaxOnly * enable erasableSyntaxOnly
This commit is contained in:
parent
dec3bcbbd7
commit
d33004da1e
24 changed files with 30 additions and 72 deletions
|
@ -22,8 +22,6 @@ import type {WebpackCompilerName} from '@docusaurus/utils';
|
|||
import type {MDXFrontMatter} from './frontMatter';
|
||||
import type {Options} from './options';
|
||||
import type {AdmonitionOptions} from './remark/admonitions';
|
||||
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {ProcessorOptions} from '@mdx-js/mdx';
|
||||
|
||||
// TODO as of April 2023, no way to import/re-export this ESM type easily :/
|
||||
|
|
|
@ -4,10 +4,7 @@
|
|||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {Transformer, Plugin} from 'unified';
|
||||
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {ContainerDirective} from 'mdast-util-directive';
|
||||
import type {Parent, Root} from 'mdast';
|
||||
|
||||
|
|
|
@ -4,11 +4,8 @@
|
|||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {Transformer, Plugin} from 'unified';
|
||||
import type {Heading, Parent, Root} from 'mdast';
|
||||
|
||||
// @ts-expect-error: ES support...
|
||||
import type {MdxJsxFlowElement} from 'mdast-util-mdx';
|
||||
|
||||
interface PluginOptions {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {Transformer} from 'unified';
|
||||
|
||||
import type {Root} from 'mdast';
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {Transformer} from 'unified';
|
||||
|
||||
import type {Root} from 'mdast';
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
/* Based on remark-slug (https://github.com/remarkjs/remark-slug) and gatsby-remark-autolink-headers (https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-remark-autolink-headers) */
|
||||
|
||||
import {parseMarkdownHeadingId, createSlugger} from '@docusaurus/utils';
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {Plugin, Transformer} from 'unified';
|
||||
import type {Root, Text} from 'mdast';
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {Transformer, Plugin} from 'unified';
|
||||
import type {Root} from 'mdast';
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
import {transformNode} from '../utils';
|
||||
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {Transformer} from 'unified';
|
||||
import type {Root} from 'mdast';
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ import {
|
|||
type URLPath,
|
||||
} from '@docusaurus/utils';
|
||||
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {Plugin, Transformer} from 'unified';
|
||||
import type {Definition, Link, Root} from 'mdast';
|
||||
|
||||
|
|
|
@ -14,13 +14,8 @@ import {
|
|||
isNamedExport,
|
||||
} from './utils';
|
||||
import type {Heading, Root} from 'mdast';
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {Plugin, Transformer} from 'unified';
|
||||
import type {
|
||||
MdxjsEsm,
|
||||
MdxJsxFlowElement,
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
} from 'mdast-util-mdx';
|
||||
import type {MdxjsEsm, MdxJsxFlowElement} from 'mdast-util-mdx';
|
||||
import type {TOCItems} from './types';
|
||||
import type {ImportDeclaration} from 'estree';
|
||||
|
||||
|
|
|
@ -7,10 +7,7 @@
|
|||
|
||||
import {toValue} from '../utils';
|
||||
import type {Node} from 'unist';
|
||||
import type {
|
||||
MdxjsEsm,
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
} from 'mdast-util-mdx';
|
||||
import type {MdxjsEsm} from 'mdast-util-mdx';
|
||||
import type {TOCHeading, TOCItem, TOCItems, TOCSlice} from './types';
|
||||
import type {
|
||||
Program,
|
||||
|
|
|
@ -20,9 +20,7 @@ import escapeHtml from 'escape-html';
|
|||
import sizeOf from 'image-size';
|
||||
import logger from '@docusaurus/logger';
|
||||
import {assetRequireAttributeValue, transformNode} from '../utils';
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {Plugin, Transformer} from 'unified';
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {MdxJsxTextElement} from 'mdast-util-mdx';
|
||||
import type {Image, Root} from 'mdast';
|
||||
import type {Parent} from 'unist';
|
||||
|
|
|
@ -17,9 +17,7 @@ import {
|
|||
} from '@docusaurus/utils';
|
||||
import escapeHtml from 'escape-html';
|
||||
import {assetRequireAttributeValue, transformNode} from '../utils';
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {Plugin, Transformer} from 'unified';
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {MdxJsxTextElement} from 'mdast-util-mdx';
|
||||
import type {Parent} from 'unist';
|
||||
import type {Link, Literal, Root} from 'mdast';
|
||||
|
|
|
@ -10,14 +10,9 @@ import logger from '@docusaurus/logger';
|
|||
import {posixPath} from '@docusaurus/utils';
|
||||
import {transformNode} from '../utils';
|
||||
import type {Root} from 'mdast';
|
||||
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
import type {Transformer, Processor, Parent, Plugin} from 'unified';
|
||||
import type {
|
||||
Directives,
|
||||
TextDirective,
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
} from 'mdast-util-directive';
|
||||
import type {Parent} from 'unist';
|
||||
import type {Transformer, Processor, Plugin} from 'unified';
|
||||
import type {Directives, TextDirective} from 'mdast-util-directive';
|
||||
|
||||
type DirectiveType = Directives['type'];
|
||||
|
||||
|
@ -133,21 +128,18 @@ const plugin: Plugin<unknown[], Root> = function plugin(
|
|||
|
||||
const unusedDirectives: Directives[] = [];
|
||||
|
||||
visit<Parent, DirectiveType[]>(
|
||||
tree,
|
||||
directiveTypes,
|
||||
(directive: Directives) => {
|
||||
// If directive data is set (hName/hProperties set by admonitions)
|
||||
// this usually means the directive has been handled by another plugin
|
||||
if (isUnusedDirective(directive)) {
|
||||
if (isSimpleTextDirective(directive)) {
|
||||
transformSimpleTextDirectiveToString(directive);
|
||||
} else {
|
||||
unusedDirectives.push(directive);
|
||||
}
|
||||
// @ts-expect-error: TODO fix type
|
||||
visit<Parent, Directives>(tree, directiveTypes, (directive: Directives) => {
|
||||
// If directive data is set (hName/hProperties set by admonitions)
|
||||
// this usually means the directive has been handled by another plugin
|
||||
if (isUnusedDirective(directive)) {
|
||||
if (isSimpleTextDirective(directive)) {
|
||||
transformSimpleTextDirectiveToString(directive);
|
||||
} else {
|
||||
unusedDirectives.push(directive);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
// We only enable these warnings for the client compiler
|
||||
// This avoids emitting duplicate warnings in prod mode
|
||||
|
|
|
@ -12,7 +12,6 @@ import type {
|
|||
MdxJsxAttribute,
|
||||
MdxJsxAttributeValueExpression,
|
||||
MdxJsxTextElement,
|
||||
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
|
||||
} from 'mdast-util-mdx';
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue