Skip to content

Commit 050a1e7

Browse files
chore: update biome config + fix all lint issues in docs (#36)
* chore: update biome configuration and fix some linter issues - Updated biome.jsonc to include new formatter options and VCS settings. - Refactored package.json dependencies and scripts for better organization. - Enhanced various components with improved imports and formatting for consistency. - Cleaned up code in multiple files, ensuring adherence to coding standards and best practices. * chore: update formatting and linting across multiple files - Added tab indentation and adjusted indent width in biome.jsonc. - Refactored various components for consistent formatting and improved readability. - Ensured adherence to coding standards by fixing linting issues in multiple files. - Enhanced imports and component structures for better organization. * chore: simplify biome configuration and update formatting - Removed extensive linter rules and settings from biome.jsonc for a cleaner configuration. - Updated formatter options to use tab indentation and adjusted indent width. - Streamlined the structure of the configuration for better readability and maintainability. * chore: remove trailing newline in biome.jsonc for cleaner formatting * chore: add missing newline at end of file in biome.jsonc for consistency * refactor: improve component structure and formatting across multiple files - Refactored the Squares component to enhance the drawing logic and improve readability. - Introduced a new FeatureRow component for better organization in the comparison section. - Simplified the TestimonialCard component by extracting CardContent for clarity. - Added utility functions for cost formatting and provider cost calculation in the pricing page. - Updated the Carousel and Pagination components to remove unnecessary roles for better accessibility. - Cleaned up the SidebarProvider logic for improved state management and readability. * feat: add remote image pattern for badges in Next.js config - Introduced a new remote pattern for images to allow loading badges from startupfa.me. - This enhancement improves the flexibility of image handling in the application. * refactor: remove unused remote image pattern and clean up imports - Removed the remote image pattern for badges from the Next.js configuration as it is no longer needed. - Cleaned up the imports in the hero component by removing the unused Image import. * refactor: remove unused logger import from index.ts * refactor: update biome lint ignore comments for clarity - Changed biome lint ignore comments to specify 'tailwind css directive' for better understanding and maintainability. - Ensured consistency in commenting style across the global CSS file.
1 parent 0065882 commit 050a1e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+682
-531
lines changed

apps/dashboard/components/ui/slider.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

33
import { Slider as SliderPrimitive } from 'radix-ui';
4-
import * as React from 'react';
4+
import { useMemo } from 'react';
55

66
import { cn } from '@/lib/utils';
77

@@ -13,15 +13,15 @@ function Slider({
1313
max = 100,
1414
...props
1515
}: React.ComponentProps<typeof SliderPrimitive.Root>) {
16-
const _values = React.useMemo(
17-
() =>
18-
Array.isArray(value)
19-
? value
20-
: Array.isArray(defaultValue)
21-
? defaultValue
22-
: [min, max],
23-
[value, defaultValue, min, max]
24-
);
16+
const _values = useMemo(() => {
17+
if (Array.isArray(value)) {
18+
return value;
19+
}
20+
if (Array.isArray(defaultValue)) {
21+
return defaultValue;
22+
}
23+
return [min, max];
24+
}, [value, defaultValue, min, max]);
2525

2626
return (
2727
<SliderPrimitive.Root
@@ -49,11 +49,11 @@ function Slider({
4949
data-slot="slider-range"
5050
/>
5151
</SliderPrimitive.Track>
52-
{Array.from({ length: _values.length }, (_, index) => (
52+
{_values.map((value, index) => (
5353
<SliderPrimitive.Thumb
5454
className="block size-4 shrink-0 rounded-full border border-primary bg-background shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50"
5555
data-slot="slider-thumb"
56-
key={index}
56+
key={`slider-thumb-${index}-${value}`}
5757
/>
5858
))}
5959
</SliderPrimitive.Root>

apps/database/components/ui/slider.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ function Slider({
1313
max = 100,
1414
...props
1515
}: React.ComponentProps<typeof SliderPrimitive.Root>) {
16-
const _values = React.useMemo(
17-
() =>
18-
Array.isArray(value)
19-
? value
20-
: Array.isArray(defaultValue)
21-
? defaultValue
22-
: [min, max],
23-
[value, defaultValue, min, max]
24-
);
16+
const _values = React.useMemo(() => {
17+
if (Array.isArray(value)) {
18+
return value;
19+
}
20+
if (Array.isArray(defaultValue)) {
21+
return defaultValue;
22+
}
23+
return [min, max];
24+
}, [value, defaultValue, min, max]);
2525

2626
return (
2727
<SliderPrimitive.Root

apps/docs/app/(home)/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function HomePage() {
3535
<div className="min-h-screen">
3636
<Hero />
3737

38-
<Features stars={null} />
38+
<Features />
3939

4040
<Comparison />
4141

apps/docs/app/blog/[[...slug]]/page.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ export default async function BlogPage(props: {
1717
}) {
1818
const params = await props.params;
1919
const page = blogSource.getPage(params.slug);
20-
if (!page) notFound();
20+
if (!page) {
21+
notFound();
22+
}
2123

2224
const MDXContent = page.data.body;
2325
const publishedDate = new Date(page.data.publishedAt);
@@ -272,7 +274,7 @@ export default async function BlogPage(props: {
272274
);
273275
}
274276

275-
export async function generateStaticParams() {
277+
export function generateStaticParams() {
276278
return blogSource.generateParams();
277279
}
278280

@@ -281,7 +283,9 @@ export async function generateMetadata(props: {
281283
}) {
282284
const params = await props.params;
283285
const page = blogSource.getPage(params.slug);
284-
if (!page) notFound();
286+
if (!page) {
287+
notFound();
288+
}
285289

286290
const title = `${String(page.data.title || 'Databuddy Blog')} | Databuddy Blog`;
287291
const description = String(

apps/docs/app/docs/[[...slug]]/page.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export default async function Page(props: {
1515
}) {
1616
const params = await props.params;
1717
const page = source.getPage(params.slug);
18-
if (!page) notFound();
18+
if (!page) {
19+
notFound();
20+
}
1921

2022
const MDXContent = page.data.body;
2123
const url = `https://www.databuddy.cc${page.url}`;
@@ -30,7 +32,7 @@ export default async function Page(props: {
3032
let currentPath = '/docs';
3133
params.slug.forEach((segment, index) => {
3234
currentPath += `/${segment}`;
33-
if (index < params.slug!.length - 1) {
35+
if (index < (params.slug?.length ?? 0) - 1) {
3436
breadcrumbs.push({
3537
name: segment.charAt(0).toUpperCase() + segment.slice(1),
3638
url: currentPath,
@@ -67,7 +69,7 @@ export default async function Page(props: {
6769
);
6870
}
6971

70-
export async function generateStaticParams() {
72+
export function generateStaticParams() {
7173
return source.generateParams();
7274
}
7375

@@ -76,7 +78,9 @@ export async function generateMetadata(props: {
7678
}) {
7779
const params = await props.params;
7880
const page = source.getPage(params.slug);
79-
if (!page) notFound();
81+
if (!page) {
82+
notFound();
83+
}
8084

8185
const url = `https://www.databuddy.cc${page.url}`;
8286
const title = `${page.data.title} | Databuddy Documentation`;

apps/docs/app/global.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
@import "fumadocs-ui/css/preset.css";
44
@import "tw-animate-css";
55

6+
/* biome-ignore lint: tailwind css directive */
67
@custom-variant dark (&:is(.dark *));
78

89
* {
910
font-family: var(--font-geist);
1011
}
1112

13+
/* biome-ignore lint: tailwind css directive */
1214
@theme inline {
1315
--radius-sm: calc(var(--radius) - 4px);
1416
--radius-md: calc(var(--radius) - 2px);
@@ -139,13 +141,16 @@
139141

140142
@layer base {
141143
* {
144+
/* biome-ignore lint: tailwind css directive */
142145
@apply border-border outline-ring/50;
143146
}
144147
body {
148+
/* biome-ignore lint: tailwind css directive */
145149
@apply bg-background text-foreground;
146150
}
147151
}
148152

149153
#nd-home-layout {
154+
/* biome-ignore lint: false positive */
150155
padding-top: 0px !important;
151156
}

apps/docs/app/layout.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import './global.css';
2-
import { Databuddy } from '@databuddy/sdk';
32
import { RootProvider } from 'fumadocs-ui/provider';
43
import type { Metadata, Viewport } from 'next';
54
import { Geist } from 'next/font/google';

apps/docs/app/not-found.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import { ArrowLeft, Home, Link2Off } from 'lucide-react';
3+
import { ArrowLeft, Home } from 'lucide-react';
44
import { Geist } from 'next/font/google';
55
import Link from 'next/link';
66
import LiquidChrome from '@/components/bits/liquid';

apps/docs/app/terms/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import {
22
AlertTriangle,
3-
Clock,
43
CreditCard,
54
FileText,
65
HelpCircle,
76
Scale,
87
Shield,
9-
Users,
108
} from 'lucide-react';
119

1210
export const metadata = {

apps/docs/components/bits/liquid.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export const LiquidChrome: React.FC<LiquidChromeProps> = ({
2929
const containerRef = useRef<HTMLDivElement | null>(null);
3030

3131
useEffect(() => {
32-
if (!containerRef.current) return;
32+
if (!containerRef.current) {
33+
return;
34+
}
3335

3436
const container = containerRef.current;
3537
// Enable built-in antialiasing.

0 commit comments

Comments
 (0)