Skip to content

Commit

Permalink
fix misused-promise weirdness with eslint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
nramkissoon committed Mar 9, 2023
1 parent 62ccf96 commit 5121a63
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const config = {
plugins: ["@typescript-eslint"],
extends: ["next/core-web-vitals", "plugin:@typescript-eslint/recommended"],
rules: {
"@typescript-eslint/no-misused-promises": [2, {
"checksVoidReturn": {
"attributes": false
}
}],
"@typescript-eslint/consistent-type-imports": [
"warn",
{
Expand Down
28 changes: 12 additions & 16 deletions src/pages/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ const UpgradeButton = () => {
return (
<button
className="w-fit cursor-pointer rounded-md bg-blue-500 px-5 py-2 text-lg font-semibold text-white shadow-sm duration-150 hover:bg-blue-600"
onClick={() =>
void (async () => {
const { checkoutUrl } = await createCheckoutSession();
if (checkoutUrl) {
void push(checkoutUrl);
}
})
}
onClick={async () => {
const { checkoutUrl } = await createCheckoutSession();
if (checkoutUrl) {
void push(checkoutUrl);
}
}}
>
Upgrade account
</button>
Expand All @@ -47,14 +45,12 @@ const ManageBillingButton = () => {
return (
<button
className="w-fit cursor-pointer rounded-md bg-blue-500 px-5 py-2 text-lg font-semibold text-white shadow-sm duration-150 hover:bg-blue-600"
onClick={() =>
void (async () => {
const { billingPortalUrl } = await createBillingPortalSession();
if (billingPortalUrl) {
void push(billingPortalUrl);
}
})
}
onClick={async () => {
const { billingPortalUrl } = await createBillingPortalSession();
if (billingPortalUrl) {
void push(billingPortalUrl);
}
}}
>
Manage subscription and billing
</button>
Expand Down

0 comments on commit 5121a63

Please sign in to comment.