Skip to content

Commit 0f40688

Browse files
fix(dashboard): biome linting errors (novuhq#10269)
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Djabarov <djabarovgeorge@users.noreply.github.com>
1 parent 27692ce commit 0f40688

3 files changed

Lines changed: 17 additions & 10 deletions

File tree

apps/dashboard/src/utils/better-auth/components/sign-in.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState } from 'react';
1+
import { useId, useState } from 'react';
22
import { useNavigate } from 'react-router-dom';
33
import { Button } from '@/components/primitives/button';
44
import { Input } from '@/components/primitives/input';
@@ -8,6 +8,8 @@ import { authClient } from '../client';
88

99
export function SignIn() {
1010
const navigate = useNavigate();
11+
const emailId = useId();
12+
const passwordId = useId();
1113
const [email, setEmail] = useState('');
1214
const [password, setPassword] = useState('');
1315
const [error, setError] = useState<string | null>(null);
@@ -82,12 +84,12 @@ export function SignIn() {
8284
<h2 className="mb-6 text-center text-xl font-semibold">Sign In</h2>
8385
<form onSubmit={handleSubmit} className="space-y-6">
8486
<div>
85-
<label htmlFor="email" className="mb-1 block text-sm font-medium text-foreground-700">
87+
<label htmlFor={emailId} className="mb-1 block text-sm font-medium text-foreground-700">
8688
Email
8789
</label>
8890
<Input
8991
type="email"
90-
id="email"
92+
id={emailId}
9193
value={email}
9294
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setEmail(e.target.value)}
9395
placeholder="user@example.com"
@@ -97,7 +99,7 @@ export function SignIn() {
9799
</div>
98100
<div>
99101
<div className="mb-1 flex items-center justify-between">
100-
<label htmlFor="password" className="block text-sm font-medium text-foreground-700">
102+
<label htmlFor={passwordId} className="block text-sm font-medium text-foreground-700">
101103
Password
102104
</label>
103105
<span
@@ -114,7 +116,7 @@ export function SignIn() {
114116
</div>
115117
<Input
116118
type="password"
117-
id="password"
119+
id={passwordId}
118120
value={password}
119121
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setPassword(e.target.value)}
120122
placeholder="Password"

apps/dashboard/src/utils/better-auth/components/sso-sign-in.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useState } from 'react';
1+
import { useEffect, useId, useState } from 'react';
22
import { useNavigate, useSearchParams } from 'react-router-dom';
33
import { Button } from '@/components/primitives/button';
44
import { Input } from '@/components/primitives/input';
@@ -8,6 +8,7 @@ import { authClient } from '../client';
88
export function SSOSignIn() {
99
const navigate = useNavigate();
1010
const [searchParams] = useSearchParams();
11+
const ssoEmailId = useId();
1112
const [email, setEmail] = useState('');
1213
const [error, setError] = useState<string | null>(null);
1314
const [isLoading, setIsLoading] = useState(false);
@@ -62,12 +63,12 @@ export function SSOSignIn() {
6263
<h2 className="mb-6 text-center text-xl font-semibold">Sign In with SSO</h2>
6364
<form onSubmit={handleSubmit} className="space-y-6">
6465
<div>
65-
<label htmlFor="sso-email" className="mb-1 block text-sm font-medium text-foreground-700">
66+
<label htmlFor={ssoEmailId} className="mb-1 block text-sm font-medium text-foreground-700">
6667
Work Email
6768
</label>
6869
<Input
6970
type="email"
70-
id="sso-email"
71+
id={ssoEmailId}
7172
value={email}
7273
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setEmail(e.target.value)}
7374
placeholder="you@company.com"

apps/dashboard/src/utils/conditions.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ function recursiveGetUniqueFields(query: RuleGroupType): string[] {
8080
if ('rules' in rule) {
8181
// recursively get fields from nested rule groups
8282
const nestedFields = recursiveGetUniqueFields(rule);
83-
nestedFields.forEach((field) => fields.add(field));
83+
for (const field of nestedFields) {
84+
fields.add(field);
85+
}
8486
} else {
8587
// add field from individual rule
8688
const field = rule.field.split('.').shift();
@@ -109,7 +111,9 @@ function recursiveGetUniqueOperators(query: RuleGroupType): string[] {
109111
if ('rules' in rule) {
110112
// recursively get operators from nested rule groups
111113
const nestedOperators = recursiveGetUniqueOperators(rule);
112-
nestedOperators.forEach((operator) => operators.add(operator));
114+
for (const operator of nestedOperators) {
115+
operators.add(operator);
116+
}
113117
} else {
114118
// add operator from individual rule
115119
operators.add(rule.operator);

0 commit comments

Comments
 (0)