Skip to content

Commit dff783a

Browse files
arkjunclaude
andcommitted
fix: resolve lint errors from biome check
- Remove useless 'monthly' case clause in switch statement - Remove unused EXCHANGE_RATES_TO_KRW import in test file - Fix import order (CURRENCY_SYMBOLS before calculateMonthlyTotal) - Fix object formatting in test file Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 02720aa commit dff783a

File tree

3 files changed

+37
-9
lines changed

3 files changed

+37
-9
lines changed

apps/web/src/components/subscription/subscription-list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useAuth } from '@/components/auth/auth-provider';
88
import { Button } from '@/components/ui/button';
99
import { DataTable } from '@/components/ui/data-table';
1010
import { useRouter } from '@/i18n/navigation';
11-
import { calculateMonthlyTotal, CURRENCY_SYMBOLS } from '@/lib/currency';
11+
import { CURRENCY_SYMBOLS, calculateMonthlyTotal } from '@/lib/currency';
1212
import { getColumns } from './columns';
1313
import { SubscriptionCard } from './subscription-card';
1414
import { SubscriptionForm } from './subscription-form';

apps/web/src/lib/currency.test.ts

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { describe, expect, it } from 'vitest';
22
import {
33
calculateMonthlyTotal,
44
convertCurrency,
5-
EXCHANGE_RATES_TO_KRW,
65
formatPrice,
76
normalizeToMonthly,
87
type SubscriptionForCalculation,
@@ -86,7 +85,12 @@ describe('calculateMonthlyTotal', () => {
8685

8786
it('calculates total for single currency subscriptions', () => {
8887
const subscriptions: SubscriptionForCalculation[] = [
89-
{ price: 10000, currency: 'KRW', billingCycle: 'monthly', isActive: true },
88+
{
89+
price: 10000,
90+
currency: 'KRW',
91+
billingCycle: 'monthly',
92+
isActive: true,
93+
},
9094
{ price: 5000, currency: 'KRW', billingCycle: 'monthly', isActive: true },
9195
];
9296
const result = calculateMonthlyTotal(subscriptions, 'KRW');
@@ -96,7 +100,12 @@ describe('calculateMonthlyTotal', () => {
96100

97101
it('excludes inactive subscriptions', () => {
98102
const subscriptions: SubscriptionForCalculation[] = [
99-
{ price: 10000, currency: 'KRW', billingCycle: 'monthly', isActive: true },
103+
{
104+
price: 10000,
105+
currency: 'KRW',
106+
billingCycle: 'monthly',
107+
isActive: true,
108+
},
100109
{
101110
price: 5000,
102111
currency: 'KRW',
@@ -110,7 +119,12 @@ describe('calculateMonthlyTotal', () => {
110119

111120
it('detects mixed currencies', () => {
112121
const subscriptions: SubscriptionForCalculation[] = [
113-
{ price: 10000, currency: 'KRW', billingCycle: 'monthly', isActive: true },
122+
{
123+
price: 10000,
124+
currency: 'KRW',
125+
billingCycle: 'monthly',
126+
isActive: true,
127+
},
114128
{ price: 10, currency: 'USD', billingCycle: 'monthly', isActive: true },
115129
];
116130
const result = calculateMonthlyTotal(subscriptions, 'KRW');
@@ -119,7 +133,12 @@ describe('calculateMonthlyTotal', () => {
119133

120134
it('converts and sums mixed currency subscriptions to KRW', () => {
121135
const subscriptions: SubscriptionForCalculation[] = [
122-
{ price: 10000, currency: 'KRW', billingCycle: 'monthly', isActive: true },
136+
{
137+
price: 10000,
138+
currency: 'KRW',
139+
billingCycle: 'monthly',
140+
isActive: true,
141+
},
123142
{ price: 10, currency: 'USD', billingCycle: 'monthly', isActive: true },
124143
];
125144
// ₩10,000 + $10 (= ₩14,000) = ₩24,000
@@ -129,7 +148,12 @@ describe('calculateMonthlyTotal', () => {
129148

130149
it('converts and sums mixed currency subscriptions to USD', () => {
131150
const subscriptions: SubscriptionForCalculation[] = [
132-
{ price: 14000, currency: 'KRW', billingCycle: 'monthly', isActive: true },
151+
{
152+
price: 14000,
153+
currency: 'KRW',
154+
billingCycle: 'monthly',
155+
isActive: true,
156+
},
133157
{ price: 10, currency: 'USD', billingCycle: 'monthly', isActive: true },
134158
];
135159
// ₩14,000 (= $10) + $10 = $20
@@ -148,7 +172,12 @@ describe('calculateMonthlyTotal', () => {
148172

149173
it('handles complex scenario with mixed currencies and billing cycles', () => {
150174
const subscriptions: SubscriptionForCalculation[] = [
151-
{ price: 10000, currency: 'KRW', billingCycle: 'monthly', isActive: true },
175+
{
176+
price: 10000,
177+
currency: 'KRW',
178+
billingCycle: 'monthly',
179+
isActive: true,
180+
},
152181
{ price: 120, currency: 'USD', billingCycle: 'yearly', isActive: true },
153182
{ price: 30, currency: 'EUR', billingCycle: 'quarterly', isActive: true },
154183
{ price: 500, currency: 'JPY', billingCycle: 'weekly', isActive: false },

apps/web/src/lib/currency.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export function normalizeToMonthly(price: number, cycle: BillingCycle): number {
3838
return price * 4;
3939
case 'quarterly':
4040
return price / 3;
41-
case 'monthly':
4241
default:
4342
return price;
4443
}

0 commit comments

Comments
 (0)