Skip to content

Commit 6011903

Browse files
committed
chore: separate type imports from value imports
This PR separates type imports from value imports, in compliance with a newly enforced eslint rule from the new @cprussin configs. This rule is important as it helps prevent cases where tree shaking is less effective due to modules getting included in the runtime build which are in fact only used for type imports.
1 parent 48c1537 commit 6011903

File tree

104 files changed

+292
-401
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+292
-401
lines changed

apps/api-reference/src/apis/evm/common.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import { z } from "zod";
22

3-
import {
4-
type ReadApi,
5-
type WriteApi,
6-
type NetworkInfo,
7-
EvmApiType,
8-
Language,
9-
} from "../../components/EvmApi";
3+
import type { ReadApi, WriteApi, NetworkInfo } from "../../components/EvmApi";
4+
import { EvmApiType, Language } from "../../components/EvmApi";
105
import { singletonArray, safeFetch } from "../../zod-utils";
116

127
export const readApi = <ParameterName extends string>(

apps/api-reference/src/app/price-feeds/[chain]/[method]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"use client";
22

33
import { notFound } from "next/navigation";
4-
import { type ComponentProps, use } from "react";
4+
import type { ComponentProps } from "react";
5+
import { use } from "react";
56

67
import * as apis from "../../../../apis";
78
import { EvmApi } from "../../../../components/EvmApi";

apps/api-reference/src/browser-logger.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import pino, { type Logger } from "pino";
1+
import type { Logger } from "pino";
2+
import pino from "pino";
23

34
import { IS_PRODUCTION_BUILD } from "./isomorphic-config";
45

apps/api-reference/src/components/Accordion/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Disclosure, DisclosurePanel } from "@headlessui/react";
22
import { LazyMotion, AnimatePresence, m, domAnimation } from "framer-motion";
3-
import { type ComponentProps, type Ref, forwardRef } from "react";
3+
import type { ComponentProps, Ref } from "react";
4+
import { forwardRef } from "react";
45

56
export { DisclosureButton as AccordionButton } from "@headlessui/react";
67

apps/api-reference/src/components/Button/index.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
"use client";
22

33
import clsx from "clsx";
4-
import {
5-
type ComponentProps,
6-
type ElementType,
7-
type MouseEvent,
8-
type CSSProperties,
9-
useState,
10-
useCallback,
4+
import type {
5+
ComponentProps,
6+
ElementType,
7+
MouseEvent,
8+
CSSProperties,
119
} from "react";
10+
import { useState, useCallback } from "react";
1211

1312
const DEFAULT_GRADIENT_SIZE = "30rem";
1413

apps/api-reference/src/components/Code/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Transition } from "@headlessui/react";
22
import { ClipboardDocumentIcon, CheckIcon } from "@heroicons/react/24/outline";
33
import clsx from "clsx";
4-
import { useMemo, useCallback, type HTMLAttributes } from "react";
5-
import { useEffect, useState } from "react";
4+
import type { HTMLAttributes } from "react";
5+
import { useMemo, useCallback, useEffect, useState } from "react";
66
import type { OffsetOrPosition } from "shiki";
77

88
import style from "./style.module.css";

apps/api-reference/src/components/Code/shiki.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import {
2-
type HighlighterCore,
3-
type DecorationItem,
4-
getHighlighterCore as shikiGetHighlighterCore,
5-
} from "shiki/core";
1+
import type { HighlighterCore, DecorationItem } from "shiki/core";
2+
import { createHighlighterCore } from "shiki/core";
63
import javascript from "shiki/langs/javascript.mjs";
74
import json from "shiki/langs/json.mjs";
85
import solidity from "shiki/langs/solidity.mjs";

apps/api-reference/src/components/Code/use-highlighted-code.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
"use client";
22

3+
import type { ReactNode, RefObject } from "react";
34
import {
4-
type ReactNode,
5-
type RefObject,
65
createContext,
76
useContext,
87
useState,

apps/api-reference/src/components/EvmApi/index.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@ import { ArrowPathIcon } from "@heroicons/react/24/outline";
1313
import PythAbi from "@pythnetwork/pyth-sdk-solidity/abis/IPyth.json";
1414
import PythErrorsAbi from "@pythnetwork/pyth-sdk-solidity/abis/PythErrors.json";
1515
import { ChainIcon } from "connectkit";
16-
import {
17-
type Dispatch,
18-
type SetStateAction,
19-
type ComponentProps,
20-
type ElementType,
21-
type SVGAttributes,
22-
useState,
23-
useCallback,
24-
useMemo,
16+
import type {
17+
Dispatch,
18+
SetStateAction,
19+
ComponentProps,
20+
ElementType,
21+
SVGAttributes,
2522
} from "react";
23+
import { useState, useCallback, useMemo } from "react";
2624
import { useSwitchChain, useChainId, useConfig } from "wagmi";
2725
import { readContract } from "wagmi/actions";
2826

2927
import type { Parameter } from "./parameter";
3028
import { ParameterInput } from "./parameter-input";
31-
import { type EvmApiType, RunButton } from "./run-button";
29+
import type { EvmApiType } from "./run-button";
30+
import { RunButton } from "./run-button";
3231
import { getLogger } from "../../browser-logger";
3332
import { getContractAddress } from "../../evm-networks";
3433
import { useIsMounted } from "../../use-is-mounted";
35-
import { type SupportedLanguage, Code } from "../Code";
34+
import type { SupportedLanguage } from "../Code";
35+
import { Code } from "../Code";
3636
import { ErrorTooltip } from "../ErrorTooltip";
3737
import { InlineLink } from "../InlineLink";
3838
import { Markdown } from "../Markdown";

apps/api-reference/src/components/EvmApi/parameter-input.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,18 @@ import { ArrowPathIcon } from "@heroicons/react/24/outline";
88
import base58 from "bs58";
99
import clsx from "clsx";
1010
import Image from "next/image";
11-
import {
12-
type ChangeEvent,
13-
type Dispatch,
14-
type SetStateAction,
15-
useState,
16-
useCallback,
17-
useMemo,
18-
useEffect,
19-
} from "react";
11+
import type { ChangeEvent, Dispatch, SetStateAction } from "react";
12+
import { useState, useCallback, useMemo, useEffect } from "react";
2013

14+
import type { Parameter } from "./parameter";
2115
import {
22-
type Parameter,
2316
PLACEHOLDERS,
2417
isValid,
2518
getValidationError,
2619
ParameterType,
2720
} from "./parameter";
21+
import type { PriceFeed } from "../../use-price-feed-list";
2822
import {
29-
type PriceFeed,
3023
PriceFeedListContextType,
3124
usePriceFeedList,
3225
} from "../../use-price-feed-list";

0 commit comments

Comments
 (0)