Skip to content

Commit 01160a9

Browse files
committed
misc: replace eslint + prettier with biomejs
1 parent cbc0077 commit 01160a9

File tree

31 files changed

+774
-2225
lines changed

31 files changed

+774
-2225
lines changed

.github/workflows/reviewdog.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ env:
66
NODE_VERSION: "22.x"
77

88
jobs:
9-
eslint:
10-
name: runner / eslint
9+
biome:
10+
name: runner / Biome
1111
runs-on: ubuntu-latest
1212
permissions:
1313
contents: read
@@ -33,9 +33,8 @@ jobs:
3333
- name: Install dependencies
3434
run: pnpm install --frozen-lockfile
3535

36-
- uses: reviewdog/action-eslint@v1.34.0
36+
- uses: mongolyy/reviewdog-action-biome@v1
3737
with:
3838
github_token: ${{ secrets.GITHUB_TOKEN }}
3939
reporter: github-pr-review # Change reporter.
40-
eslint_flags: './src'
4140
fail_level: error

.prettierrc

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

.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+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[![GitHub release](https://img.shields.io/github/release/pear-devs/pear-desktop.svg?style=for-the-badge)](https://github.com/pear-devs/pear-desktop/releases/)
66
[![GitHub license](https://img.shields.io/github/license/pear-devs/pear-desktop.svg?style=for-the-badge)](https://github.com/pear-devs/pear-desktop/blob/master/license)
7-
[![eslint code style](https://img.shields.io/badge/code_style-eslint-5ed9c7.svg?style=for-the-badge)](https://github.com/pear-devs/pear-desktop/blob/master/eslint.config.mjs)
7+
[![Formatted with Biome](https://img.shields.io/badge/Formatted_with-Biome-60a5fa?style=for-the-badge&logo=biome)](https://biomejs.dev/)
88
[![Build status](https://img.shields.io/github/actions/workflow/status/pear-devs/pear-desktop/build.yml?branch=master&style=for-the-badge)](https://GitHub.com/pear-devs/pear-desktop/releases/)
99
[![GitHub All Releases](https://img.shields.io/github/downloads/pear-devs/pear-desktop/total?style=for-the-badge)](https://GitHub.com/pear-devs/pear-desktop/releases/)
1010
<!--[![AUR](https://img.shields.io/aur/version/youtube-music-bin?color=blueviolet&style=for-the-badge)](https://aur.archlinux.org/packages/youtube-music-bin)-->

biome.jsonc

Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": false
10+
},
11+
"formatter": {
12+
"enabled": true,
13+
"formatWithErrors": false,
14+
"indentStyle": "space",
15+
"indentWidth": 2,
16+
"lineEnding": "lf",
17+
"lineWidth": 80,
18+
"attributePosition": "auto",
19+
"bracketSameLine": false,
20+
"bracketSpacing": true,
21+
"expand": "auto",
22+
"useEditorconfig": true
23+
},
24+
"linter": {
25+
"enabled": true,
26+
"rules": {
27+
"recommended": false,
28+
"complexity": {
29+
"noAdjacentSpacesInRegex": "error",
30+
"noExtraBooleanCast": "error",
31+
"noUselessCatch": "error",
32+
"noUselessEscapeInRegex": "error",
33+
"noUselessThisAlias": "error",
34+
"noUselessTypeConstraint": "error",
35+
"noVoid": "error",
36+
"useArrowFunction": "off"
37+
},
38+
"correctness": {
39+
"noConstAssign": "error",
40+
"noConstantCondition": "error",
41+
"noEmptyCharacterClassInRegex": "error",
42+
"noEmptyPattern": "error",
43+
"noGlobalObjectCalls": "error",
44+
"noInvalidBuiltinInstantiation": "error",
45+
"noInvalidConstructorSuper": "error",
46+
"noNonoctalDecimalEscape": "error",
47+
"noPrecisionLoss": "error",
48+
"noSelfAssign": "error",
49+
"noSetterReturn": "error",
50+
"noSwitchDeclarations": "error",
51+
"noUndeclaredVariables": "error",
52+
"noUnreachable": "error",
53+
"noUnreachableSuper": "error",
54+
"noUnsafeFinally": "error",
55+
"noUnsafeOptionalChaining": "error",
56+
"noUnusedLabels": "error",
57+
"noUnusedPrivateClassMembers": "error",
58+
"noUnusedVariables": "error",
59+
"useIsNan": "error",
60+
"useValidForDirection": "error",
61+
"useValidTypeof": "error",
62+
"useYield": "error"
63+
},
64+
"nursery": {
65+
"noFloatingPromises": "off",
66+
"noMisusedPromises": "off",
67+
"noNonNullAssertedOptionalChain": "off",
68+
"noUnusedExpressions": "off",
69+
"useConsistentArrowReturn": "off"
70+
},
71+
"style": {
72+
"noCommonJs": "error",
73+
"noNamespace": "warn",
74+
"noNonNullAssertion": "off",
75+
"useArrayLiterals": "error",
76+
"useAsConstAssertion": "error",
77+
"useBlockStatements": "off",
78+
"useImportType": {
79+
"level": "error",
80+
"options": {
81+
"style": "inlineType"
82+
}
83+
},
84+
"useThrowOnlyError": "off"
85+
},
86+
"suspicious": {
87+
"noAssignInExpressions": "warn",
88+
"noAsyncPromiseExecutor": "error",
89+
"noCatchAssign": "error",
90+
"noClassAssign": "error",
91+
"noCompareNegZero": "error",
92+
"noConstantBinaryExpressions": "error",
93+
"noControlCharactersInRegex": "error",
94+
"noDebugger": "error",
95+
"noDuplicateCase": "error",
96+
"noDuplicateClassMembers": "error",
97+
"noDuplicateElseIf": "error",
98+
"noDuplicateObjectKeys": "error",
99+
"noDuplicateParameters": "error",
100+
"noEmptyBlockStatements": "warn",
101+
"noExplicitAny": "error",
102+
"noExtraNonNullAssertion": "error",
103+
"noFallthroughSwitchClause": "error",
104+
"noFunctionAssign": "error",
105+
"noGlobalAssign": "error",
106+
"noImportAssign": "error",
107+
"noIrregularWhitespace": "error",
108+
"noMisleadingCharacterClass": "error",
109+
"noMisleadingInstantiator": "error",
110+
"noPrototypeBuiltins": "error",
111+
"noRedeclare": "error",
112+
"noShadowRestrictedNames": "error",
113+
"noSparseArray": "error",
114+
"noTsIgnore": "error",
115+
"noUnsafeDeclarationMerging": "error",
116+
"noUnsafeNegation": "error",
117+
"noUselessRegexBackrefs": "error",
118+
"noWith": "error",
119+
"useAwait": "error",
120+
"useGetterReturn": "error",
121+
"useNamespaceKeyword": "error"
122+
}
123+
},
124+
"includes": [
125+
"**",
126+
"!dist",
127+
"!node_modules",
128+
"!*.config.*js",
129+
"!*.test.*js"
130+
]
131+
},
132+
"javascript": {
133+
"formatter": {
134+
"jsxQuoteStyle": "double",
135+
"quoteProperties": "asNeeded",
136+
"trailingCommas": "all",
137+
"semicolons": "always",
138+
"arrowParentheses": "always",
139+
"bracketSameLine": false,
140+
"quoteStyle": "single",
141+
"attributePosition": "auto",
142+
"bracketSpacing": true
143+
},
144+
"globals": []
145+
},
146+
"html": {
147+
"formatter": {
148+
"selfCloseVoidElements": "always"
149+
}
150+
},
151+
"overrides": [
152+
{
153+
"includes": [
154+
"**/*.ts",
155+
"**/*.tsx",
156+
"**/*.mts",
157+
"**/*.cts"
158+
],
159+
"linter": {
160+
"rules": {
161+
"complexity": {
162+
"noArguments": "error"
163+
},
164+
"correctness": {
165+
"noConstAssign": "off",
166+
"noGlobalObjectCalls": "off",
167+
"noInvalidBuiltinInstantiation": "off",
168+
"noInvalidConstructorSuper": "off",
169+
"noSetterReturn": "off",
170+
"noUndeclaredVariables": "off",
171+
"noUnreachable": "off",
172+
"noUnreachableSuper": "off"
173+
},
174+
"style": {
175+
"useConst": "error"
176+
},
177+
"suspicious": {
178+
"noClassAssign": "off",
179+
"noDuplicateClassMembers": "off",
180+
"noDuplicateObjectKeys": "off",
181+
"noDuplicateParameters": "off",
182+
"noFunctionAssign": "off",
183+
"noImportAssign": "off",
184+
"noRedeclare": "off",
185+
"noUnsafeNegation": "off",
186+
"noVar": "error",
187+
"noWith": "off",
188+
"useGetterReturn": "off"
189+
}
190+
}
191+
}
192+
},
193+
{
194+
"includes": [
195+
"**/*.ts",
196+
"**/*.tsx",
197+
"**/*.mts",
198+
"**/*.cts"
199+
],
200+
"linter": {
201+
"rules": {
202+
"complexity": {
203+
"noArguments": "error"
204+
},
205+
"correctness": {
206+
"noConstAssign": "off",
207+
"noGlobalObjectCalls": "off",
208+
"noInvalidBuiltinInstantiation": "off",
209+
"noInvalidConstructorSuper": "off",
210+
"noSetterReturn": "off",
211+
"noUndeclaredVariables": "off",
212+
"noUnreachable": "off",
213+
"noUnreachableSuper": "off"
214+
},
215+
"style": {
216+
"useConst": "error"
217+
},
218+
"suspicious": {
219+
"noClassAssign": "off",
220+
"noDuplicateClassMembers": "off",
221+
"noDuplicateObjectKeys": "off",
222+
"noDuplicateParameters": "off",
223+
"noFunctionAssign": "off",
224+
"noImportAssign": "off",
225+
"noRedeclare": "off",
226+
"noUnsafeNegation": "off",
227+
"noVar": "error",
228+
"noWith": "off",
229+
"useGetterReturn": "off"
230+
}
231+
}
232+
}
233+
}
234+
],
235+
"assist": {
236+
"enabled": true,
237+
"actions": {
238+
"source": {
239+
"organizeImports": "on"
240+
}
241+
}
242+
}
243+
}

eslint.config.mjs

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

0 commit comments

Comments
 (0)