Skip to content

Commit

Permalink
chore(prettier) fix after v3 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
ansmonjol committed Nov 24, 2023
1 parent 017cc4a commit 97da502
Show file tree
Hide file tree
Showing 210 changed files with 1,044 additions and 1,015 deletions.
4 changes: 2 additions & 2 deletions scripts/InspectTranslationKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async function extract() {
31 +
'm' +
`\n----- Keys used but not defined ----- ${keysNotInDitto.length}` +
'\u001b[0m'
'\u001b[0m',
)
console.info(keysNotInDitto.join('\n'))
}
Expand All @@ -67,7 +67,7 @@ async function extract() {
31 +
'm' +
`\n----- Keys defined but not used ----- ${dittoKeysNotUsed.length}` +
'\u001b[0m'
'\u001b[0m',
)
console.info(dittoKeysNotUsed.join('\n'))
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/MergeTranslationFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async function extract(locale) {

fs.writeFileSync(
path.join(DITTO_DIR, `/${fileLocaleKey}.json`),
`${JSON.stringify(allKeys, null, 2)}\n`
`${JSON.stringify(allKeys, null, 2)}\n`,
)
}

Expand Down
10 changes: 8 additions & 2 deletions src/components/CodeSnippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const CodeSnippet = memo(
)}
</Content>
)
}
},
)

CodeSnippet.displayName = 'CodeSnippet'
Expand Down Expand Up @@ -183,7 +183,13 @@ const Content = styled.div`
pre[class*='language-'] {
color: #19212e;
background: none;
font-family: IBM Plex Mono, Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
font-family:
IBM Plex Mono,
Consolas,
Monaco,
'Andale Mono',
'Ubuntu Mono',
monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
Expand Down
2 changes: 1 addition & 1 deletion src/components/DebugInfoDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const DebugInfoDialog = forwardRef<DialogRef>(({}, ref) => {
(!!currentUser?.id
? `
**User Id :** ${currentUser?.id}`
: '')
: ''),
)

addToast({
Expand Down
2 changes: 1 addition & 1 deletion src/components/PremiumWarningDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const PremiumWarningDialog = forwardRef<DialogRef>(({}, ref) => {
</Button>
<LinkTo
href={`mailto:[email protected]?subject=${translate(
'text_63b3f676d44671bf24d81411'
'text_63b3f676d44671bf24d81411',
)}&body=${translate('text_63b3f676d44671bf24d81413')}`}
>
<FullWidthButton>{translate('text_63b3155768489ee342482f55')}</FullWidthButton>
Expand Down
2 changes: 1 addition & 1 deletion src/components/RouteWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const PageWrapper = ({ children, routeConfig }: PageWrapperProps) => {

export const routesFormatter: (
routesToFormat: CustomRouteObject[],
loggedIn: boolean
loggedIn: boolean,
) => RouteObject[] = (routesToFormat, loggedIn) => {
return routesToFormat.reduce<RouteObject[]>((acc, route) => {
const routeConfig = {
Expand Down
6 changes: 3 additions & 3 deletions src/components/TimezoneDate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ export const TimezoneDate = ({
mainTimezone === MainTimezoneEnum.organization
? timezone
: mainTimezone === MainTimezoneEnum.customer
? customerTimezone
: TimezoneEnum.TzUtc,
mainDateFormat
? customerTimezone
: TimezoneEnum.TzUtc,
mainDateFormat,
)}
</Date>
</StyledTooltip>
Expand Down
4 changes: 2 additions & 2 deletions src/components/WarningDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const WarningDialog = forwardRef<DialogRef, WarningDialogProps>(
forceOpen = false,
...props
}: WarningDialogProps,
ref
ref,
) => {
const { translate } = useInternationalization()

Expand Down Expand Up @@ -55,7 +55,7 @@ export const WarningDialog = forwardRef<DialogRef, WarningDialogProps>(
data-test="warning-dialog"
/>
)
}
},
)

WarningDialog.displayName = 'WarningDialog'
4 changes: 2 additions & 2 deletions src/components/__tests__/WarningDialog.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ async function prepare() {
description="description"
continueText="continueText"
onContinue={onContinueMock}
/>
)
/>,
),
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/addOns/AddOnItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const AddOnItem = ({ addOn, deleteDialogRef, navigationProps }: AddOnItem
{
currencyDisplay: 'symbol',
currency: amountCurrency,
}
},
),
})}
</Typography>
Expand Down
32 changes: 16 additions & 16 deletions src/components/billableMetrics/BillableMetricCodeSnippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ const getSnippets = (billableMetric?: CreateBillableMetricInput) => {
"timestamp": $(date +%s),
"properties": {
"${fieldName}": 12${
groupDimension > 0
? `,
groupDimension > 0
? `,
${propertiesForGroup}`
: ''
}
: ''
}
}
}
}'
Expand Down Expand Up @@ -104,11 +104,11 @@ ${groupDimensionMessage}
"timestamp": $(date +%s),
"properties": {
"${fieldName}": "data"${
groupDimension > 0
? `,
groupDimension > 0
? `,
${propertiesForGroup}`
: ''
}
: ''
}
}
}
}'
Expand All @@ -130,11 +130,11 @@ ${groupDimensionMessage}
"timestamp": $(date +%s),
"properties": {
"${fieldName}": 12${
groupDimension > 0
? `,
groupDimension > 0
? `,
${propertiesForGroup}`
: ''
}
: ''
}
}
}
}'
Expand All @@ -156,11 +156,11 @@ ${groupDimensionMessage}
"timestamp": $(date +%s),
"properties": {
"${fieldName}": 12${
groupDimension > 0
? `,
groupDimension > 0
? `,
${propertiesForGroup}`
: ''
}
: ''
}
}
}
}'
Expand Down
2 changes: 1 addition & 1 deletion src/components/billableMetrics/BillableMetricItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const BillableMetricItem = memo(
</Popper>
</ItemContainer>
)
}
},
)

export const BillableMetricItemSkeleton = () => {
Expand Down
12 changes: 6 additions & 6 deletions src/components/billableMetrics/DeleteBillableMetricDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const DeleteBillableMetricDialog = forwardRef<DeleteBillableMetricDialogR
const dialogRef = useRef<DialogRef>(null)
const { translate } = useInternationalization()
const [billableMetric, setBillableMetric] = useState<BillableMetricItemFragment | undefined>(
undefined
undefined,
)

const {
Expand Down Expand Up @@ -86,12 +86,12 @@ export const DeleteBillableMetricDialog = forwardRef<DeleteBillableMetricDialogR
usedObject1: translate(
'text_63c842ee2cd5dfeb173c2726',
{ count: activeSubscriptionsCount },
activeSubscriptionsCount
activeSubscriptionsCount,
),
usedObject2: translate(
'text_63c8431193e8aca80f14cced',
{ count: draftInvoicesCount },
draftInvoicesCount
draftInvoicesCount,
),
}
: {
Expand All @@ -100,15 +100,15 @@ export const DeleteBillableMetricDialog = forwardRef<DeleteBillableMetricDialogR
? translate(
'text_63c842ee2cd5dfeb173c2726',
{ count: activeSubscriptionsCount },
activeSubscriptionsCount
activeSubscriptionsCount,
)
: translate(
'text_63c8431193e8aca80f14cced',
{ count: draftInvoicesCount },
draftInvoicesCount
draftInvoicesCount,
),
},
draftInvoicesCount > 0 && activeSubscriptionsCount > 0 ? 2 : 0
draftInvoicesCount > 0 && activeSubscriptionsCount > 0 ? 2 : 0,
)
) : (
<Typography html={translate('text_6256f824b6368e01153caa49')} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const EditBillableMetricGroupDialog = forwardRef<EditBillableMetricGroupD
continueText={translate('text_64f2044bd3655501184fe147')}
/>
)
}
},
)

EditBillableMetricGroupDialog.displayName = 'EditBillableMetricGroupDialog'
2 changes: 1 addition & 1 deletion src/components/coupons/AddPlanToCouponDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const AddPlanToCouponDialog = forwardRef<DialogRef, AddPlanToCouponDialog
/>
</Dialog>
)
}
},
)

AddPlanToCouponDialog.displayName = 'AddPlanToCouponDialog'
Expand Down
16 changes: 8 additions & 8 deletions src/components/coupons/CouponCaption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ export const CouponCaption = memo(({ coupon, variant = 'caption' }: CouponCaptio
amount: intlFormatNumber(
deserializeAmount(
Number(amountCentsRemaining) || Number(amountCents),
amountCurrency || CurrencyEnum.Usd
amountCurrency || CurrencyEnum.Usd,
) || 0,
{
currencyDisplay: 'symbol',
currency: amountCurrency || undefined,
}
},
),
}
},
)
} else if (couponType === CouponTypeEnum.Percentage && frequency === CouponFrequency.Once) {
return translate('text_632d68358f1fedc68eed3eb5', {
Expand All @@ -94,16 +94,16 @@ export const CouponCaption = memo(({ coupon, variant = 'caption' }: CouponCaptio
amount: intlFormatNumber(
deserializeAmount(
Number(amountCentsRemaining) || Number(amountCents),
amountCurrency || CurrencyEnum.Usd
amountCurrency || CurrencyEnum.Usd,
) || 0,
{
currencyDisplay: 'symbol',
currency: amountCurrency || undefined,
}
},
),
duration: frequencyDurationRemaining || frequencyDuration,
},
frequencyDurationRemaining || frequencyDuration || 1
frequencyDurationRemaining || frequencyDuration || 1,
)
} else if (
couponType === CouponTypeEnum.Percentage &&
Expand All @@ -118,7 +118,7 @@ export const CouponCaption = memo(({ coupon, variant = 'caption' }: CouponCaptio
}),
duration: frequencyDurationRemaining || frequencyDuration,
},
frequencyDurationRemaining || frequencyDuration || 1
frequencyDurationRemaining || frequencyDuration || 1,
)
} else if (couponType === CouponTypeEnum.FixedAmount && frequency === CouponFrequency.Forever) {
return translate('text_63c946e8bef768ead2fee35c', {
Expand All @@ -127,7 +127,7 @@ export const CouponCaption = memo(({ coupon, variant = 'caption' }: CouponCaptio
{
currencyDisplay: 'symbol',
currency: amountCurrency || undefined,
}
},
),
})
} else if (couponType === CouponTypeEnum.Percentage && frequency === CouponFrequency.Forever) {
Expand Down
24 changes: 12 additions & 12 deletions src/components/coupons/CouponCodeSnippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const getSnippets = (
hasBillableMetricLimit: boolean,
limitPlansList?: PlansForCouponsFragment[],
limitBillableMetricsList?: BillableMetricsForCouponsFragment[],
coupon?: CreateCouponInput
coupon?: CreateCouponInput,
) => {
if (!coupon || !coupon.code) return '# Fill the form to generate the code snippet'
const {
Expand Down Expand Up @@ -61,20 +61,20 @@ curl --location --request POST "${apiUrl}/api/v1/applied_coupons" \\
"expiration_date": "${expirationAt ? expirationAt : '__MUST_BE_DEFINED__'}",`
: `"expiration": "${expiration}",`
}${
!!hasPlanLimit && !!limitPlansList?.length
? `
!!hasPlanLimit && !!limitPlansList?.length
? `
"applies_to": { "plan_codes": [${limitPlansList.map(
(p: PlansForCouponsFragment) => `"${p.code}"`
(p: PlansForCouponsFragment) => `"${p.code}"`,
)}] },`
: ''
}${
!!hasBillableMetricLimit && !!limitBillableMetricsList?.length
? `
: ''
}${
!!hasBillableMetricLimit && !!limitBillableMetricsList?.length
? `
"applies_to": { "billable_metrics_codes": [${limitBillableMetricsList.map(
(b: BillableMetricsForCouponsFragment) => `"${b.code}"`
(b: BillableMetricsForCouponsFragment) => `"${b.code}"`,
)}] },`
: ''
}
: ''
}
}
}'
Expand Down Expand Up @@ -107,7 +107,7 @@ export const CouponCodeSnippet = ({
hasBillableMetricLimit,
limitPlansList,
limitBillableMetricsList,
coupon
coupon,
)}
/>
)
Expand Down
Loading

0 comments on commit 97da502

Please sign in to comment.