Skip to content

Commit 4d3f911

Browse files
committed
misc: replace eslint + prettier with biomejs
- Remove ESLint and Prettier configurations and dependencies - Add Biome configuration (biome.jsonc) - Update package.json scripts to use Biome for linting and formatting - Update GitHub workflow to use Biome instead of ESLint - Replace eslint-disable comments with biome-ignore comments - Update README badges from ESLint to Biome - Add Biome VS Code extension recommendation
1 parent f81dd1f commit 4d3f911

File tree

40 files changed

+766
-2226
lines changed

40 files changed

+766
-2226
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/th-ch/youtube-music.svg?style=for-the-badge&logo=youtube-music)](https://github.com/th-ch/youtube-music/releases/)
66
[![GitHub license](https://img.shields.io/github/license/th-ch/youtube-music.svg?style=for-the-badge)](https://github.com/th-ch/youtube-music/blob/master/license)
7-
[![eslint code style](https://img.shields.io/badge/code_style-eslint-5ed9c7.svg?style=for-the-badge)](https://github.com/th-ch/youtube-music/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/th-ch/youtube-music/build.yml?branch=master&style=for-the-badge&logo=youtube-music)](https://GitHub.com/th-ch/youtube-music/releases/)
99
[![GitHub All Releases](https://img.shields.io/github/downloads/th-ch/youtube-music/total?style=for-the-badge&logo=youtube-music)](https://GitHub.com/th-ch/youtube-music/releases/)
1010
[![AUR](https://img.shields.io/aur/version/youtube-music-bin?color=blueviolet&style=for-the-badge&logo=youtube-music)](https://aur.archlinux.org/packages/youtube-music-bin)

biome.jsonc

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
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": ["**", "!dist", "!node_modules", "!*.config.*js", "!*.test.*js"]
125+
},
126+
"javascript": {
127+
"formatter": {
128+
"jsxQuoteStyle": "double",
129+
"quoteProperties": "asNeeded",
130+
"trailingCommas": "all",
131+
"semicolons": "always",
132+
"arrowParentheses": "always",
133+
"bracketSameLine": false,
134+
"quoteStyle": "single",
135+
"attributePosition": "auto",
136+
"bracketSpacing": true
137+
},
138+
"globals": []
139+
},
140+
"html": {
141+
"formatter": {
142+
"selfCloseVoidElements": "always"
143+
}
144+
},
145+
"overrides": [
146+
{
147+
"includes": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
148+
"linter": {
149+
"rules": {
150+
"complexity": {
151+
"noArguments": "error"
152+
},
153+
"correctness": {
154+
"noConstAssign": "off",
155+
"noGlobalObjectCalls": "off",
156+
"noInvalidBuiltinInstantiation": "off",
157+
"noInvalidConstructorSuper": "off",
158+
"noSetterReturn": "off",
159+
"noUndeclaredVariables": "off",
160+
"noUnreachable": "off",
161+
"noUnreachableSuper": "off"
162+
},
163+
"style": {
164+
"useConst": "error"
165+
},
166+
"suspicious": {
167+
"noClassAssign": "off",
168+
"noDuplicateClassMembers": "off",
169+
"noDuplicateObjectKeys": "off",
170+
"noDuplicateParameters": "off",
171+
"noFunctionAssign": "off",
172+
"noImportAssign": "off",
173+
"noRedeclare": "off",
174+
"noUnsafeNegation": "off",
175+
"noVar": "error",
176+
"noWith": "off",
177+
"useGetterReturn": "off"
178+
}
179+
}
180+
}
181+
},
182+
{
183+
"includes": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
184+
"linter": {
185+
"rules": {
186+
"complexity": {
187+
"noArguments": "error"
188+
},
189+
"correctness": {
190+
"noConstAssign": "off",
191+
"noGlobalObjectCalls": "off",
192+
"noInvalidBuiltinInstantiation": "off",
193+
"noInvalidConstructorSuper": "off",
194+
"noSetterReturn": "off",
195+
"noUndeclaredVariables": "off",
196+
"noUnreachable": "off",
197+
"noUnreachableSuper": "off"
198+
},
199+
"style": {
200+
"useConst": "error"
201+
},
202+
"suspicious": {
203+
"noClassAssign": "off",
204+
"noDuplicateClassMembers": "off",
205+
"noDuplicateObjectKeys": "off",
206+
"noDuplicateParameters": "off",
207+
"noFunctionAssign": "off",
208+
"noImportAssign": "off",
209+
"noRedeclare": "off",
210+
"noUnsafeNegation": "off",
211+
"noVar": "error",
212+
"noWith": "off",
213+
"useGetterReturn": "off"
214+
}
215+
}
216+
}
217+
}
218+
],
219+
"assist": {
220+
"enabled": true,
221+
"actions": {
222+
"source": {
223+
"organizeImports": "on"
224+
}
225+
}
226+
}
227+
}

docs/js/main.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
/* eslint-disable */
1+
/** biome-ignore-all lint/complexity/noUselessThisAlias: Idk why people want to do this */
2+
/** biome-ignore-all lint/correctness/noUndeclaredVariables: ScrollReveal is declared in a script in index.html*/
3+
/** biome-ignore-all lint/suspicious/noAssignInExpressions: Ignore this one */
24

35
// Constants
46
const element = document.documentElement;
@@ -64,9 +66,9 @@ bubbleCanvas.prototype.update = function () {
6466
t.posX += (t.mouseX / (t.staticity / t.magnetism) - t.posX) / t.smoothFactor;
6567
t.posY += (t.mouseY / (t.staticity / t.magnetism) - t.posY) / t.smoothFactor;
6668
if (
67-
t.translateY + t.posY < 0
68-
|| t.translateX + t.posX < 0
69-
|| t.translateX + t.posX > t.canvasWidth
69+
t.translateY + t.posY < 0 ||
70+
t.translateX + t.posX < 0 ||
71+
t.translateX + t.posX > t.canvasWidth
7072
) {
7173
t.randomise();
7274
t.translateY = t.canvasHeight;

docs/readme/README-es.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/th-ch/youtube-music.svg?style=for-the-badge&logo=youtube-music)](https://github.com/th-ch/youtube-music/releases/)
66
[![GitHub license](https://img.shields.io/github/license/th-ch/youtube-music.svg?style=for-the-badge)](https://github.com/th-ch/youtube-music/blob/master/license)
7-
[![eslint code style](https://img.shields.io/badge/code_style-eslint-5ed9c7.svg?style=for-the-badge)](https://github.com/th-ch/youtube-music/blob/master/.eslintrc.js)
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/th-ch/youtube-music/build.yml?branch=master&style=for-the-badge&logo=youtube-music)](https://GitHub.com/th-ch/youtube-music/releases/)
99
[![GitHub All Releases](https://img.shields.io/github/downloads/th-ch/youtube-music/total?style=for-the-badge&logo=youtube-music)](https://GitHub.com/th-ch/youtube-music/releases/)
1010
[![AUR](https://img.shields.io/aur/version/youtube-music-bin?color=blueviolet&style=for-the-badge&logo=youtube-music)](https://aur.archlinux.org/packages/youtube-music-bin)

docs/readme/README-fr.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/th-ch/youtube-music.svg?style=for-the-badge&logo=youtube-music)](https://github.com/th-ch/youtube-music/releases/)
66
[![Licence GitHub](https://img.shields.io/github/license/th-ch/youtube-music.svg?style=for-the-badge)](https://github.com/th-ch/youtube-music/blob/master/license)
7-
[![style de code eslint](https://img.shields.io/badge/style_de_code-eslint-5ed9c7.svg?style=for-the-badge)](https://github.com/th-ch/youtube-music/blob/master/.eslintrc.js)
7+
[![Formatted with Biome](https://img.shields.io/badge/Formatted_with-Biome-60a5fa?style=for-the-badge&logo=biome)](https://biomejs.dev/)
88
[![Statut de la construction](https://img.shields.io/github/actions/workflow/status/th-ch/youtube-music/build.yml?branch=master&style=for-the-badge&logo=youtube-music)](https://GitHub.com/th-ch/youtube-music/releases/)
99
[![Toutes les versions GitHub](https://img.shields.io/github/downloads/th-ch/youtube-music/total?style=for-the-badge&logo=youtube-music)](https://GitHub.com/th-ch/youtube-music/releases/)
1010
[![AUR](https://img.shields.io/aur/version/youtube-music-bin?color=blueviolet&style=for-the-badge&logo=youtube-music)](https://aur.archlinux.org/packages/youtube-music-bin)

docs/readme/README-hu.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/th-ch/youtube-music.svg?style=for-the-badge&logo=youtube-music)](https://github.com/th-ch/youtube-music/releases/)
66
[![GitHub license](https://img.shields.io/github/license/th-ch/youtube-music.svg?style=for-the-badge)](https://github.com/th-ch/youtube-music/blob/master/license)
7-
[![eslint code style](https://img.shields.io/badge/code_style-eslint-5ed9c7.svg?style=for-the-badge)](https://github.com/th-ch/youtube-music/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/th-ch/youtube-music/build.yml?branch=master&style=for-the-badge&logo=youtube-music)](https://GitHub.com/th-ch/youtube-music/releases/)
99
[![GitHub All Releases](https://img.shields.io/github/downloads/th-ch/youtube-music/total?style=for-the-badge&logo=youtube-music)](https://GitHub.com/th-ch/youtube-music/releases/)
1010
[![AUR](https://img.shields.io/aur/version/youtube-music-bin?color=blueviolet&style=for-the-badge&logo=youtube-music)](https://aur.archlinux.org/packages/youtube-music-bin)

docs/readme/README-is.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/th-ch/youtube-music.svg?style=for-the-badge&logo=youtube-music)](https://github.com/th-ch/youtube-music/releases/)
66
[![GitHub license](https://img.shields.io/github/license/th-ch/youtube-music.svg?style=for-the-badge)](https://github.com/th-ch/youtube-music/blob/master/license)
7-
[![eslint code style](https://img.shields.io/badge/code_style-eslint-5ed9c7.svg?style=for-the-badge)](https://github.com/th-ch/youtube-music/blob/master/.eslintrc.js)
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/th-ch/youtube-music/build.yml?branch=master&style=for-the-badge&logo=youtube-music)](https://GitHub.com/th-ch/youtube-music/releases/)
99
[![GitHub All Releases](https://img.shields.io/github/downloads/th-ch/youtube-music/total?style=for-the-badge&logo=youtube-music)](https://GitHub.com/th-ch/youtube-music/releases/)
1010
[![AUR](https://img.shields.io/aur/version/youtube-music-bin?color=blueviolet&style=for-the-badge&logo=youtube-music)](https://aur.archlinux.org/packages/youtube-music-bin)

0 commit comments

Comments
 (0)