Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wallet] fix: consistent type importing with prefer-top-level #587

Merged
merged 1 commit into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FC } from 'react';
import type { FC } from 'react';
import { StyleSheet } from 'react-native';
import { Text, View } from '@walless/gui';
import Link from 'next/link';
Expand Down
3 changes: 2 additions & 1 deletion apps/wallet/src/components/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FC, useMemo } from 'react';
import type { FC } from 'react';
import { useMemo } from 'react';
import {
ClipPath,
Defs,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FC, useEffect, useRef } from 'react';
import type { FC } from 'react';
import { useEffect, useRef } from 'react';
import { Platform, StyleSheet, View } from 'react-native';
import type { GestureStateManager } from 'react-native-gesture-handler';
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
Expand Down
3 changes: 2 additions & 1 deletion apps/wallet/src/features/Home/History.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FC, useEffect, useState } from 'react';
import type { FC } from 'react';
import { useEffect, useState } from 'react';
import { ActivityIndicator, StyleSheet } from 'react-native';
import { Button, Text, View } from '@walless/gui';
import HistoryFeature from 'features/History';
Expand Down
3 changes: 2 additions & 1 deletion apps/wallet/src/features/Send/InputTransaction/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FC, useEffect } from 'react';
import type { FC } from 'react';
import { useEffect } from 'react';
import { StyleSheet } from 'react-native';
import type { SliderHandle } from '@walless/gui';
import { View } from '@walless/gui';
Expand Down
3 changes: 2 additions & 1 deletion apps/wallet/src/features/Send/TransactionResult/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FC, useEffect } from 'react';
import type { FC } from 'react';
import { useEffect } from 'react';
import { StyleSheet } from 'react-native';
import type { SlideComponentProps } from '@walless/gui';
import { View } from '@walless/gui';
Expand Down
3 changes: 2 additions & 1 deletion apps/wallet/src/features/Send/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FC, useEffect } from 'react';
import type { FC } from 'react';
import { useEffect } from 'react';
import { StyleSheet } from 'react-native';
import type { Networks } from '@walless/core';
import { Slider } from '@walless/gui';
Expand Down
3 changes: 2 additions & 1 deletion apps/wallet/src/features/Setting/MyWallets/Wallet.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { FC } from 'react';
import type { PublicKeyDocument } from '@walless/store';
import BaseWallet from 'components/Wallet';
import { getNetworkInfo, type NetworkInfo } from 'utils/helper';
import type { NetworkInfo } from 'utils/helper';
import { getNetworkInfo } from 'utils/helper';

interface Props {
item: PublicKeyDocument;
Expand Down
3 changes: 2 additions & 1 deletion apps/wallet/src/features/Swap/InputSwap/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FC, useState } from 'react';
import type { FC } from 'react';
import { useState } from 'react';
import { ActivityIndicator, StyleSheet } from 'react-native';
import type { SlideComponentProps } from '@walless/gui';
import { Button, View } from '@walless/gui';
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/features/Widget/BuiltInNetwork/NftTab.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FC } from 'react';
import type { FC } from 'react';
import { ScrollView, StyleSheet } from 'react-native';
import type { Networks } from '@walless/core';
import { Text, View } from '@walless/gui';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FC } from 'react';
import type { FC } from 'react';
import type { StyleProp, ViewStyle } from 'react-native';
import { StyleSheet } from 'react-native';
import { View } from '@walless/gui';
Expand Down
6 changes: 4 additions & 2 deletions apps/wallet/src/modals/Receive/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ import { getNetworkInfo } from 'utils/helper';
import { usePublicKeys } from 'utils/hooks';

import Indicator from './Indicator';
import Slider, { type IndicatorOption, type SlideOption } from './Slider';
import WalletCard, { type WalletProps } from './WalletCard';
import type { IndicatorOption, SlideOption } from './Slider';
import Slider from './Slider';
import type { WalletProps } from './WalletCard';
import WalletCard from './WalletCard';

export interface ReceiveModalContext {
network?: Networks;
Expand Down
3 changes: 2 additions & 1 deletion apps/wallet/src/stacks/Dashboard/TabBarItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FC, useEffect } from 'react';
import type { FC } from 'react';
import { useEffect } from 'react';
import type { StyleProp, ViewStyle } from 'react-native';
import { StyleSheet } from 'react-native';
import {
Expand Down
7 changes: 2 additions & 5 deletions apps/wallet/src/stacks/Explorer/CollectionStack/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ import { createStackNavigator } from '@react-navigation/stack';
import { withStackContainer } from 'components/StackContainer';
import NFTScreen from 'screens/NFT';
import CollectionScreen from 'screens/NFTCollection';
import {
type CollectionParamList,
type ExploreParamList,
navigateBack,
} from 'utils/navigation';
import type { CollectionParamList, ExploreParamList } from 'utils/navigation';
import { navigateBack } from 'utils/navigation';

type Props = StackScreenProps<ExploreParamList, 'Collection'>;

Expand Down
7 changes: 2 additions & 5 deletions apps/wallet/src/stacks/Setting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ import { withStackContainer } from 'components/StackContainer';
import ReferralScreen from 'screens/Dashboard/Referral';
import SettingScreen from 'screens/Dashboard/Setting';
import { appState } from 'state/app';
import {
type DashboardParamList,
navigateBack,
type SettingParamList,
} from 'utils/navigation';
import type { DashboardParamList, SettingParamList } from 'utils/navigation';
import { navigateBack } from 'utils/navigation';
import { useSnapshot } from 'valtio';

type Props = StackScreenProps<DashboardParamList, 'Setting'>;
Expand Down
3 changes: 2 additions & 1 deletion apps/wallet/src/utils/auth/w3a/tkey.ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { environment } from 'utils/config';
import { w3aBaseUrl } from '../../config/index.web';

import type { CoreThresholdKey } from './core';
import { type CoreModules, coreModules } from './core';
import type { CoreModules } from './core';
import { coreModules } from './core';

type ExtTkeyModules = CoreModules & {
chromeStorage: ChromeExtensionStorageModule;
Expand Down
3 changes: 2 additions & 1 deletion apps/wallet/src/utils/auth/w3a/tkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import type { CustomAuthArgs } from '@toruslabs/customauth';
import CustomAuthCore from '@toruslabs/customauth-react-native-sdk';
import { environment } from 'utils/config';

import { type CoreModules, coreModules, type CoreThresholdKey } from './core';
import type { CoreModules, CoreThresholdKey } from './core';
import { coreModules } from './core';

export const customAuthArgs: CustomAuthArgs = {
web3AuthClientId: environment.WEB3AUTH_ID,
Expand Down
3 changes: 2 additions & 1 deletion apps/wallet/src/utils/auth/w3a/tkey.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import CustomAuthCore from '@toruslabs/customauth';
import { environment } from 'utils/config';
import { w3aBaseUrl } from 'utils/config/index.web';

import { type CoreModules, coreModules, type CoreThresholdKey } from './core';
import type { CoreModules, CoreThresholdKey } from './core';
import { coreModules } from './core';

type WebTkeyModules = CoreModules & {
webStorage: WebStorageModule;
Expand Down
2 changes: 1 addition & 1 deletion apps/widgets/src/components/BulletSeparator.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FC } from 'react';
import type { FC } from 'react';
import type { ViewProps, ViewStyle } from 'react-native';
import { StyleSheet } from 'react-native';
import { View } from '@walless/gui';
Expand Down
2 changes: 1 addition & 1 deletion apps/widgets/src/components/SEOHead/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FC } from 'react';
import type { FC } from 'react';
import Head from 'next/head';

import globalMeta from './globalMeta';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FC } from 'react';
import type { FC } from 'react';
import { StyleSheet } from 'react-native';
import { Button, View } from '@walless/gui';
import {
Expand All @@ -9,7 +9,7 @@ import {
Twitter,
Youtube,
} from '@walless/icons';
import { type IconProps } from '@walless/icons/components/types';
import type { IconProps } from '@walless/icons/components/types';
import Link from 'next/link';

interface ISocialAnchorsProps {
Expand Down
2 changes: 1 addition & 1 deletion apps/widgets/src/components/layouts/HomeLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FC, type ReactNode } from 'react';
import type { FC, ReactNode } from 'react';
import { View } from '@walless/gui';
import { sharedStyles } from 'utils/style';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type FC } from 'react';
import type { FC } from 'react';
import { ScrollView, StyleSheet, TextInput } from 'react-native';
import { type UserProfile } from '@walless/core';
import type { UserProfile } from '@walless/core';
import { Text, View } from '@walless/gui';
import Image from 'next/image';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FC } from 'react';
import type { FC } from 'react';
import { StyleSheet } from 'react-native';
import { Text, View } from '@walless/gui';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FC } from 'react';
import type { FC } from 'react';
import { StyleSheet } from 'react-native';
import { View } from '@walless/gui';
import Image from 'next/image';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FC } from 'react';
import type { FC } from 'react';
import { StyleSheet, TouchableOpacity } from 'react-native';
import { Text } from '@walless/gui';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FC } from 'react';
import type { FC } from 'react';
import { StyleSheet } from 'react-native';
import { Button, Text } from '@walless/gui';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { type FC } from 'react';
import type { FC } from 'react';
import { StyleSheet } from 'react-native';
import { Hoverable, Text, View } from '@walless/gui';
import { Heart } from '@walless/icons';
import Image from 'next/image';
import { useRouter } from 'next/router';

import { type LayoutProps } from '../../internal';
import type { LayoutProps } from '../../internal';

interface Props {
layout: LayoutProps;
Expand Down
4 changes: 2 additions & 2 deletions apps/widgets/src/features/LayoutSection/Layouts/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type FC } from 'react';
import type { FC } from 'react';
import { StyleSheet } from 'react-native';
import { Text, View } from '@walless/gui';

import { type LayoutProps } from '../../internal';
import type { LayoutProps } from '../../internal';

import LayoutCard from './LayoutCard';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type FC } from 'react';
import { type ViewStyle } from 'react-native';
import type { FC } from 'react';
import type { ViewStyle } from 'react-native';
import { Defs, G, LinearGradient, Path, Stop, Svg } from 'react-native-svg';

export interface ParticleProps {
Expand Down
4 changes: 2 additions & 2 deletions apps/widgets/src/features/internal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type CommentProps } from './LayoutDetails/components/DetailTabs/CommentsTab';
import { type InfoProps } from './LayoutDetails/components/DetailTabs/InformationTab';
import type { CommentProps } from './LayoutDetails/components/DetailTabs/CommentsTab';
import type { InfoProps } from './LayoutDetails/components/DetailTabs/InformationTab';

export interface LayoutProps {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/widgets/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { clusterApiUrl } from '@solana/web3.js';
import { WallessWalletAdapter } from '@walless/walless-adapter-solana-base';
import SEOHead from 'components/SEOHead';
import { type AppProps } from 'next/app';
import type { AppProps } from 'next/app';

import 'raf/polyfill';

Expand Down
2 changes: 1 addition & 1 deletion apps/widgets/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type FC } from 'react';
import type { FC } from 'react';
import { HomeLayout } from 'components/layouts';
import LayoutSection from 'features/LayoutSection';
import WalletCustomizeSection from 'features/WalletCustomizeSection';
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-solana-base/src/extend.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Walless } from '@walless/sdk';
import type { Walless } from '@walless/sdk';

declare const window: Window & {
walless: Walless;
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'simple-import-sort', 'prettier'],
plugins: ['@typescript-eslint', 'simple-import-sort', 'prettier', 'import'],
extends: [
'eslint:recommended',
'plugin:import/typescript',
Expand All @@ -15,6 +15,7 @@ module.exports = {
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],

'simple-import-sort/exports': 'error',
'simple-import-sort/imports': [
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@walless/eslint-config",
"version": "0.0.7",
"version": "0.0.8",
"main": "index.js",
"files": [
"index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/gui/components/DrawerContainer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { type FC, type ReactNode } from 'react';
import type { FC, ReactNode } from 'react';
import type {
LayoutChangeEvent,
LayoutRectangle,
StyleProp,
ViewStyle,
} from 'react-native';
import { StyleSheet, TouchableWithoutFeedback } from 'react-native';
import { type DrawerPosition } from 'react-native-gesture-handler';
import type { DrawerPosition } from 'react-native-gesture-handler';
import Animated, {
useAnimatedStyle,
useSharedValue,
Expand Down
6 changes: 4 additions & 2 deletions packages/gui/components/DrawerContainer/shared.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Easing, type LayoutRectangle, type ViewStyle } from 'react-native';
import { type SharedValue, withTiming } from 'react-native-reanimated';
import type { LayoutRectangle, ViewStyle } from 'react-native';
import { Easing } from 'react-native';
import type { SharedValue } from 'react-native-reanimated';
import { withTiming } from 'react-native-reanimated';

export type DrawerPosition = 'left' | 'right';
export type DrawerType = 'front' | 'back' | 'slide' | 'permanent';
Expand Down
3 changes: 2 additions & 1 deletion packages/gui/components/SliderTabs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { FC } from 'react';
import { StyleSheet, type ViewStyle } from 'react-native';
import type { ViewStyle } from 'react-native';
import { StyleSheet } from 'react-native';

import View from '../View';

Expand Down
2 changes: 1 addition & 1 deletion packages/store/plugins/upsert.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type PouchDB from 'pouchdb-core';

import { type UpsertDiffFunc } from './type';
import type { UpsertDiffFunc } from './type';

type UpsertOptions = {
new: boolean;
Expand Down
5 changes: 3 additions & 2 deletions packages/ui/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type FC, type ReactNode } from 'react';
import { type GetProps, type StackProps, styled } from '@tamagui/core';
import type { FC, ReactNode } from 'react';
import type { GetProps, StackProps } from '@tamagui/core';
import { styled } from '@tamagui/core';

import { Stack, Text } from './styled';

Expand Down
3 changes: 2 additions & 1 deletion packages/ui/components/ImageBackground.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ImageBackground as RNImageBackground } from 'react-native';
import { type GetProps, styled } from '@tamagui/core';
import type { GetProps } from '@tamagui/core';
import { styled } from '@tamagui/core';

export const ImageBackground = styled(RNImageBackground, {
name: 'ImageBackground',
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/components/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { TextInput } from 'react-native';
import { type GetProps, setupReactNative, styled } from '@tamagui/core';
import type { GetProps } from '@tamagui/core';
import { setupReactNative, styled } from '@tamagui/core';
import { focusableInputHOC } from '@tamagui/focusable';

setupReactNative({
Expand Down
5 changes: 3 additions & 2 deletions packages/ui/components/Provider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type FC, type ReactNode } from 'react';
import { type TamaguiInternalConfig, TamaguiProvider } from '@tamagui/core';
import type { FC, ReactNode } from 'react';
import type { TamaguiInternalConfig } from '@tamagui/core';
import { TamaguiProvider } from '@tamagui/core';

interface Props {
config: TamaguiInternalConfig;
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/components/ScrollView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ScrollView as ScrollViewNative } from 'react-native';
import { type GetProps, styled } from '@tamagui/core';
import type { GetProps } from '@tamagui/core';
import { styled } from '@tamagui/core';

import { fullscreenStyle } from './shared';

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/components/styled.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { GetProps } from '@tamagui/core';
import {
type GetProps,
Stack as TamaguiStack,
styled,
Text as TamaguiText,
Expand Down
Loading