Skip to content

Commit 1f47333

Browse files
authored
Remove eslint/prettier and switch to biome (#2880)
1 parent 027a859 commit 1f47333

File tree

347 files changed

+2318
-2862
lines changed

Some content is hidden

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

347 files changed

+2318
-2862
lines changed

.bun-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/composite/setup-bun/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ runs:
1515
- name: Setup bun
1616
uses: oven-sh/setup-bun@v2
1717
with:
18-
bun-version-file: '.bun-version'
18+
bun-version-file: 'package.json'

.github/workflows/ci.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -311,19 +311,6 @@ jobs:
311311
env:
312312
PUPPETEER_SKIP_DOWNLOAD: 1
313313
- run: bun format:check
314-
lint:
315-
runs-on: ubuntu-latest
316-
name: Lint
317-
steps:
318-
- name: Checkout
319-
uses: actions/checkout@v4
320-
- name: Setup Bun
321-
uses: ./.github/composite/setup-bun
322-
- name: Install dependencies
323-
run: bun install --frozen-lockfile
324-
env:
325-
PUPPETEER_SKIP_DOWNLOAD: 1
326-
- run: bun lint --no-cache
327314
test:
328315
runs-on: ubuntu-latest
329316
name: Test

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["biomejs.biome"]
3+
}

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,10 @@
77
["style \\=([^;]*);", "\"([^\"]*)\""],
88
["style \\=([^;]*);", "\\`([^\\`]*)\\`"]
99
],
10-
"tailwindCSS.classAttributes": ["class", "className", "style", ".*Style"]
10+
"tailwindCSS.classAttributes": ["class", "className", "style", ".*Style"],
11+
"prettier.enable": false,
12+
"editor.defaultFormatter": "biomejs.biome",
13+
"editor.codeActionsOnSave": {
14+
"source.organizeImports": "explicit"
15+
}
1116
}

biome.json

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
7+
},
8+
"files": {
9+
"ignoreUnknown": false,
10+
"ignore": [
11+
"**/node_modules/**/*",
12+
"**/dist/**/*",
13+
"**/build/**/*",
14+
"**/public/**/*",
15+
"**/.next/**/*",
16+
"**/.open-next/**/*",
17+
"**/.turbo/**/*",
18+
"**/.vercel/**/*",
19+
"**/.cache/**/*",
20+
"**/.wrangler/**/*",
21+
"packages/openapi-parser/src/fixtures/**/*"
22+
]
23+
},
24+
"formatter": {
25+
"enabled": true,
26+
"useEditorconfig": true,
27+
"formatWithErrors": false,
28+
"indentStyle": "space",
29+
"indentWidth": 4,
30+
"lineEnding": "lf",
31+
"lineWidth": 100,
32+
"attributePosition": "auto",
33+
"bracketSpacing": true
34+
},
35+
"organizeImports": {
36+
"enabled": true
37+
},
38+
"linter": {
39+
"enabled": true,
40+
"rules": {
41+
"recommended": true,
42+
"performance": {
43+
"noDelete": "warn"
44+
},
45+
"security": {
46+
"noDangerouslySetInnerHtml": "off"
47+
},
48+
"complexity": {
49+
"noForEach": "off",
50+
"noUselessFragments": "warn",
51+
"noBannedTypes": "warn"
52+
},
53+
"correctness": {
54+
"noUndeclaredVariables": "error",
55+
"noUnusedVariables": "error",
56+
"useArrayLiterals": "error",
57+
"useHookAtTopLevel": "error",
58+
"noUnusedImports": "error",
59+
"noVoidElementsWithChildren": "warn",
60+
"useJsxKeyInIterable": "warn",
61+
"useExhaustiveDependencies": "warn"
62+
},
63+
"style": {
64+
"noNonNullAssertion": "warn",
65+
"noParameterAssign": "off",
66+
"useThrowOnlyError": "error"
67+
},
68+
"suspicious": {
69+
"noConsole": "warn",
70+
"noExplicitAny": "warn",
71+
"noImplicitAnyLet": "warn",
72+
"noConfusingVoidType": "warn",
73+
"noControlCharactersInRegex": "warn",
74+
"noPrototypeBuiltins": "warn",
75+
"noAssignInExpressions": "warn",
76+
"noArrayIndexKey": "warn"
77+
},
78+
"a11y": {
79+
"useSemanticElements": "warn",
80+
"useKeyWithClickEvents": "warn",
81+
"noSvgWithoutTitle": "warn",
82+
"useButtonType": "warn",
83+
"useIframeTitle": "warn",
84+
"useAltText": "warn",
85+
"noPositiveTabindex": "warn",
86+
"useFocusableInteractive": "warn",
87+
"useAriaPropsForRole": "warn",
88+
"useValidAnchor": "warn",
89+
"noLabelWithoutControl": "warn",
90+
"noNoninteractiveTabindex": "warn"
91+
},
92+
"nursery": {
93+
"useSortedClasses": {
94+
"level": "error",
95+
"fix": "safe",
96+
"options": {
97+
"attributes": ["class", "className", "style"],
98+
"functions": ["clsx", "tw"]
99+
}
100+
}
101+
}
102+
}
103+
},
104+
"javascript": {
105+
"formatter": {
106+
"jsxQuoteStyle": "double",
107+
"quoteProperties": "asNeeded",
108+
"trailingCommas": "es5",
109+
"semicolons": "always",
110+
"arrowParentheses": "always",
111+
"bracketSameLine": false,
112+
"quoteStyle": "single",
113+
"attributePosition": "auto",
114+
"bracketSpacing": true
115+
}
116+
},
117+
"overrides": [
118+
{
119+
"include": [
120+
"packages/gitbook/**/*",
121+
"packages/gitbook-v2/**/*",
122+
"packages/react-openapi/**/*",
123+
"packages/react-math/**/*",
124+
"packages/react-contentkit/**/*",
125+
"packages/icons/**/*"
126+
],
127+
"javascript": {
128+
"globals": ["React"]
129+
}
130+
},
131+
{
132+
"include": ["packages/gitbook/**/*"],
133+
"javascript": {
134+
"globals": ["React", "GitBookIntegrationEvent"]
135+
}
136+
},
137+
{
138+
"include": ["*.css"],
139+
"javascript": {
140+
"globals": ["theme"]
141+
}
142+
},
143+
{
144+
"include": ["*.test.ts", "packages/gitbook/tests/**/*"],
145+
"javascript": {
146+
"globals": ["Bun"]
147+
}
148+
},
149+
{
150+
"include": [
151+
"packages/cache-do/**/*",
152+
"packages/gitbook/cf-env.d.ts",
153+
"packages/gitbook/src/cloudflare-entrypoint.ts"
154+
],
155+
"javascript": {
156+
"globals": [
157+
"DurableObjectLocationHint",
158+
"DurableObjectNamespace",
159+
"DurableObjectStub",
160+
"ContinentCode",
161+
"Fetcher",
162+
"ExportedHandler"
163+
]
164+
}
165+
}
166+
]
167+
}

0 commit comments

Comments
 (0)