feat(SW-706): make eslint rule 'formatjs/no-literal-string-in-jsx' pass

This commit is contained in:
Michael Zetterberg
2025-02-07 06:51:36 +01:00
parent e22fc1f3c8
commit 440e1f92df
393 changed files with 4839 additions and 1554 deletions

View File

@@ -22,7 +22,9 @@ export default async function Total({ booking, currency }: TotalProps) {
totalPriceInMoney > 0 ? `${totalPriceInMoney} ${currency}` : ""
const pointsString =
totalPriceInPoints > 0
? `${totalPriceInPoints} ${intl.formatMessage({ id: "Points" })}`
? `${totalPriceInPoints} ${intl.formatMessage({
defaultMessage: "Points",
})}`
: ""
const plusString = moneyString && pointsString ? " + " : ""
@@ -33,11 +35,14 @@ export default async function Total({ booking, currency }: TotalProps) {
<Typography>
<div>
<span className={styles.title}>
{intl.formatMessage({ id: "Preliminary receipt" })}
{intl.formatMessage({
defaultMessage: "Preliminary receipt",
})}
</span>
<span className={styles.titleSubtext}>
{intl.formatMessage({
id: "Final VAT breakdown will be provided at check-out.",
defaultMessage:
"Final VAT breakdown will be provided at check-out.",
})}
</span>
</div>
@@ -46,9 +51,14 @@ export default async function Total({ booking, currency }: TotalProps) {
<Divider color="subtle" />
<dl className={styles.dl}>
<Typography>
<dt>{intl.formatMessage({ id: "Total including VAT" })}</dt>
<dt>
{intl.formatMessage({
defaultMessage: "Total including VAT",
})}
</dt>
</Typography>
<Typography>
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
<dd>{`${moneyString}${plusString}${pointsString}`}</dd>
</Typography>
@@ -56,13 +66,16 @@ export default async function Total({ booking, currency }: TotalProps) {
<>
<Typography>
<dt className={styles.tertiary}>
{intl.formatMessage({ id: "Total excluding VAT" })}
{intl.formatMessage({
defaultMessage: "Total excluding VAT",
})}
</dt>
</Typography>
<Typography>
<dd
className={styles.tertiary}
>{`${totalPriceInMoneyExclVat} ${currency}`}</dd>
<dd className={styles.tertiary}>
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
{`${totalPriceInMoneyExclVat} ${currency}`}
</dd>
</Typography>
</>
)}
@@ -71,11 +84,16 @@ export default async function Total({ booking, currency }: TotalProps) {
<>
<Typography>
<dt className={styles.tertiary}>
{intl.formatMessage({ id: "VAT" })}
{intl.formatMessage({
defaultMessage: "VAT",
})}
</dt>
</Typography>
<Typography>
<dd className={styles.tertiary}>{`${totalVat} ${currency}`}</dd>
<dd className={styles.tertiary}>
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
{`${totalVat} ${currency}`}
</dd>
</Typography>
</>
)}