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

Run eslint:recommended when committing #787

Merged
merged 8 commits into from
Mar 15, 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
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["next/core-web-vitals", "prettier"]
"extends": ["eslint:recommended", "next/core-web-vitals", "prettier"]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"zustand-querystring": "^0.0.19"
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.1.3",
"@playwright/test": "^1.42.0",
"@types/dompurify": "^3.0.5",
"@types/node": "^20.11.23",
Expand Down
2 changes: 2 additions & 0 deletions src/app/(sidebar)/account/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use client";

import React from "react";

import { LayoutSidebarContent } from "@/components/layout/LayoutSidebarContent";
import { Routes } from "@/constants/routes";

Expand Down
2 changes: 1 addition & 1 deletion src/app/(sidebar)/explore-endpoints/[[...pages]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { useState } from "react";
import React, { useState } from "react";
import { usePathname } from "next/navigation";
import {
Alert,
Expand Down
1 change: 1 addition & 0 deletions src/app/(sidebar)/explore-endpoints/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import React from "react";
import { LayoutSidebarContent } from "@/components/layout/LayoutSidebarContent";
import { Routes } from "@/constants/routes";

Expand Down
1 change: 1 addition & 0 deletions src/app/(sidebar)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react";
import { LayoutWithSidebar } from "@/components/layout/LayoutWithSidebar";

export default function Layout({ children }: { children: React.ReactNode }) {
Expand Down
2 changes: 2 additions & 0 deletions src/app/(sidebar)/soroban/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use client";

import React from "react";

import { LayoutSidebarContent } from "@/components/layout/LayoutSidebarContent";

export default function TransactionTemplate({
Expand Down
2 changes: 2 additions & 0 deletions src/app/(sidebar)/transaction/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use client";

import React from "react";

import { LayoutSidebarContent } from "@/components/layout/LayoutSidebarContent";
import { Routes } from "@/constants/routes";

Expand Down
2 changes: 2 additions & 0 deletions src/app/(sidebar)/xdr/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use client";

import React from "react";

import { LayoutSidebarContent } from "@/components/layout/LayoutSidebarContent";
import { Routes } from "@/constants/routes";

Expand Down
1 change: 1 addition & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react";
import type { Metadata } from "next";

import { LayoutMain } from "@/components/layout/LayoutMain";
Expand Down
2 changes: 1 addition & 1 deletion src/components/ExpandBox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useLayoutEffect, useState } from "react";
import React, { useLayoutEffect, useState } from "react";
import "./styles.scss";

export const ExpandBox = ({
Expand Down
10 changes: 9 additions & 1 deletion src/components/FormElements/AssetPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from "react";
import React, { useState } from "react";
import { Input } from "@stellar/design-system";

import { ExpandBox } from "@/components/ExpandBox";
Expand All @@ -19,7 +19,9 @@ type AssetPickerProps = (
includeNone?: boolean;
includeNative?: undefined;
onChange: (
// eslint-disable-next-line no-unused-vars
optionId: AssetType | undefined,
// eslint-disable-next-line no-unused-vars
optionValue: string | undefined,
) => void;
}
Expand All @@ -29,7 +31,9 @@ type AssetPickerProps = (
includeNone?: undefined;
includeNative?: boolean;
onChange: (
// eslint-disable-next-line no-unused-vars
optionId: AssetType | undefined,
// eslint-disable-next-line no-unused-vars
optionValue: AssetObjectValue | undefined,
) => void;
}
Expand Down Expand Up @@ -274,13 +278,17 @@ type AssetPickerFieldsProps = {
code: {
value: string;
error: string;
// eslint-disable-next-line no-unused-vars
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
// eslint-disable-next-line no-unused-vars
onBlur: (e: React.ChangeEvent<HTMLInputElement>) => void;
};
issuer: {
value: string;
error: string;
// eslint-disable-next-line no-unused-vars
onChange: (value: string, issuerError: string) => void;
// eslint-disable-next-line no-unused-vars
onBlur: (value: string, issuerError: string) => void;
};
};
Expand Down
2 changes: 2 additions & 0 deletions src/components/FormElements/IncludeFailedPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from "react";
import { RadioPicker } from "@/components/RadioPicker";

type IncludeFailedPickerProps = {
id: string;
selectedOption: string | undefined;
// eslint-disable-next-line no-unused-vars
onChange: (optionId: string | undefined, optionValue?: boolean) => void;
labelSuffix?: string | React.ReactNode;
};
Expand Down
2 changes: 2 additions & 0 deletions src/components/FormElements/OrderPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from "react";
import { RadioPicker } from "@/components/RadioPicker";

type OrderPickerProps = {
id: string;
selectedOption: string | undefined;
// eslint-disable-next-line no-unused-vars
onChange: (optionId: string | undefined, optionValue?: string) => void;
labelSuffix?: string | React.ReactNode;
};
Expand Down
3 changes: 3 additions & 0 deletions src/components/FormElements/PubKeyPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react";
import { StrKey } from "stellar-sdk";
import { Input, InputProps } from "@stellar/design-system";

Expand All @@ -9,7 +10,9 @@ interface PubKeyPickerProps extends Omit<InputProps, "fieldSize"> {
placeholder?: string;
value: string;
error: string | "";
// eslint-disable-next-line no-unused-vars
onChange: (value: string, error: string) => void;
// eslint-disable-next-line no-unused-vars
onBlur: (value: string, error: string) => void;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/GenerateKeypair.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Icon, Input } from "@stellar/design-system";
import { Input } from "@stellar/design-system";

export const GenerateKeypair = ({
publicKey,
Expand Down
1 change: 1 addition & 0 deletions src/components/MaintenanceBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react";
import { Banner, Link } from "@stellar/design-system";

import { getRelevantMaintenanceMsg } from "@/helpers/getRelevantMaintenanceMsg";
Expand Down
2 changes: 1 addition & 1 deletion src/components/NetworkSelector/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import React, {
useCallback,
useEffect,
useLayoutEffect,
Expand Down
4 changes: 4 additions & 0 deletions src/components/RadioPicker/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import React from "react";

import { Label } from "@stellar/design-system";
import { AssetType } from "@/types/types";
import "./styles.scss";
Expand All @@ -8,7 +10,9 @@ interface RadioPickerProps<TOptionValue = string> {
label?: string | React.ReactNode;
labelSuffix?: string | React.ReactNode;
onChange: (
// eslint-disable-next-line no-unused-vars
optionId: AssetType | undefined,
// eslint-disable-next-line no-unused-vars
optionValue?: TOptionValue,
) => void;
options: {
Expand Down
2 changes: 2 additions & 0 deletions src/components/TabView/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react";
import { Card, Text } from "@stellar/design-system";
import { WithInfoText } from "@/components/WithInfoText";
import { Tabs } from "@/components/Tabs";
Expand All @@ -17,6 +18,7 @@ type TabViewProps = {
tab4?: Tab;
tab5?: Tab;
tab6?: Tab;
// eslint-disable-next-line no-unused-vars
onTabChange: (id: string) => void;
activeTabId: string;
staticTop?: React.ReactNode;
Expand Down
1 change: 1 addition & 0 deletions src/components/Tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const Tabs = ({
}: {
tabs: Tab[];
activeTabId: string;
// eslint-disable-next-line no-unused-vars
onChange: (id: string) => void;
}) => {
return (
Expand Down
1 change: 1 addition & 0 deletions src/components/WithInfoText/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react";
import { Icon, Tooltip } from "@stellar/design-system";
import { NextLink } from "@/components/NextLink";
import "./styles.scss";
Expand Down
2 changes: 2 additions & 0 deletions src/components/layout/LayoutContentContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import React from "react";

export const LayoutContentContainer = ({
children,
}: {
Expand Down
2 changes: 2 additions & 0 deletions src/constants/routes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-unused-vars */

export enum Routes {
ROOT = "/",
// Account
Expand Down
1 change: 1 addition & 0 deletions src/query/QueryProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import React from "react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";

Expand Down
2 changes: 2 additions & 0 deletions src/store/createStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import { EmptyObj, Network } from "@/types/types";
export interface Store {
// Shared
network: Network | EmptyObj;
// eslint-disable-next-line no-unused-vars
selectNetwork: (network: Network) => void;

// Account
account: {
publicKey: string;
// eslint-disable-next-line no-unused-vars
update: (value: string) => void;
reset: () => void;
};
Expand Down
2 changes: 2 additions & 0 deletions src/store/useStore.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
"use client";

import { useContext } from "react";
import { useStore as useZustandStore } from "zustand";
import { Store } from "@/store/createStore";
import { ZustandContext } from "@/store/StoreProvider";

// eslint-disable-next-line no-unused-vars
export const useStore = <T = Store>(selector?: (state: Store) => T) => {
selector ??= (state) => state as T;
const store = useContext(ZustandContext);
Expand Down
2 changes: 2 additions & 0 deletions src/types/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import React from "react";

// =============================================================================
// Generic
// =============================================================================
Expand Down
Loading
Loading