Skip to content

Commit b0efbc7

Browse files
authored
javascript: Fix and extend Biome configuration (#786)
1 parent e66fd63 commit b0efbc7

54 files changed

Lines changed: 183 additions & 199 deletions

File tree

Some content is hidden

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

.eslintrc.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ rules:
4242
array-callback-return: [error] # https://eslint.org/docs/latest/rules/array-callback-return
4343
no-duplicate-imports: [error] # https://eslint.org/docs/latest/rules/no-duplicate-imports
4444
no-new-native-nonconstructor: [error] # https://eslint.org/docs/latest/rules/no-new-native-nonconstructor
45-
# TODO: log and logError
4645
no-restricted-globals: # https://eslint.org/docs/rules/no-restricted-globals
4746
- error
4847
- window
@@ -54,8 +53,8 @@ rules:
5453
no-unused-vars: # https://eslint.org/docs/latest/rules/no-unused-vars
5554
- error
5655
- vars: all
57-
args: none
58-
ignoreRestSiblings: false
56+
args: all
57+
argsIgnorePattern: "^_"
5958

6059
# Suggestions
6160
# https://eslint.org/docs/latest/rules/#suggestions

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ setup:
99
flatpak-builder --ccache --force-clean --stop-at=gi-docgen flatpak build-aux/re.sonny.Workbench.Devel.json
1010

1111
lint:
12-
# ESLint
12+
# JavaScript
1313
./node_modules/.bin/eslint --max-warnings=0 src
14+
./build-aux/fun biome ci --config-path=src/langs/javascript/ src/Library/demos/
1415
# rustfmt
1516
./build-aux/fun rustfmt --check --edition 2021 src/**/*.rs
1617
# black

build-aux/modules/biome.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
"type": "file",
88
"dest-filename": "biome",
99
"only-arches": ["aarch64"],
10-
"url": "https://github.com/biomejs/biome/releases/download/cli%2Fv1.0.0/biome-linux-arm64",
11-
"sha256": "debedada2fdb265020c986fce38fad4eb0dcd2ca09fb4d5d387bdb90bba2044a"
10+
"url": "https://github.com/biomejs/biome/releases/download/cli%2Fv1.3.3/biome-linux-arm64",
11+
"sha256": "3eac5c42c21f330a77f194ad10fd9cfa3e627512d999124405fb9e033223b6eb"
1212
},
1313
{
1414
"type": "file",
1515
"dest-filename": "biome",
1616
"only-arches": ["x86_64"],
17-
"url": "https://github.com/biomejs/biome/releases/download/cli%2Fv1.0.0/biome-linux-x64",
18-
"sha256": "c5aab82e7c18b706826238f4c1178de67479a004e72682afaa16f03f95864038"
17+
"url": "https://github.com/biomejs/biome/releases/download/cli%2Fv1.3.3/biome-linux-x64",
18+
"sha256": "f15e955a935ec1e255a626c4501048612a271539483f76d8d392b0cc7e80b42a"
1919
}
2020
]
2121
}

data/app.gschema.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
<key name="color-scheme" type="i">
1010
<default>0</default>
1111
</key>
12-
<key name="migrated" type="b">
13-
<default>false</default>
14-
</key>
1512
<key name="recent-code-language" type="i">
1613
<default>0</default>
1714
</key>

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
"lint-staged": {
2727
"*.{css,json,md,yaml,yml}": "prettier --write",
2828
"*.{js,cjs,mjs}": "eslint --fix",
29+
"src/Library/demos/**/*.{js,cjs,mjs}": [
30+
"./build-aux/fun biome check --apply-unsafe --config-path=src/langs/javascript/"
31+
],
2932
"*.py": "./build-aux/fun black",
3033
"*.rs": "./build-aux/fun rustfmt --edition 2021",
3134
"*.blp": "./build-aux/fun blueprint-compiler format --fix"

src/Document.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async function saveSourceBuffer({ source_file, buffer }) {
6363
}
6464
}
6565

66-
async function loadSourceBuffer({ source_file, buffer, lang }) {
66+
async function loadSourceBuffer({ source_file, buffer }) {
6767
const file_loader = new Source.FileLoader({
6868
buffer,
6969
file: source_file,

src/Library/demos/About Window/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { gettext as _ } from "gettext";
12
import Adw from "gi://Adw";
23
import Gtk from "gi://Gtk";
3-
import { gettext as _ } from "gettext";
44

55
const parent = workbench.window;
66
const button = workbench.builder.get_object("button");

src/Library/demos/Accessibility/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ clicker.connect("released", () => toggleButton(button));
99
button.add_controller(clicker);
1010

1111
const key_controller = new Gtk.EventControllerKey();
12-
key_controller.connect("key-released", (controller, keyval) => {
12+
key_controller.connect("key-released", (_controller, keyval) => {
1313
const keyvals = [
1414
Gdk.KEY_space,
1515
Gdk.KEY_KP_Space,

src/Library/demos/Account/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import Gdk from "gi://Gdk";
2+
import Gio from "gi://Gio";
13
import Xdp from "gi://Xdp";
24
import XdpGtk from "gi://XdpGtk4";
3-
import Gio from "gi://Gio";
4-
import Gdk from "gi://Gdk";
55

66
Gio._promisify(
77
Xdp.Portal.prototype,

src/Library/demos/Actions/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Gio from "gi://Gio";
21
import GLib from "gi://GLib";
2+
import Gio from "gi://Gio";
33

44
const demo = workbench.builder.get_object("demo");
55

0 commit comments

Comments
 (0)