Skip to content

Commit 3c51db2

Browse files
committed
fix lint
1 parent 1efacbd commit 3c51db2

File tree

12 files changed

+24
-23
lines changed

12 files changed

+24
-23
lines changed

examples/stripe-app/src/lib/render/catalog/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ export const actionHandlers: Record<
10041004
}
10051005
},
10061006

1007-
detachPaymentMethod: async (params, setData) => {
1007+
detachPaymentMethod: async (params, _setData) => {
10081008
try {
10091009
if (!params?.paymentMethodId) return;
10101010
await stripe.paymentMethods.detach(params.paymentMethodId as string);

examples/stripe-app/src/lib/render/catalog/components.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Maps json-render catalog components to Stripe UI Extension SDK components.
55
*/
6-
import type { FunctionComponent, ReactNode } from "react";
6+
import type { FunctionComponent } from "react";
77
import type { ComponentRenderProps } from "@json-render/react";
88
import {
99
Box,
@@ -50,7 +50,7 @@ import {
5050
} from "@stripe/ui-extension-sdk/ui";
5151

5252
// Helper to format currency
53-
const formatCurrency = (amount: number, currency: string = "usd"): string => {
53+
const formatCurrency = (amount: number, currency = "usd"): string => {
5454
return new Intl.NumberFormat("en-US", {
5555
style: "currency",
5656
currency: currency.toUpperCase(),
@@ -500,7 +500,7 @@ export const TextField: FunctionComponent<ExtendedRenderProps> = ({
500500
size={size as "small" | "medium" | "large"}
501501
disabled={Boolean(disabled) || undefined}
502502
required={Boolean(required) || undefined}
503-
onChange={() => {}}
503+
onChange={() => undefined}
504504
/>
505505
);
506506
};
@@ -532,7 +532,7 @@ export const TextArea: FunctionComponent<ExtendedRenderProps> = ({
532532
rows={Number(rows)}
533533
disabled={Boolean(disabled) || undefined}
534534
required={Boolean(required) || undefined}
535-
onChange={() => {}}
535+
onChange={() => undefined}
536536
/>
537537
);
538538
};
@@ -564,7 +564,7 @@ export const Select: FunctionComponent<ExtendedRenderProps> = ({
564564
size={size as "small" | "medium" | "large"}
565565
disabled={Boolean(disabled) || undefined}
566566
required={Boolean(required) || undefined}
567-
onChange={() => {}}
567+
onChange={() => undefined}
568568
>
569569
{opts.map((opt: { value: string; label: string }) => (
570570
<option key={opt.value} value={opt.value}>
@@ -593,7 +593,7 @@ export const Checkbox: FunctionComponent<ExtendedRenderProps> = ({
593593
error={error ? String(error) : undefined}
594594
checked={checked || undefined}
595595
disabled={Boolean(disabled) || undefined}
596-
onChange={() => {}}
596+
onChange={() => undefined}
597597
/>
598598
);
599599
};
@@ -615,7 +615,7 @@ export const Radio: FunctionComponent<ExtendedRenderProps> = ({
615615
name={String(name || "")}
616616
checked={currentValue === value}
617617
disabled={Boolean(disabled) || undefined}
618-
onChange={() => {}}
618+
onChange={() => undefined}
619619
/>
620620
);
621621
};
@@ -637,7 +637,7 @@ export const Switch: FunctionComponent<ExtendedRenderProps> = ({
637637
description={description ? String(description) : undefined}
638638
checked={checked || undefined}
639639
disabled={Boolean(disabled) || undefined}
640-
onChange={() => {}}
640+
onChange={() => undefined}
641641
/>
642642
);
643643
};
@@ -665,7 +665,7 @@ export const DateField: FunctionComponent<ExtendedRenderProps> = ({
665665
value={value || ""}
666666
size={size as "small" | "medium" | "large"}
667667
disabled={Boolean(disabled) || undefined}
668-
onChange={() => {}}
668+
onChange={() => undefined}
669669
/>
670670
);
671671
};

examples/stripe-app/src/lib/stripe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const stripe = new Stripe(STRIPE_API_KEY, {
1818
/**
1919
* Format amount for display (converts cents to dollars)
2020
*/
21-
export function formatAmount(amount: number, currency: string = "usd"): string {
21+
export function formatAmount(amount: number, currency = "usd"): string {
2222
return new Intl.NumberFormat("en-US", {
2323
style: "currency",
2424
currency: currency.toUpperCase(),

examples/stripe-app/src/views/CustomerDetails.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import CustomerDetails from "./CustomerDetails";
55

66
describe("CustomerDetailsView", () => {
77
it("renders ContextView", () => {
8-
const { wrapper } = render(<App {...getMockContextProps()} />);
8+
const { wrapper } = render(<CustomerDetails {...getMockContextProps()} />);
99

1010
expect(wrapper.find(ContextView)).toContainText("save to reload this view");
1111
});

examples/stripe-app/src/views/Customers.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Customers from "./Customers";
55

66
describe("CustomersView", () => {
77
it("renders ContextView", () => {
8-
const { wrapper } = render(<App {...getMockContextProps()} />);
8+
const { wrapper } = render(<Customers {...getMockContextProps()} />);
99

1010
expect(wrapper.find(ContextView)).toContainText("save to reload this view");
1111
});

examples/stripe-app/src/views/Customers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function createCustomersListSpec(data: Record<string, unknown>): Spec {
150150
// Component
151151
// =============================================================================
152152

153-
const Customers = ({ userContext, environment }: ExtensionContextValue) => {
153+
const Customers = (_props: ExtensionContextValue) => {
154154
const [data, setData] = useState<Record<string, unknown>>({});
155155
const [spec, setSpec] = useState<Spec | null>(null);
156156
const [loading, setLoading] = useState(true);

examples/stripe-app/src/views/Home.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { render, getMockContextProps } from "@stripe/ui-extension-sdk/testing";
22
import { ContextView } from "@stripe/ui-extension-sdk/ui";
33

4-
import Hone from "./Home";
4+
import Home from "./Home";
55

66
describe("DashboardHomepageView", () => {
77
it("renders ContextView", () => {
8-
const { wrapper } = render(<App {...getMockContextProps()} />);
8+
const { wrapper } = render(<Home {...getMockContextProps()} />);
99

1010
expect(wrapper.find(ContextView)).toContainText("save to reload this view");
1111
});

examples/stripe-app/src/views/Home.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ const actionsCatalogInfo = Object.entries(stripeCatalog.data.actions).map(
547547
// Home Component
548548
// =============================================================================
549549

550-
const Home = ({ userContext }: ExtensionContextValue) => {
550+
const Home = (_props: ExtensionContextValue) => {
551551
const [prompt, setPrompt] = useState("");
552552
const [isGenerating, setIsGenerating] = useState(false);
553553
const [isLoading, setIsLoading] = useState(true);
@@ -729,8 +729,9 @@ const Home = ({ userContext }: ExtensionContextValue) => {
729729

730730
<Divider />
731731
<Box css={{ font: "caption", color: "secondary" }}>
732-
Try: "Show revenue metrics" • "Show recent payments" • "Show
733-
subscriptions" • "Show customers" • "Show invoices"
732+
Try: &quot;Show revenue metrics&quot; &bull; &quot;Show recent
733+
payments&quot; &bull; &quot;Show subscriptions&quot; &bull;
734+
&quot;Show customers&quot; &bull; &quot;Show invoices&quot;
734735
</Box>
735736
</Box>
736737
</TabPanel>

examples/stripe-app/src/views/Invoices.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ function createInvoicesSpec(data: Record<string, unknown>): Spec {
209209
// Component
210210
// =============================================================================
211211

212-
const Invoices = ({ userContext, environment }: ExtensionContextValue) => {
212+
const Invoices = (_props: ExtensionContextValue) => {
213213
const [data, setData] = useState<Record<string, unknown>>({});
214214
const [spec, setSpec] = useState<Spec | null>(null);
215215
const [loading, setLoading] = useState(true);

examples/stripe-app/src/views/Payments.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function createPaymentsSpec(data: Record<string, unknown>): Spec {
171171
// Component
172172
// =============================================================================
173173

174-
const Payments = ({ userContext, environment }: ExtensionContextValue) => {
174+
const Payments = (_props: ExtensionContextValue) => {
175175
const [data, setData] = useState<Record<string, unknown>>({});
176176
const [spec, setSpec] = useState<Spec | null>(null);
177177
const [loading, setLoading] = useState(true);

0 commit comments

Comments
 (0)