mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-24 20:17:50 +02:00
refactor: enforce type import specifiers (#6230)
* refactor: enforce type import specifiers * fix * Upgrade esbuild * Fix (haha)
This commit is contained in:
parent
24d65d9bdd
commit
cb1aa30286
192 changed files with 484 additions and 337 deletions
|
@ -11,10 +11,10 @@ import React, {
|
|||
useEffect,
|
||||
useRef,
|
||||
useCallback,
|
||||
RefObject,
|
||||
Dispatch,
|
||||
SetStateAction,
|
||||
ReactNode,
|
||||
type RefObject,
|
||||
type Dispatch,
|
||||
type SetStateAction,
|
||||
type ReactNode,
|
||||
useLayoutEffect,
|
||||
} from 'react';
|
||||
|
||||
|
|
|
@ -5,7 +5,12 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import React, {ComponentProps, ReactElement, useRef, useState} from 'react';
|
||||
import React, {
|
||||
type ComponentProps,
|
||||
type ReactElement,
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import useIsBrowser from '@docusaurus/useIsBrowser';
|
||||
import clsx from 'clsx';
|
||||
import {useCollapsible, Collapsible} from '../Collapsible';
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
DocsSidebarProvider,
|
||||
findSidebarCategory,
|
||||
} from '../docsUtils';
|
||||
import {
|
||||
import type {
|
||||
PropSidebar,
|
||||
PropSidebarItem,
|
||||
PropSidebarItemCategory,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import {TOCItem} from '@docusaurus/types';
|
||||
import type {TOCItem} from '@docusaurus/types';
|
||||
import {filterTOC} from '../tocUtils';
|
||||
|
||||
describe('filterTOC', () => {
|
||||
|
|
|
@ -10,7 +10,7 @@ import React, {
|
|||
useEffect,
|
||||
useCallback,
|
||||
useMemo,
|
||||
ReactNode,
|
||||
type ReactNode,
|
||||
useContext,
|
||||
createContext,
|
||||
} from 'react';
|
||||
|
|
|
@ -7,16 +7,16 @@
|
|||
|
||||
import React, {
|
||||
createContext,
|
||||
ReactNode,
|
||||
type ReactNode,
|
||||
useContext,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useState,
|
||||
} from 'react';
|
||||
import {useThemeConfig, DocsVersionPersistence} from '../useThemeConfig';
|
||||
import {useThemeConfig, type DocsVersionPersistence} from '../useThemeConfig';
|
||||
import {isDocsPluginEnabled} from '../docsUtils';
|
||||
|
||||
import {useAllDocsData, GlobalPluginData} from '@theme/hooks/useDocs';
|
||||
import {useAllDocsData, type GlobalPluginData} from '@theme/hooks/useDocs';
|
||||
|
||||
import DocsPreferredVersionStorage from './DocsPreferredVersionStorage';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import {createStorageSlot} from '../storageUtils';
|
||||
import {DocsVersionPersistence} from '../useThemeConfig';
|
||||
import type {DocsVersionPersistence} from '../useThemeConfig';
|
||||
|
||||
const storageKey = (pluginId: string) => `docs-preferred-version-${pluginId}`;
|
||||
|
||||
|
|
|
@ -7,7 +7,11 @@
|
|||
|
||||
import {useCallback} from 'react';
|
||||
import {useDocsPreferredVersionContext} from './DocsPreferredVersionProvider';
|
||||
import {useAllDocsData, useDocsData, GlobalVersion} from '@theme/hooks/useDocs';
|
||||
import {
|
||||
useAllDocsData,
|
||||
useDocsData,
|
||||
type GlobalVersion,
|
||||
} from '@theme/hooks/useDocs';
|
||||
|
||||
import {DEFAULT_PLUGIN_ID} from '@docusaurus/constants';
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import React, {createContext, ReactNode, useContext} from 'react';
|
||||
import React, {createContext, type ReactNode, useContext} from 'react';
|
||||
import {useAllDocsData} from '@theme/hooks/useDocs';
|
||||
import {
|
||||
import type {
|
||||
PropSidebar,
|
||||
PropSidebarItem,
|
||||
PropSidebarItemCategory,
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
|
||||
import React, {
|
||||
useState,
|
||||
ReactNode,
|
||||
type ReactNode,
|
||||
useContext,
|
||||
createContext,
|
||||
useEffect,
|
||||
ComponentType,
|
||||
type ComponentType,
|
||||
useMemo,
|
||||
} from 'react';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React, {
|
||||
createContext,
|
||||
ReactNode,
|
||||
type ReactNode,
|
||||
useCallback,
|
||||
useContext,
|
||||
useEffect,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import {useMemo} from 'react';
|
||||
import {TOCItem} from '@docusaurus/types';
|
||||
import type {TOCItem} from '@docusaurus/types';
|
||||
|
||||
type FilterTOCParam = {
|
||||
toc: readonly TOCItem[];
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import {useEffect} from 'react';
|
||||
import {useLocation} from '@docusaurus/router';
|
||||
import {Location} from '@docusaurus/history';
|
||||
import type {Location} from '@docusaurus/history';
|
||||
import {usePrevious} from './usePrevious';
|
||||
import {useDynamicCallback} from './reactUtils';
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
*/
|
||||
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import {PrismTheme} from 'prism-react-renderer';
|
||||
import {CSSProperties} from 'react';
|
||||
import {DeepPartial} from 'utility-types';
|
||||
import type {PrismTheme} from 'prism-react-renderer';
|
||||
import type {CSSProperties} from 'react';
|
||||
import type {DeepPartial} from 'utility-types';
|
||||
|
||||
export type DocsVersionPersistence = 'localStorage' | 'none';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue