Skip to content

Commit 014fe10

Browse files
authored
Merge pull request #23 from geobrowser/chris.whited/poc-biome
POC(biome): use biomejs for linting and formatting
2 parents a5f6bac + 4eec2c1 commit 014fe10

Some content is hidden

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

80 files changed

+1286
-1676
lines changed

.github/workflows/tests-and-checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
run: cd apps/server && pnpm prisma generate
2020
- name: Typecheck
2121
run: pnpm ts:check
22-
- name: Linting
23-
run: pnpm lint
22+
- name: Linting & Formatting
23+
run: pnpm check
2424
- name: Test
2525
run: pnpm 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: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.codeActionsOnSave": {
4+
"source.removeUnused.ts": "explicit",
5+
"source.organizeImports.biome": "explicit"
6+
},
7+
"[javascript]": {
8+
"editor.maxTokenizationLineLength": 2500,
9+
"editor.defaultFormatter": "biomejs.biome"
10+
},
11+
"[javascriptreact]": {
12+
"editor.defaultFormatter": "biomejs.biome"
13+
},
14+
"[typescript]": {
15+
"editor.defaultFormatter": "biomejs.biome"
16+
},
17+
"[typescriptreact]": {
18+
"editor.defaultFormatter": "biomejs.biome"
19+
},
20+
"[markdown]": {
21+
"editor.unicodeHighlight.ambiguousCharacters": false,
22+
"editor.unicodeHighlight.invisibleCharacters": false,
23+
"diffEditor.ignoreTrimWhitespace": false,
24+
"editor.wordWrap": "on",
25+
"editor.quickSuggestions": {
26+
"comments": "off",
27+
"strings": "off",
28+
"other": "off"
29+
},
30+
"editor.defaultFormatter": "biomejs.biome"
31+
},
32+
"[json]": {
33+
"editor.quickSuggestions": {
34+
"strings": true
35+
},
36+
"editor.suggest.insertMode": "replace",
37+
"editor.defaultFormatter": "biomejs.biome"
38+
},
39+
"[jsonc]": {
40+
"editor.quickSuggestions": {
41+
"strings": true
42+
},
43+
"editor.suggest.insertMode": "replace",
44+
"editor.defaultFormatter": "biomejs.biome"
45+
}
46+
}

apps/events/biome.jsonc

Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"extends": ["../../biome.jsonc"],
4+
"linter": { "rules": { "recommended": false }, "ignore": ["dist"] },
5+
"overrides": [
6+
{
7+
"include": ["**/*.{ts,tsx}"],
8+
"linter": {
9+
"rules": {
10+
"complexity": {
11+
"noExtraBooleanCast": "error",
12+
"noMultipleSpacesInRegularExpressionLiterals": "error",
13+
"noUselessCatch": "error",
14+
"noWith": "error"
15+
},
16+
"correctness": {
17+
"noConstAssign": "error",
18+
"noConstantCondition": "error",
19+
"noEmptyCharacterClassInRegex": "error",
20+
"noEmptyPattern": "error",
21+
"noGlobalObjectCalls": "error",
22+
"noInvalidBuiltinInstantiation": "error",
23+
"noInvalidConstructorSuper": "error",
24+
"noNonoctalDecimalEscape": "error",
25+
"noPrecisionLoss": "error",
26+
"noSelfAssign": "error",
27+
"noSetterReturn": "error",
28+
"noSwitchDeclarations": "error",
29+
"noUndeclaredVariables": "error",
30+
"noUnreachable": "error",
31+
"noUnreachableSuper": "error",
32+
"noUnsafeFinally": "error",
33+
"noUnsafeOptionalChaining": "error",
34+
"noUnusedLabels": "error",
35+
"noUnusedPrivateClassMembers": "error",
36+
"noUnusedVariables": "error",
37+
"useIsNan": "error",
38+
"useValidForDirection": "error",
39+
"useYield": "error"
40+
},
41+
"suspicious": {
42+
"noAssignInExpressions": "error",
43+
"noAsyncPromiseExecutor": "error",
44+
"noCatchAssign": "error",
45+
"noClassAssign": "error",
46+
"noCompareNegZero": "error",
47+
"noControlCharactersInRegex": "error",
48+
"noDebugger": "error",
49+
"noDuplicateCase": "error",
50+
"noDuplicateClassMembers": "error",
51+
"noDuplicateObjectKeys": "error",
52+
"noDuplicateParameters": "error",
53+
"noEmptyBlockStatements": "error",
54+
"noFallthroughSwitchClause": "error",
55+
"noFunctionAssign": "error",
56+
"noGlobalAssign": "error",
57+
"noImportAssign": "error",
58+
"noMisleadingCharacterClass": "error",
59+
"noPrototypeBuiltins": "error",
60+
"noRedeclare": "error",
61+
"noShadowRestrictedNames": "error",
62+
"noSparseArray": "error",
63+
"noUnsafeNegation": "error",
64+
"useGetterReturn": "error",
65+
"useValidTypeof": "error"
66+
}
67+
}
68+
}
69+
},
70+
{ "include": ["**/*.{ts,tsx}"], "javascript": { "globals": [] } },
71+
{
72+
"include": ["**/*.{ts,tsx}"],
73+
"linter": {
74+
"rules": {
75+
"correctness": {
76+
"noConstAssign": "off",
77+
"noGlobalObjectCalls": "off",
78+
"noInvalidBuiltinInstantiation": "off",
79+
"noInvalidConstructorSuper": "off",
80+
"noNewSymbol": "off",
81+
"noSetterReturn": "off",
82+
"noUndeclaredVariables": "off",
83+
"noUnreachable": "off",
84+
"noUnreachableSuper": "off"
85+
},
86+
"style": { "noArguments": "error", "noVar": "error", "useConst": "error" },
87+
"suspicious": {
88+
"noClassAssign": "off",
89+
"noDuplicateClassMembers": "off",
90+
"noDuplicateObjectKeys": "off",
91+
"noDuplicateParameters": "off",
92+
"noFunctionAssign": "off",
93+
"noImportAssign": "off",
94+
"noRedeclare": "off",
95+
"noUnsafeNegation": "off",
96+
"useGetterReturn": "off"
97+
}
98+
}
99+
}
100+
},
101+
{
102+
"include": ["**/*.{ts,tsx}"],
103+
"linter": {
104+
"rules": {
105+
"complexity": { "noUselessThisAlias": "error", "noUselessTypeConstraint": "error" },
106+
"correctness": { "noUnusedVariables": "error", "useArrayLiterals": "off" },
107+
"style": { "noNamespace": "error", "useAsConstAssertion": "error" },
108+
"suspicious": {
109+
"noExplicitAny": "error",
110+
"noExtraNonNullAssertion": "error",
111+
"noMisleadingInstantiator": "error",
112+
"noUnsafeDeclarationMerging": "error",
113+
"useNamespaceKeyword": "error"
114+
}
115+
}
116+
}
117+
},
118+
{
119+
"include": ["**/*.{ts,tsx}"],
120+
"javascript": {
121+
"globals": [
122+
"onscrollend",
123+
"onpointerleave",
124+
"oncontextrestored",
125+
"onemptied",
126+
"ongamepaddisconnected",
127+
"onkeypress",
128+
"onloadeddata",
129+
"onmouseup",
130+
"onvolumechange",
131+
"onpaste",
132+
"onstorage",
133+
"onkeyup",
134+
"onabort",
135+
"oncut",
136+
"ontransitionrun",
137+
"onafterprint",
138+
"onblur",
139+
"ondurationchange",
140+
"ontransitionstart",
141+
"oncanplaythrough",
142+
"onanimationend",
143+
"onmouseleave",
144+
"ondragleave",
145+
"onplay",
146+
"onunhandledrejection",
147+
"onbeforeprint",
148+
"onpointercancel",
149+
"onsubmit",
150+
"ondragstart",
151+
"onmessage",
152+
"location",
153+
"onoffline",
154+
"onappinstalled",
155+
"onwheel",
156+
"onended",
157+
"onkeydown",
158+
"onclick",
159+
"onfocus",
160+
"onscroll",
161+
"ongamepadconnected",
162+
"oncanplay",
163+
"onpointerdown",
164+
"ondeviceorientationabsolute",
165+
"onauxclick",
166+
"ondevicemotion",
167+
"onratechange",
168+
"ontransitionend",
169+
"onscrollsnapchanging",
170+
"onchange",
171+
"onselect",
172+
"onbeforeinstallprompt",
173+
"onbeforetoggle",
174+
"onmouseout",
175+
"ontimeupdate",
176+
"ondragover",
177+
"oncuechange",
178+
"ontransitioncancel",
179+
"onprogress",
180+
"onbeforeinput",
181+
"onpointerenter",
182+
"onmouseenter",
183+
"oninvalid",
184+
"onpointerout",
185+
"onpagereveal",
186+
"onpause",
187+
"onanimationstart",
188+
"onwaiting",
189+
"onscrollsnapchange",
190+
"ondeviceorientation",
191+
"onclose",
192+
"onbeforeunload",
193+
"oncancel",
194+
"onseeked",
195+
"onpointerover",
196+
"ongotpointercapture",
197+
"onloadedmetadata",
198+
"onpageshow",
199+
"onstalled",
200+
"oncontextmenu",
201+
"onreset",
202+
"ondrag",
203+
"onbeforematch",
204+
"onload",
205+
"onlostpointercapture",
206+
"onsuspend",
207+
"onselectionchange",
208+
"onpagehide",
209+
"onrejectionhandled",
210+
"onunload",
211+
"onanimationcancel",
212+
"onmousedown",
213+
"onpointerup",
214+
"onmouseover",
215+
"onformdata",
216+
"oncontentvisibilityautostatechange",
217+
"onresize",
218+
"onsearch",
219+
"ontoggle",
220+
"onpageswap",
221+
"onbeforexrselect",
222+
"onlanguagechange",
223+
"ondragenter",
224+
"onerror",
225+
"onpointermove",
226+
"onmousemove",
227+
"ondrop",
228+
"onhashchange",
229+
"onsecuritypolicyviolation",
230+
"onslotchange",
231+
"oncopy",
232+
"onanimationiteration",
233+
"ondblclick",
234+
"ondragend",
235+
"onpointerrawupdate",
236+
"onpopstate",
237+
"onplaying",
238+
"oncontextlost",
239+
"onloadstart",
240+
"onseeking",
241+
"oninput",
242+
"onmessageerror",
243+
"onselectstart",
244+
"onmousewheel",
245+
"ononline"
246+
]
247+
},
248+
"linter": { "rules": { "correctness": { "useExhaustiveDependencies": "warn", "useHookAtTopLevel": "error" } } }
249+
}
250+
]
251+
}

apps/events/components.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
"lib": "@/lib",
1818
"hooks": "@/hooks"
1919
}
20-
}
20+
}

apps/events/eslint.config.js

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

apps/events/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
"scripts": {
77
"dev": "vite --force",
88
"build": "tsc -b && vite build",
9-
"lint": "eslint .",
9+
"lint": "pnpm biome lint src/*",
10+
"lint:fix": "pnpm biome lint --write src/*",
11+
"format": "pnpm biome format src/*",
12+
"format:fix": "pnpm biome format --write src/*",
13+
"check": "pnpm biome check src/*",
14+
"check:fix": "pnpm biome check --write src/*",
1015
"preview": "vite preview",
1116
"test": "vitest run",
1217
"ts:check": "tsc --noEmit"
@@ -36,7 +41,7 @@
3641
"vite-plugin-node-polyfills": "^0.22.0"
3742
},
3843
"devDependencies": {
39-
"@eslint/js": "^9.12.0",
44+
"@biomejs/biome": "1.9.4",
4045
"@tanstack/router-devtools": "^1.62.1",
4146
"@tanstack/router-plugin": "^1.62.0",
4247
"@types/node": "^22.7.4",
@@ -45,14 +50,9 @@
4550
"@types/uuid": "^10.0.0",
4651
"@vitejs/plugin-react": "^4.3.2",
4752
"autoprefixer": "^10.4.20",
48-
"eslint": "^9.12.0",
49-
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
50-
"eslint-plugin-react-refresh": "^0.4.9",
5153
"globals": "^15.10.0",
5254
"postcss": "^8.4.47",
5355
"tailwindcss": "^3.4.13",
54-
"typescript": "^5.5.3",
55-
"typescript-eslint": "^8.8.0",
5656
"vite-plugin-top-level-await": "^1.4.4",
5757
"vite-plugin-wasm": "^3.3.0"
5858
}

apps/events/postcss.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ export default {
33
tailwindcss: {},
44
autoprefixer: {},
55
},
6-
}
6+
};

0 commit comments

Comments
 (0)