Skip to content

Commit

Permalink
fix: lint, unused-package
Browse files Browse the repository at this point in the history
  • Loading branch information
sakul-budhathoki committed Dec 29, 2023
1 parent 45f8cb6 commit 4053d04
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 51 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ web-build/
/cache/
/ios
/android

/weshd/ios/Frameworks/
/weshd/android/libs/
/app-build/

# macOS
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ networks.json: node_modules validate-networks
.PHONY: unused-exports
unused-exports: node_modules
## TODO unexclude all paths except packages/api;packages/contracts-clients;packages/evm-contracts-clients
npx ts-unused-exports ./tsconfig.json --excludePathsFromReport="app.config.ts;packages/api;packages/contracts-clients;packages/evm-contracts-clients;packages/components/socialFeed/RichText/inline-toolbar;modules;./App.tsx;.*\.web|.native|.electron|.d.ts" --ignoreTestFiles
npx ts-unused-exports ./tsconfig.json --excludePathsFromReport="app.config.ts;packages/api;packages/contracts-clients;packages/evm-contracts-clients;packages/components/socialFeed/RichText/inline-toolbar;weshd;./App.tsx;.*\.web|.native|.electron|.d.ts" --ignoreTestFiles

.PHONY: prepare-electron
prepare-electron: node_modules
Expand Down
4 changes: 2 additions & 2 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const config: { expo: ExpoConfig } = {
name: "Teritori",
slug: "teritori",
version: "1.0.0",
owner: "teritori",
orientation: "portrait",
icon: "./assets/icon.png",
owner: "teritori",
userInterfaceStyle: "light",
splash: {
image: "./assets/splash.png",
Expand All @@ -20,7 +20,7 @@ const config: { expo: ExpoConfig } = {
assetBundlePatterns: ["**/*"],
ios: {
supportsTablet: true,
bundleIdentifier: "com.teritori.dapp",
bundleIdentifier: "com.teritori",
},
android: {
adaptiveIcon: {
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ require (
go.uber.org/dig v1.16.1 // indirect
go.uber.org/fx v1.19.2 // indirect
go4.org v0.0.0-20200411211856-f5505b9728dd // indirect
golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
golang.org/x/sync v0.5.0 // indirect
Expand Down
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,6 @@ github.com/ipld/go-ipld-prime v0.14.1/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704n
github.com/ipld/go-ipld-prime v0.20.0 h1:Ud3VwE9ClxpO2LkCYP7vWPc0Fo+dYdYzgxUJZ3uRG4g=
github.com/ipld/go-ipld-prime v0.20.0/go.mod h1:PzqZ/ZR981eKbgdr3y2DJYeD/8bgMawdGVlJDE8kK+M=
github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20211210234204-ce2a1c70cd73 h1:TsyATB2ZRRQGTwafJdgEUQkmjOExRV0DNokcihZxbnQ=
github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20211210234204-ce2a1c70cd73/go.mod h1:2PJ0JgxyB08t0b2WKrcuqI3di0V+5n6RS/LTUJhkoxY=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
Expand Down Expand Up @@ -1689,7 +1688,6 @@ github.com/openzipkin/zipkin-go v0.4.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0
github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA=
github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs=
github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ=
github.com/otiai10/copy v1.6.0/go.mod h1:XWfuS3CrI0R6IE0FbgHsEazaXO8G0LpMp9o8tos0x4E=
github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
Expand All @@ -1708,7 +1706,6 @@ github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaF
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM=
github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 h1:1/WtZae0yGtPq+TI6+Tv1WTxkukpXeMlviSxvL7SRgk=
github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9/go.mod h1:x3N5drFsm2uilKKuuYo6LdyD8vZAW55sH/9w+pbo1sw=
github.com/peterbourgon/ff/v3 v3.3.0 h1:PaKe7GW8orVFh8Unb5jNHS+JZBwWUMa2se0HM6/BI24=
github.com/peterbourgon/ff/v3 v3.3.0/go.mod h1:zjJVUhx+twciwfDl0zBcFzl4dW8axCRyXE/eKY9RztQ=
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0=
Expand Down Expand Up @@ -2070,7 +2067,6 @@ github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0/go.mod h1:x6AKhvS
github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc h1:BCPnHtcboadS0DvysUuJXZ4lWVv5Bh5i7+tbIyi+ck4=
github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc/go.mod h1:r45hJU7yEoA81k6MWNhpMj/kms0n14dkzkxYHoB96UM=
github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 h1:5HZfQkwe0mIfyDmc1Em5GqlNRzcdtlv4HTNmdpt7XH0=
github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11/go.mod h1:Wlo/SzPmxVp6vXpGt/zaXhHH0fn4IxgqZc82aKg6bpQ=
github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI=
github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa h1:EyA027ZAkuaCLoxVX4r1TZMPy1d31fM6hbfQ4OU4I5o=
github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ=
Expand Down Expand Up @@ -2301,8 +2297,6 @@ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPI
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4=
golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a h1:sYbmY3FwUWCBTodZL1S3JUuOvaW6kM2o+clDzzDNBWg=
golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a/go.mod h1:Ede7gF0KGoHlj822RtphAHK1jLdrcuRBZg0sF1Q+SPc=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
"expo-font": "~11.4.0",
"expo-linear-gradient": "~12.3.0",
"expo-optimize": "^0.2.20",
"expo-splash-screen": "~0.20.5",
"expo-status-bar": "~1.6.0",
"google-protobuf": "^3.21.2",
"html-to-draftjs": "^1.5.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/components/SVG/svg.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { Platform, Image } from "react-native";
import { ImageProps, SvgFromUri, SvgProps } from "react-native-svg";
import { Platform, Image, ImageProps } from "react-native";
import { SvgFromUri, SvgProps } from "react-native-svg";

export const SVG: React.FC<
SvgProps & { source: React.FC<SvgProps> | string }
Expand All @@ -11,7 +11,7 @@ export const SVG: React.FC<

if (typeof source === "string" && source.startsWith("http")) {
if (Platform.OS === "web") {
return <Image source={{ uri: source }} {...(svgProps as ImageProps)} />;
return <Image {...(svgProps as ImageProps)} source={{ uri: source }} />;
}
return <SvgFromUri uri={source} {...svgProps} />;
}
Expand Down
6 changes: 2 additions & 4 deletions packages/hooks/useClickOutside.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ export const useClickOutside = <T = View>({
} = {}): [boolean, (value?: boolean) => void, React.RefObject<T>] => {
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
const ref = _useClickOutside<T>(() => {
setIsDropdownOpen((prev) => {
callback?.(!prev);
return !prev;
});
setIsDropdownOpen(false);
callback?.(false);
}, config);

const setDropdownState = (value?: boolean) => {
Expand Down
3 changes: 1 addition & 2 deletions packages/hooks/useSellNFT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useCallback } from "react";
import { Wallet } from "./../context/WalletsProvider/wallet";
import { getMetaMaskEthereumSigner } from "./../utils/ethereum";
import useSelectedWallet from "./useSelectedWallet";
import { initialToastError, useFeedbacks } from "../context/FeedbacksProvider";
import { useFeedbacks } from "../context/FeedbacksProvider";
import { TeritoriNftClient } from "../contracts-clients/teritori-nft/TeritoriNft.client";
import { TeritoriNft__factory } from "../evm-contracts-clients/teritori-nft/TeritoriNft__factory";
import { NFTVault__factory } from "../evm-contracts-clients/teritori-nft-vault/NFTVault__factory";
Expand Down Expand Up @@ -138,7 +138,6 @@ export const useSellNFT = (networkKind: NetworkKind | undefined) => {
throw Error(`Unsupported network ${networkKind}`);
}

setToastError(initialToastError);
const txHash = await sellNFTFunc(
wallet,
nftContractAddress,
Expand Down
6 changes: 1 addition & 5 deletions packages/screens/Launchpad/MintCollectionScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ import { ProgressionCard } from "../../components/cards/ProgressionCard";
import { CollectionSocialButtons } from "../../components/collections/CollectionSocialButtons";
import { GradientText } from "../../components/gradientText";
import { SpacerRow } from "../../components/spacer";
import {
initialToastError,
useFeedbacks,
} from "../../context/FeedbacksProvider";
import { useFeedbacks } from "../../context/FeedbacksProvider";
import { Wallet } from "../../context/WalletsProvider";
import { TeritoriMinter__factory } from "../../evm-contracts-clients/teritori-bunker-minter/TeritoriMinter__factory";
import { useBalances } from "../../hooks/useBalances";
Expand Down Expand Up @@ -249,7 +246,6 @@ export const MintCollectionScreen: ScreenFC<"MintCollection"> = ({

const mint = useCallback(async () => {
try {
setToastError(initialToastError);
if (!wallet) {
setToastError({
title: "Error",
Expand Down
6 changes: 1 addition & 5 deletions packages/screens/Marketplace/NFTDetailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import { ScreenContainer } from "../../components/ScreenContainer";
import { NFTMainInfo } from "../../components/nftDetails/NFTMainInfo";
import { SpacerColumn } from "../../components/spacer";
import { Tabs } from "../../components/tabs/Tabs";
import {
initialToastError,
useFeedbacks,
} from "../../context/FeedbacksProvider";
import { useFeedbacks } from "../../context/FeedbacksProvider";
import { Wallet } from "../../context/WalletsProvider";
import { TeritoriNftVaultClient } from "../../contracts-clients/teritori-nft-vault/TeritoriNftVault.client";
import { NFTVault__factory } from "../../evm-contracts-clients/teritori-nft-vault/NFTVault__factory";
Expand Down Expand Up @@ -94,7 +91,6 @@ const Content: React.FC<{
return;
}

setToastError(initialToastError);
try {
const txHash = await buyFunc(wallet, info);

Expand Down
1 change: 0 additions & 1 deletion packages/screens/Message/components/ChatItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
fontSemibold11,
fontSemibold13,
} from "../../../utils/style/fonts";
import { layout } from "../../../utils/style/layout";
import { Conversation } from "../../../utils/types/message";
import { getConversationName } from "../../../weshnet/messageHelpers";
interface ChatItemProps {
Expand Down
3 changes: 0 additions & 3 deletions packages/screens/Message/components/Request.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useState } from "react";
import { View } from "react-native";
import { Avatar, Badge } from "react-native-paper";

import { MessageAvatar } from "./MessageAvatar";
import { BrandText } from "../../../components/BrandText";
Expand Down Expand Up @@ -31,8 +30,6 @@ const RequestList = ({ isOnline, data }: Props) => {
const { setToastError } = useFeedbacks();
const [addLoading, setAddLoading] = useState(false);

const onlineStatusBadgeColor = isOnline ? "green" : "yellow";

const handleAddFriend = async () => {
setAddLoading(true);
try {
Expand Down
4 changes: 2 additions & 2 deletions packages/store/slices/dapps-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ const initialStatePersisted: DappsStoragePersisted = {
selectedApps: [],
};

export const selectAvailableApps = (state: RootState) =>
export const selectAvailableApps = (state: RootState): dAppGroup =>
state.dAppsStore.availableApps;

export const selectCheckedApps = (state: RootState) =>
export const selectCheckedApps = (state: RootState): pinnedAppsCollection =>
state.dAppsStorePersisted.selectedApps;

const dAppsStore = createSlice({
Expand Down
3 changes: 1 addition & 2 deletions packages/utils/types/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ type ConversationType = "contact" | "group";
const ZodMessagePayload = z.object({
files: z.array(z.any()),
message: z.string(),
type: MessageType,
metadata: z
.object({
groupName: z.string().optional(),
Expand All @@ -36,7 +35,7 @@ export const ZodMessage = z.object({
id: z.string(),
senderId: z.string(),
groupId: z.string(),
type: z.string(),
type: MessageType,
payload: ZodMessagePayload.optional(),
timestamp: z.string(),
parentId: z.string().optional(),
Expand Down
12 changes: 0 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10941,17 +10941,6 @@ __metadata:
languageName: node
linkType: hard

"expo-splash-screen@npm:~0.20.5":
version: 0.20.5
resolution: "expo-splash-screen@npm:0.20.5"
dependencies:
"@expo/prebuild-config": 6.2.6
peerDependencies:
expo: "*"
checksum: c4b0db3d0e8ab755a9f4afb1f20824229fa84ea2410528e4316a62e676e08f990157c9edd4af0978f79183d6b47cf3d4843b86f76c084274a40e07adfd697889
languageName: node
linkType: hard

"expo-status-bar@npm:~1.6.0":
version: 1.6.0
resolution: "expo-status-bar@npm:1.6.0"
Expand Down Expand Up @@ -19883,7 +19872,6 @@ __metadata:
expo-font: ~11.4.0
expo-linear-gradient: ~12.3.0
expo-optimize: ^0.2.20
expo-splash-screen: ~0.20.5
expo-status-bar: ~1.6.0
google-protobuf: ^3.21.2
html-to-draftjs: ^1.5.0
Expand Down

0 comments on commit 4053d04

Please sign in to comment.