Skip to content

Commit fb5bd8d

Browse files
authored
[migrate] replace ESLint with Biome to speed up Linting & Formatting (#7)
1 parent 755bde1 commit fb5bd8d

Some content is hidden

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

64 files changed

+944
-3029
lines changed

.github/pr-badge.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- icon: visualstudio
2+
label: 'GitHub.dev'
3+
message: 'PR-$prNumber'
4+
color: 'blue'
5+
url: 'https://github.dev/$owner/$repo/pull/$prNumber'
6+
7+
- icon: github
8+
label: 'GitHub codespaces'
9+
message: 'PR-$prNumber'
10+
color: 'black'
11+
url: 'https://codespaces.new/$owner/$repo/pull/$prNumber'
12+
13+
- icon: git
14+
label: 'GitPod.io'
15+
message: 'PR-$prNumber'
16+
color: 'orange'
17+
url: 'https://gitpod.io/?autostart=true#https://github.com/$owner/$repo/pull/$prNumber'

.github/settings.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
2+
3+
repository:
4+
allow_merge_commit: false
5+
6+
delete_branch_on_merge: true
7+
8+
enable_vulnerability_alerts: true
9+
10+
labels:
11+
- name: bug
12+
color: '#d73a4a'
13+
description: Something isn't working
14+
15+
- name: documentation
16+
color: '#0075ca'
17+
description: Improvements or additions to documentation
18+
19+
- name: duplicate
20+
color: '#cfd3d7'
21+
description: This issue or pull request already exists
22+
23+
- name: enhancement
24+
color: '#a2eeef'
25+
description: Some improvements
26+
27+
- name: feature
28+
color: '#16b33f'
29+
description: New feature or request
30+
31+
- name: good first issue
32+
color: '#7057ff'
33+
description: Good for newcomers
34+
35+
- name: help wanted
36+
color: '#008672'
37+
description: Extra attention is needed
38+
39+
- name: invalid
40+
color: '#e4e669'
41+
description: This doesn't seem right
42+
43+
- name: question
44+
color: '#d876e3'
45+
description: Further information is requested
46+
47+
- name: wontfix
48+
color: '#ffffff'
49+
description: This will not be worked on
50+
51+
branches:
52+
- name: main
53+
# https://docs.github.com/en/rest/reference/repos#update-branch-protection
54+
protection:
55+
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable.
56+
required_pull_request_reviews:
57+
# The number of approvals required. (1-6)
58+
required_approving_review_count: 1
59+
# Dismiss approved reviews automatically when a new commit is pushed.
60+
dismiss_stale_reviews: true
61+
# Blocks merge until code owners have reviewed.
62+
require_code_owner_reviews: true
63+
# Specify which users and teams can dismiss pull request reviews.
64+
# Pass an empty dismissal_restrictions object to disable.
65+
# User and team dismissal_restrictions are only available for organization-owned repositories.
66+
# Omit this parameter for personal repositories.
67+
dismissal_restrictions:
68+
# users: []
69+
# teams: []
70+
# Required. Require status checks to pass before merging. Set to null to disable
71+
required_status_checks:
72+
# Required. Require branches to be up to date before merging.
73+
strict: true
74+
# Required. The list of status checks to require in order to merge into this branch
75+
contexts: []
76+
# Required. Enforce all configured restrictions for administrators.
77+
# Set to true to enforce required status checks for repository administrators.
78+
# Set to null to disable.
79+
enforce_admins: true
80+
# Prevent merge commits from being pushed to matching branches
81+
required_linear_history: true
82+
# Required. Restrict who can push to this branch.
83+
# Team and user restrictions are only available for organization-owned repositories.
84+
# Set to null to disable.
85+
restrictions: null

.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

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,25 @@ A **Pagination Table** & **Scroll List** component suite for [CRUD operation][1]
2828

2929
## Installation
3030

31+
### `components.json`
32+
33+
```json
34+
{
35+
"registries": {
36+
"@mobx-restful-shadcn": "https://mobx-restful-shadcn.idea2.app/r/{name}.json"
37+
}
38+
}
39+
```
40+
41+
### Adding components
42+
3143
```shell
32-
npx shadcn-helper add https://mobx-restful-shadcn.idea2.app/r/rest-table.json
44+
npx shadcn-helper add @mobx-restful-shadcn/rest-table
3345
```
3446

3547
Replace `rest-table` with any component name from the list above.
3648

37-
## Configuration
49+
## Initialization
3850

3951
### Internationalization
4052

@@ -129,7 +141,7 @@ export class RepositoryTable extends Component {
129141
),
130142
},
131143
{ key: "stargazers_count", type: "number", renderHead: "Star Count" },
132-
{ key: "description", renderHead: "Description", rows: 3 },
144+
{ key: "description", renderHead: "Description", contentEditable: true },
133145
];
134146
}
135147

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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { GitRepository } from "mobx-github";
22

33
import { i18n, topicStore } from "@/models/example";
4-
import { BadgeBar } from "@/registry/new-york/blocks/badge-bar/badge-bar";
5-
import { Field } from "@/registry/new-york/blocks/rest-form/rest-form";
6-
import { Column } from "@/registry/new-york/blocks/rest-table/rest-table";
7-
import { SearchableInput } from "@/registry/new-york/blocks/searchable-input/searchable-input";
4+
import { BadgeBar } from "@/registry/new-york/blocks/badge-bar";
5+
import { Field } from "@/registry/new-york/blocks/rest-form";
6+
import { Column } from "@/registry/new-york/blocks/rest-table";
7+
import { SearchableInput } from "@/registry/new-york/blocks/searchable-input";
88

99
export const columns: Column<GitRepository>[] = [
1010
{
@@ -52,5 +52,5 @@ export const fields: Field<GitRepository>[] = columns.map(
5252
({ renderHead, renderBody, ...meta }) => ({
5353
...meta,
5454
renderLabel: renderHead,
55-
})
55+
}),
5656
);

0 commit comments

Comments
 (0)