Skip to content

Commit c522346

Browse files
lazarusATheJeran
andauthored
biome setup (#460)
* add biome * exclude * changes * update export --------- Co-authored-by: Jeran <[email protected]>
1 parent b82ae2d commit c522346

File tree

3 files changed

+279
-1
lines changed

3 files changed

+279
-1
lines changed

biome.json

Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
3+
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
4+
"files": {
5+
"ignoreUnknown": false,
6+
"includes": [
7+
"**",
8+
"!**/globals.css",
9+
"!**/ne_110m_coastline.json",
10+
"!**/ne_110m_admin_0_countries.json",
11+
"!**/package.json"
12+
] },
13+
"formatter": {
14+
"enabled": true,
15+
"indentStyle": "tab",
16+
"indentWidth": 4
17+
},
18+
"linter": {
19+
"enabled": true,
20+
"rules": {
21+
"recommended": false,
22+
"complexity": { "noUselessTypeConstraint": "error" },
23+
"correctness": {
24+
"noUnusedVariables": "error",
25+
"useExhaustiveDependencies": "off"
26+
},
27+
"performance": {
28+
"noImgElement": "warn",
29+
"noUnwantedPolyfillio": "warn",
30+
"useGoogleFontPreconnect": "warn"
31+
},
32+
"style": {
33+
"noCommonJs": "error",
34+
"noHeadElement": "warn",
35+
"noNamespace": "error",
36+
"useArrayLiterals": "error",
37+
"useAsConstAssertion": "error"
38+
},
39+
"suspicious": {
40+
"noDocumentImportInPage": "error",
41+
"noExplicitAny": "error",
42+
"noExtraNonNullAssertion": "error",
43+
"noHeadImportInDocument": "error",
44+
"noMisleadingInstantiator": "error",
45+
"noNonNullAssertedOptionalChain": "error",
46+
"noUnsafeDeclarationMerging": "error",
47+
"useGoogleFontDisplay": "warn",
48+
"useNamespaceKeyword": "error"
49+
}
50+
},
51+
"includes": [
52+
"**",
53+
"!.next/**",
54+
"!out/**",
55+
"!build/**",
56+
"!next-env.d.ts",
57+
"!.next/**",
58+
"!out/**",
59+
"!build/**",
60+
"!next-env.d.ts",
61+
"!.next/**",
62+
"!out/**",
63+
"!build/**",
64+
"!next-env.d.ts"
65+
]
66+
},
67+
"javascript": {
68+
"formatter": {
69+
"quoteStyle": "double",
70+
"bracketSameLine": false
71+
},
72+
"globals": [] },
73+
"overrides": [
74+
{
75+
"includes": ["**/*.{js,jsx,mjs,ts,tsx,mts,cts}"],
76+
"javascript": {
77+
"globals": [
78+
"onanimationend",
79+
"exports",
80+
"ongamepadconnected",
81+
"onlostpointercapture",
82+
"onanimationiteration",
83+
"onkeyup",
84+
"onmousedown",
85+
"onanimationstart",
86+
"onslotchange",
87+
"onprogress",
88+
"ontransitionstart",
89+
"onpause",
90+
"onended",
91+
"onpointerover",
92+
"onscrollend",
93+
"onformdata",
94+
"ontransitionrun",
95+
"onanimationcancel",
96+
"ondrag",
97+
"onchange",
98+
"onbeforeinstallprompt",
99+
"onbeforexrselect",
100+
"onmessage",
101+
"ontransitioncancel",
102+
"onpointerdown",
103+
"onabort",
104+
"onpointerout",
105+
"oncuechange",
106+
"ongotpointercapture",
107+
"onscrollsnapchanging",
108+
"onsearch",
109+
"onsubmit",
110+
"onstalled",
111+
"onsuspend",
112+
"onreset",
113+
"onerror",
114+
"onresize",
115+
"onmouseenter",
116+
"ongamepaddisconnected",
117+
"ondragover",
118+
"onbeforetoggle",
119+
"onmouseover",
120+
"onpagehide",
121+
"onmousemove",
122+
"onratechange",
123+
"oncommand",
124+
"onmessageerror",
125+
"onwheel",
126+
"ondevicemotion",
127+
"onauxclick",
128+
"ontransitionend",
129+
"onpaste",
130+
"onpageswap",
131+
"ononline",
132+
"ondeviceorientationabsolute",
133+
"onkeydown",
134+
"onclose",
135+
"onselect",
136+
"onpageshow",
137+
"onpointercancel",
138+
"onbeforematch",
139+
"onpointerrawupdate",
140+
"ondragleave",
141+
"onscrollsnapchange",
142+
"onseeked",
143+
"onwaiting",
144+
"onbeforeunload",
145+
"onplaying",
146+
"onvolumechange",
147+
"ondragend",
148+
"onstorage",
149+
"onloadeddata",
150+
"onfocus",
151+
"onoffline",
152+
"onplay",
153+
"onafterprint",
154+
"onclick",
155+
"oncut",
156+
"onmouseout",
157+
"ondblclick",
158+
"oncanplay",
159+
"onloadstart",
160+
"onappinstalled",
161+
"onpointermove",
162+
"ontoggle",
163+
"oncontextmenu",
164+
"onblur",
165+
"oncancel",
166+
"onbeforeprint",
167+
"oncontextrestored",
168+
"onloadedmetadata",
169+
"onpointerup",
170+
"onlanguagechange",
171+
"oncopy",
172+
"onselectstart",
173+
"onscroll",
174+
"onload",
175+
"ondragstart",
176+
"onbeforeinput",
177+
"oncanplaythrough",
178+
"oninput",
179+
"oninvalid",
180+
"ontimeupdate",
181+
"ondurationchange",
182+
"onselectionchange",
183+
"onmouseup",
184+
"location",
185+
"onkeypress",
186+
"onpointerleave",
187+
"oncontextlost",
188+
"ondrop",
189+
"onsecuritypolicyviolation",
190+
"oncontentvisibilityautostatechange",
191+
"ondeviceorientation",
192+
"onseeking",
193+
"onrejectionhandled",
194+
"onunload",
195+
"onmouseleave",
196+
"onhashchange",
197+
"onpointerenter",
198+
"onmousewheel",
199+
"onunhandledrejection",
200+
"ondragenter",
201+
"onpopstate",
202+
"onpagereveal",
203+
"onemptied"
204+
]
205+
},
206+
"linter": {
207+
"rules": {
208+
"a11y": {
209+
"noAriaUnsupportedElements": "warn",
210+
"useAltText": "warn",
211+
"useAriaPropsForRole": "warn",
212+
"useAriaPropsSupportedByRole": "warn",
213+
"useValidAriaProps": "warn",
214+
"useValidAriaValues": "warn"
215+
},
216+
"correctness": {
217+
"noChildrenProp": "error",
218+
"useExhaustiveDependencies": "warn",
219+
"useHookAtTopLevel": "error",
220+
"useJsxKeyInIterable": "error"
221+
},
222+
"performance": {
223+
"noImgElement": "warn",
224+
"noUnwantedPolyfillio": "warn",
225+
"useGoogleFontPreconnect": "warn"
226+
},
227+
"security": { "noDangerouslySetInnerHtmlWithChildren": "error" },
228+
"style": { "noHeadElement": "warn" },
229+
"suspicious": {
230+
"noCommentText": "error",
231+
"noDocumentImportInPage": "error",
232+
"noDuplicateJsxProps": "error",
233+
"noHeadImportInDocument": "error",
234+
"useGoogleFontDisplay": "warn"
235+
}
236+
}
237+
}
238+
},
239+
{ "includes": ["**/*.ts", "**/*.tsx"], "javascript": { "globals": [] } },
240+
{
241+
"includes": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
242+
"linter": {
243+
"rules": {
244+
"complexity": { "noArguments": "error" },
245+
"correctness": {
246+
"noConstAssign": "off",
247+
"noGlobalObjectCalls": "off",
248+
"noInvalidBuiltinInstantiation": "off",
249+
"noInvalidConstructorSuper": "off",
250+
"noSetterReturn": "off",
251+
"noUndeclaredVariables": "off",
252+
"noUnreachable": "off",
253+
"noUnreachableSuper": "off"
254+
},
255+
"style": { "useConst": "error" },
256+
"suspicious": {
257+
"noClassAssign": "off",
258+
"noDuplicateClassMembers": "off",
259+
"noDuplicateObjectKeys": "off",
260+
"noDuplicateParameters": "off",
261+
"noFunctionAssign": "off",
262+
"noImportAssign": "off",
263+
"noRedeclare": "off",
264+
"noUnsafeNegation": "off",
265+
"noVar": "error",
266+
"noWith": "off",
267+
"useGetterReturn": "off"
268+
}
269+
}
270+
}
271+
}
272+
],
273+
"assist": {
274+
"enabled": true,
275+
"actions": { "source": { "organizeImports": "on" } }
276+
}
277+
}

next.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ const nextConfig = {
4646

4747
console.log('Current NODE_ENV:', process.env.NODE_ENV);
4848
// console.log('Current basePath:', nextConfig.basePath);
49-
module.exports = nextConfig;
49+
export default nextConfig;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"zustand": "^5.0.8"
8787
},
8888
"devDependencies": {
89+
"@biomejs/biome": "2.3.8",
8990
"@eslint/eslintrc": "^3",
9091
"@tailwindcss/postcss": "^4",
9192
"@testing-library/dom": "^10.4.0",

0 commit comments

Comments
 (0)