Skip to content

Commit 82db254

Browse files
authored
Replace ESLint with Biome (hestiacp#4889)
1 parent 440932a commit 82db254

File tree

16 files changed

+339
-2029
lines changed

16 files changed

+339
-2029
lines changed

.eslintignore

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

.eslintrc.cjs

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

.github/workflows/lint.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ jobs:
3939
steps:
4040
- name: Checkout code
4141
uses: actions/checkout@v4
42-
with:
43-
repository: ${{ github.event.pull_request.head.repo.full_name }}
44-
ref: ${{ github.event.pull_request.head.ref }}
4542

4643
- name: Setup Node
4744
uses: actions/setup-node@v4
@@ -54,23 +51,18 @@ jobs:
5451
- name: Check formatting
5552
run: npx prettier --check .
5653

57-
eslint:
58-
name: ESLint
54+
biome:
55+
name: Biome
5956
runs-on: ubuntu-latest
6057
steps:
6158
- name: Checkout code
6259
uses: actions/checkout@v4
6360

64-
- name: Setup Node
65-
uses: actions/setup-node@v4
66-
with:
67-
node-version: "lts/*"
68-
69-
- name: Install Node packages
70-
run: npm ci --ignore-scripts
61+
- name: Setup Biome
62+
uses: biomejs/setup-biome@v2
7163

72-
- name: Run ESLint
73-
run: npx eslint .
64+
- name: Run Biome lint
65+
run: biome lint .
7466

7567
stylelint:
7668
name: Stylelint

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,3 @@ web/src/vendor/
4848
# Node
4949
**/node_modules/
5050
npm-debug.log
51-
52-
# optional eslint cache
53-
.eslintcache

.lintstagedrc.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ module.exports = {
33
'*.md': 'markdownlint-cli2 --fix',
44
// Run Stylelint on CSS files
55
'*.css': 'stylelint --fix --allow-empty-input',
6-
// Run ESLint on TS, TSX, JS, JSX files
7-
'*.{ts,js}?(x)': 'eslint --fix',
8-
// Run Prettier everywhere
6+
// Run Biome on TS, TSX, JS, JSX files
7+
'*.{ts,js}?(x)': 'npx @biomejs/biome lint --write --no-errors-on-unmatched',
8+
// Run Prettier where supported
99
'*': 'prettier --write --ignore-unknown',
1010
};

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"editorconfig.editorconfig",
44
"esbenp.prettier-vscode",
55
"DavidAnson.vscode-markdownlint",
6-
"dbaeumer.vscode-eslint",
6+
"biomejs.biome",
77
"stylelint.vscode-stylelint",
88
"timonwong.shellcheck",
99
"mrmlnc.vscode-apache",

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"explorer.fileNesting.patterns": {
88
"*.css": "${capture}.css.map",
99
"*.js": "${capture}.js.map",
10-
"package.json": ".editorconfig, .eslint*, .lintstaged*, .markdownlint-cli2*, .prettier*, .stylelint*, jsconfig.json, package-lock.json, renovate.json",
10+
"package.json": ".editorconfig, .biome*, .lintstaged*, .markdownlint-cli2*, .prettier*, .stylelint*, jsconfig.json, package-lock.json, renovate.json",
1111
"readme*": "changelog*, contributing*, license*, security*"
1212
}
1313
}

biome.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
"**/*.bats",
12+
"./test/test_helper/*",
13+
"**/*.min.css",
14+
"**/*.min.js",
15+
"**/vendor/**",
16+
"**/node_modules/**",
17+
"**/.vitepress/dist/",
18+
"**/.vitepress/cache/",
19+
"./docs/.vitepress/dist/",
20+
"./docs/.vitepress/cache/"
21+
]
22+
},
23+
"formatter": {
24+
"enabled": false,
25+
"useEditorconfig": true
26+
},
27+
"organizeImports": {
28+
"enabled": true
29+
},
30+
"linter": {
31+
"enabled": true,
32+
"rules": {
33+
"recommended": true,
34+
"a11y": {
35+
"useGenericFontNames": "off"
36+
},
37+
"style": {
38+
"noParameterAssign": "off"
39+
},
40+
"complexity": {
41+
"noForEach": "off"
42+
},
43+
"correctness": {
44+
"noUnknownMediaFeatureName": "off"
45+
},
46+
"suspicious": {
47+
"noEmptyBlock": "off",
48+
"noShorthandPropertyOverrides": "off",
49+
"noDoubleEquals": "off"
50+
}
51+
}
52+
},
53+
"javascript": {
54+
"formatter": {
55+
"quoteStyle": "single"
56+
},
57+
"globals": ["Alpine"]
58+
}
59+
}

build.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/* eslint-env node */
2-
/* eslint-disable no-console */
3-
41
// Build JS and CSS using esbuild and Lightning CSS
52
import { promises as fs } from 'node:fs';
63
import path from 'node:path';

docs/.vitepress/theme/components/InstallBuilder.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ watchEffect(() => {
113113
};
114114
for (const [key, { enabled, value }] of Object.entries(selectedOptions.value)) {
115115
const opt = options.find((o) => o.flag === key);
116-
if (opt.flag == "force" && enabled) {
116+
if (opt.flag === "force" && enabled) {
117117
cmd += " --force";
118118
} else if (!opt.type || opt.type === "checkbox") {
119119
if (enabled !== (opt.default === "yes")) {

0 commit comments

Comments
 (0)