Skip to content

Commit 546ef1c

Browse files
committed
[migrate] replace ESLint with Biome to speed up Linting & Formatting
1 parent 24cf9d6 commit 546ef1c

File tree

46 files changed

+698
-2939
lines changed

Some content is hidden

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

46 files changed

+698
-2939
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm test

.husky/pre-push

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run build

app/globals.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@
4949

5050
:root {
5151
--font-geist-sans: "Geist Sans", ui-sans-serif, system-ui, sans-serif;
52-
--font-geist-mono: "Geist Mono", ui-monospace, "Cascadia Code",
53-
"Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
52+
--font-geist-mono:
53+
"Geist Mono", ui-monospace, "Cascadia Code", "Source Code Pro", Menlo,
54+
Consolas, "DejaVu Sans Mono", monospace;
5455
--radius: 0.625rem;
5556
--background: oklch(1 0 0);
5657
--foreground: oklch(0.145 0 0);

app/page.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { ComponentCard } from "@/components/example/component-card";
2-
import { BadgeBarExample } from "@/registry/new-york/blocks/badge-bar/example";
3-
import { PagerExample } from "@/registry/new-york/blocks/pager/example";
4-
import { ImagePreviewExample } from "@/registry/new-york/blocks/image-preview/example";
5-
import { FilePreviewExample } from "@/registry/new-york/blocks/file-preview/example";
6-
import { ScrollBoundaryExample } from "@/registry/new-york/blocks/scroll-boundary/example";
7-
import { ScrollListExample } from "@/registry/new-york/blocks/scroll-list/example";
82
import { ArrayFieldExample } from "@/registry/new-york/blocks/array-field/example";
3+
import { BadgeBarExample } from "@/registry/new-york/blocks/badge-bar/example";
94
import { BadgeInputExample } from "@/registry/new-york/blocks/badge-input/example";
10-
import { RangeInputExample } from "@/registry/new-york/blocks/range-input/example";
5+
import { EditorExample } from "@/registry/new-york/blocks/editor/example";
116
import { FilePickerExample } from "@/registry/new-york/blocks/file-picker/example";
7+
import { FilePreviewExample } from "@/registry/new-york/blocks/file-preview/example";
128
import { FormFieldExample } from "@/registry/new-york/blocks/form-field/example";
9+
import { ImagePreviewExample } from "@/registry/new-york/blocks/image-preview/example";
10+
import { PagerExample } from "@/registry/new-york/blocks/pager/example";
11+
import { RangeInputExample } from "@/registry/new-york/blocks/range-input/example";
1312
import { RestTableExample } from "@/registry/new-york/blocks/rest-table/example";
14-
import { EditorExample } from "@/registry/new-york/blocks/editor/example";
13+
import { ScrollBoundaryExample } from "@/registry/new-york/blocks/scroll-boundary/example";
14+
import { ScrollListExample } from "@/registry/new-york/blocks/scroll-list/example";
1515

1616
export default function Home() {
1717
return (

biome.json

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
3+
"linter": {
4+
"enabled": true,
5+
"rules": {
6+
"style": {
7+
"useSingleVarDeclarator": "off",
8+
"useImportType": "off",
9+
"noNonNullAssertion": "off",
10+
"useTemplate": "off",
11+
"noParameterAssign": "warn",
12+
"useNodejsImportProtocol": "off"
13+
},
14+
"a11y": {
15+
"useAltText": "warn",
16+
"noSvgWithoutTitle": "warn",
17+
"useKeyWithClickEvents": "off",
18+
"useSemanticElements": "warn",
19+
"noStaticElementInteractions": "warn"
20+
},
21+
"suspicious": {
22+
"noAssignInExpressions": "warn",
23+
"noExplicitAny": "off",
24+
"noArrayIndexKey": "off"
25+
},
26+
"correctness": {
27+
"noEmptyPattern": "off",
28+
"noUnusedFunctionParameters": "warn"
29+
},
30+
"complexity": {
31+
"noBannedTypes": "off",
32+
"noCommaOperator": "warn"
33+
},
34+
"performance": {
35+
"noDynamicNamespaceImportAccess": "warn"
36+
}
37+
}
38+
},
39+
"formatter": {
40+
"enabled": true,
41+
"formatWithErrors": true,
42+
"indentStyle": "space",
43+
"indentWidth": 2,
44+
"bracketSpacing": true,
45+
"bracketSameLine": false,
46+
"lineWidth": 80
47+
},
48+
"javascript": {
49+
"formatter": {
50+
"arrowParentheses": "always",
51+
"jsxQuoteStyle": "double",
52+
"quoteStyle": "double",
53+
"trailingCommas": "all",
54+
"semicolons": "always"
55+
}
56+
},
57+
"json": {
58+
"formatter": {
59+
"trailingCommas": "none"
60+
}
61+
},
62+
"css": {
63+
"parser": {
64+
"tailwindDirectives": true
65+
}
66+
},
67+
"assist": {
68+
"enabled": true,
69+
"actions": {
70+
"source": {
71+
"recommended": true
72+
}
73+
}
74+
},
75+
"files": {
76+
"includes": ["**", "!.next", "!dist", "!build"],
77+
"maxSize": 5242880
78+
}
79+
}

components.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
"hooks": "@/hooks"
1919
},
2020
"iconLibrary": "lucide"
21-
}
21+
}

components/example/form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ export const fields: Field<GitRepository>[] = columns.map(
5252
({ renderHead, renderBody, ...meta }) => ({
5353
...meta,
5454
renderLabel: renderHead,
55-
})
55+
}),
5656
);

components/example/open-in-v0-button.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ComponentProps, FC } from "react";
22

33
import { cn } from "@/lib/utils";
4-
import { Button } from "@/registry/new-york/ui/button";
4+
import { Button } from "../ui/button";
55

66
export const OpenInV0Button: FC<
77
{ name: string } & ComponentProps<typeof Button>
@@ -11,7 +11,7 @@ export const OpenInV0Button: FC<
1111
size="sm"
1212
className={cn(
1313
"shadow-none bg-black text-white hover:bg-black hover:text-white dark:bg-white dark:text-black",
14-
className
14+
className,
1515
)}
1616
asChild
1717
>
@@ -26,7 +26,9 @@ export const OpenInV0Button: FC<
2626
fill="none"
2727
xmlns="http://www.w3.org/2000/svg"
2828
className="h-5 w-5 text-current"
29+
aria-label="V0 logo"
2930
>
31+
<title>V0 logo</title>
3032
<path
3133
d="M23.3919 0H32.9188C36.7819 0 39.9136 3.13165 39.9136 6.99475V16.0805H36.0006V6.99475C36.0006 6.90167 35.9969 6.80925 35.9898 6.71766L26.4628 16.079C26.4949 16.08 26.5272 16.0805 26.5595 16.0805H36.0006V19.7762H26.5595C22.6964 19.7762 19.4788 16.6139 19.4788 12.7508V3.68923H23.3919V12.7508C23.3919 12.9253 23.4054 13.0977 23.4316 13.2668L33.1682 3.6995C33.0861 3.6927 33.003 3.68923 32.9188 3.68923H23.3919V0Z"
3234
fill="currentColor"

eslint.config.mjs

Lines changed: 0 additions & 16 deletions
This file was deleted.

lib/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { clsx, type ClassValue } from "clsx";
1+
import { type ClassValue, clsx } from "clsx";
22
import { twMerge } from "tailwind-merge";
33

44
export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));

0 commit comments

Comments
 (0)