Skip to content

Commit

Permalink
fix: upgrade eslint-lingui, fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
IanKrieger committed Oct 21, 2024
1 parent 053be8b commit a8546a4
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 10 deletions.
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ export default tseslint.config(
"day",
"week",
"month",
"Content-Type",
"Accept-Language",
"& .MuiAvatar-root",
],
},
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"babel-plugin-macros": "3.1.0",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-lingui": "0.5.0",
"eslint-plugin-lingui": "0.6.0",
"eslint-plugin-react": "7.37.1",
"eslint-plugin-react-hooks": "5.0.0",
"husky": "9.1.6",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/components/Button/SubmitPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ function StatusMessage({
return errors[0];
}

const errorCount = errors.length;
return (
<Box>
<Link underline="hover" onClick={() => setShowErrors((state) => !state)}>
<Trans>
You have {errors.length} errors that must be fixed before submitting.
You have {errorCount} errors that must be fixed before submitting.
</Trans>
</Link>
{showErrors && (
Expand Down
3 changes: 2 additions & 1 deletion src/routes/campaigns/analytics/CampaignAnalytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ export function CampaignAnalytics({ campaignOverview }: CampaignOverviewProps) {
},
});

const campaignName = campaignOverview.name;
if (error) {
return (
<ErrorDetail
error={error}
additionalDetails={msg`Unable to load reporting details for campaign: ${campaignOverview.name}`}
additionalDetails={msg`Unable to load reporting details for campaign: ${campaignName}`}
/>
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/user/settings/UserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export function UserForm() {
setInitialVals(user.updateCurrentUser);
},
onError(err) {
setErrorMessage(<Trans>Failed to update profile: {err.message}</Trans>);
const errorMessage = err.message;
setErrorMessage(<Trans>Failed to update profile: {errorMessage}</Trans>);
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export function PaymentMethodField() {
return t`and you will be charged ${amountToCharge} USD.`;
};

const accountBalance = formatUsd(balance);
return (
<CardContainer header={<Trans>Payment</Trans>}>
<Stack spacing={1}>
Expand All @@ -59,7 +60,7 @@ export function PaymentMethodField() {
<Trans>Account Balance will be applied to this campaign</Trans>
</AlertTitle>
<Trans>
Your account has a balance of {formatUsd(balance)} USD. This will be
Your account has a balance of {accountBalance} USD. This will be
applied to your campaign
</Trans>
{", "}
Expand Down

0 comments on commit a8546a4

Please sign in to comment.