chore: update biome to 2.4.14 & apply lint fixes

This commit is contained in:
M. George Hansen 2026-05-03 09:37:53 -07:00
parent 0e26241e4a
commit f08a99ccb1
Signed by: mgeorgehansen
SSH key fingerprint: SHA256:JlIGiQLPyQ2RHTH3a2oVlb20Xkh9Glr8DUF4YTXHJxM
17 changed files with 491 additions and 461 deletions

View file

@ -1,16 +1,21 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"$schema": "https://biomejs.dev/schemas/2.4.14/schema.json",
"files": {
"includes": ["**", "!dist", "!node_modules", "!.temp"]
},
"assist": {
"enabled": true,
"ignore": ["dist", "node_modules", ".temp"]
"actions": {
"source": {
"organizeImports": "on"
}
}
},
"formatter": {
"enabled": true,
"ignore": ["dist", "node_modules", ".temp"]
"enabled": true
},
"linter": {
"enabled": true,
"ignore": ["dist", "node_modules", ".temp"],
"rules": {
"recommended": true,
"style": {
@ -23,7 +28,7 @@
},
"overrides": [
{
"include": ["test"],
"includes": ["test/**"],
"linter": {
"rules": {
"a11y": {

View file

@ -1,5 +1,9 @@
import { stylesheet } from "typestyle";
import { type Component, createElement } from "websnacks";
import {
type Component,
// biome-ignore lint/correctness/noUnusedImports: required to support JSX
createElement,
} from "websnacks";
const styles = stylesheet({
header: {

View file

@ -1,6 +1,10 @@
import { normalize } from "csstips";
import { stylesheet } from "typestyle";
import { type Component, createElement } from "websnacks";
import {
type Component,
// biome-ignore lint/correctness/noUnusedImports: required to support JSX
createElement,
} from "websnacks";
import { stylesheetPath } from "../config";
import { Header } from "./header";

View file

@ -1,5 +1,9 @@
import { stylesheet } from "typestyle";
import { type Component, createElement } from "websnacks";
import {
type Component,
// biome-ignore lint/correctness/noUnusedImports: required to support JSX
createElement,
} from "websnacks";
const styles = stylesheet({
navbar: {

View file

@ -20,7 +20,7 @@
"websnacks": "bin/websnacks.js"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@biomejs/biome": "2.4.14",
"@types/node": "~18",
"@types/ws": "^7.4.0",
"ts-node": "^10.9.2",

View file

@ -1,4 +1,8 @@
import { type Component, createElement } from "websnacks";
import {
type Component,
// biome-ignore lint/correctness/noUnusedImports: required to support JSX
createElement,
} from "websnacks";
import { Layout } from "../components/layout";

View file

@ -1,5 +1,9 @@
import { stylesheet } from "typestyle";
import { type Component, createElement } from "websnacks";
import {
type Component,
// biome-ignore lint/correctness/noUnusedImports: required to support JSX
createElement,
} from "websnacks";
import { Layout } from "../components/layout";

View file

@ -4,7 +4,7 @@ import type { Config } from "websnacks";
import { stylesheetPath } from "./config";
const config: Config = {
const _config: Config = {
// Watch additional files and folders for changes when the dev server is
// running.
watch: ["components/", "config.ts"],

82
package-lock.json generated
View file

@ -12,7 +12,7 @@
"websnacks": "bin/websnacks.js"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@biomejs/biome": "2.4.14",
"@types/node": "~18",
"@types/ws": "^7.4.0",
"ts-node": "^10.9.2",
@ -27,11 +27,11 @@
}
},
"node_modules/@biomejs/biome": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.8.3.tgz",
"integrity": "sha512-/uUV3MV+vyAczO+vKrPdOW0Iaet7UnJMU4bNMinggGJTAnBPjCoLEYcyYtYHNnUNYlv4xZMH6hVIQCAozq8d5w==",
"version": "2.4.14",
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.4.14.tgz",
"integrity": "sha512-TmAvxOEgrpLypzVGJ8FulIZnlyA9TxrO1hyqYrCz9r+bwma9xXxuLA5IuYnj55XQneFx460KjRbx6SWGLkg3bQ==",
"dev": true,
"hasInstallScript": true,
"license": "MIT OR Apache-2.0",
"bin": {
"biome": "bin/biome"
},
@ -43,24 +43,25 @@
"url": "https://opencollective.com/biome"
},
"optionalDependencies": {
"@biomejs/cli-darwin-arm64": "1.8.3",
"@biomejs/cli-darwin-x64": "1.8.3",
"@biomejs/cli-linux-arm64": "1.8.3",
"@biomejs/cli-linux-arm64-musl": "1.8.3",
"@biomejs/cli-linux-x64": "1.8.3",
"@biomejs/cli-linux-x64-musl": "1.8.3",
"@biomejs/cli-win32-arm64": "1.8.3",
"@biomejs/cli-win32-x64": "1.8.3"
"@biomejs/cli-darwin-arm64": "2.4.14",
"@biomejs/cli-darwin-x64": "2.4.14",
"@biomejs/cli-linux-arm64": "2.4.14",
"@biomejs/cli-linux-arm64-musl": "2.4.14",
"@biomejs/cli-linux-x64": "2.4.14",
"@biomejs/cli-linux-x64-musl": "2.4.14",
"@biomejs/cli-win32-arm64": "2.4.14",
"@biomejs/cli-win32-x64": "2.4.14"
}
},
"node_modules/@biomejs/cli-darwin-arm64": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.8.3.tgz",
"integrity": "sha512-9DYOjclFpKrH/m1Oz75SSExR8VKvNSSsLnVIqdnKexj6NwmiMlKk94Wa1kZEdv6MCOHGHgyyoV57Cw8WzL5n3A==",
"version": "2.4.14",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.4.14.tgz",
"integrity": "sha512-XvgoE9XOawUOQPdmvs4J7wPhi/DLwSCGks3AlPJDmh34O0awRTqCED1HRcRDdpf1Zrp4us4MGOOdIxNpbqNF5Q==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"darwin"
@ -70,13 +71,14 @@
}
},
"node_modules/@biomejs/cli-darwin-x64": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.8.3.tgz",
"integrity": "sha512-UeW44L/AtbmOF7KXLCoM+9PSgPo0IDcyEUfIoOXYeANaNXXf9mLUwV1GeF2OWjyic5zj6CnAJ9uzk2LT3v/wAw==",
"version": "2.4.14",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.4.14.tgz",
"integrity": "sha512-jE7hKBCFhOx3uUh+ZkWBfOHxAcILPfhFplNkuID/eZeSTLHzfZzoZxW8fbqY9xXRnPi7jGNAf1iPVR+0yWsM/Q==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"darwin"
@ -86,13 +88,14 @@
}
},
"node_modules/@biomejs/cli-linux-arm64": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.8.3.tgz",
"integrity": "sha512-fed2ji8s+I/m8upWpTJGanqiJ0rnlHOK3DdxsyVLZQ8ClY6qLuPc9uehCREBifRJLl/iJyQpHIRufLDeotsPtw==",
"version": "2.4.14",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.4.14.tgz",
"integrity": "sha512-2TELhZnW5RSLL063l9rc5xLpA0ZIw0Ccwy/0q384rvNAgFw3yI76bd59547yxowdQr5MNPET/xDLrLuvgSeeWQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"linux"
@ -102,13 +105,14 @@
}
},
"node_modules/@biomejs/cli-linux-arm64-musl": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.8.3.tgz",
"integrity": "sha512-9yjUfOFN7wrYsXt/T/gEWfvVxKlnh3yBpnScw98IF+oOeCYb5/b/+K7YNqKROV2i1DlMjg9g/EcN9wvj+NkMuQ==",
"version": "2.4.14",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.4.14.tgz",
"integrity": "sha512-/z+6gqAqqUQTHazwStxSXKHg9b8UvqBmDFRp+c4wYbq2KXhELQDon9EoC9RpmQ8JWkqQx/lIUy/cs+MhzDZp6A==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"linux"
@ -118,13 +122,14 @@
}
},
"node_modules/@biomejs/cli-linux-x64": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.8.3.tgz",
"integrity": "sha512-I8G2QmuE1teISyT8ie1HXsjFRz9L1m5n83U1O6m30Kw+kPMPSKjag6QGUn+sXT8V+XWIZxFFBoTDEDZW2KPDDw==",
"version": "2.4.14",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.4.14.tgz",
"integrity": "sha512-zHrlQZDBDUz4OLAraYpWKcnLS6HOewBFWYOzY91d1ZjdqZwibOyb6BEu6WuWLugyo0P3riCmsbV9UqV1cSXwQg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"linux"
@ -134,13 +139,14 @@
}
},
"node_modules/@biomejs/cli-linux-x64-musl": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.8.3.tgz",
"integrity": "sha512-UHrGJX7PrKMKzPGoEsooKC9jXJMa28TUSMjcIlbDnIO4EAavCoVmNQaIuUSH0Ls2mpGMwUIf+aZJv657zfWWjA==",
"version": "2.4.14",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.4.14.tgz",
"integrity": "sha512-R6BWgJdQOwW9ulJatuTVrQkjnODjqHZkKNOqb1sz++3Noe5LYd0i3PchnOBUCYAPHoPWHhjJqbdZlHEu0hpjdA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"linux"
@ -150,13 +156,14 @@
}
},
"node_modules/@biomejs/cli-win32-arm64": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.8.3.tgz",
"integrity": "sha512-J+Hu9WvrBevfy06eU1Na0lpc7uR9tibm9maHynLIoAjLZpQU3IW+OKHUtyL8p6/3pT2Ju5t5emReeIS2SAxhkQ==",
"version": "2.4.14",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.4.14.tgz",
"integrity": "sha512-M3EH5hqOI/F/FUA2u4xcLoUgmxd218mvuj/6JL7Hv2toQvr2/AdOvKSpGkoRuWFCtQPVa+ZqkEV3Q5xBA9+XSA==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"win32"
@ -166,13 +173,14 @@
}
},
"node_modules/@biomejs/cli-win32-x64": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.8.3.tgz",
"integrity": "sha512-/PJ59vA1pnQeKahemaQf4Nyj7IKUvGQSc3Ze1uIGi+Wvr1xF7rGobSrAAG01T/gUDG21vkDsZYM03NAmPiVkqg==",
"version": "2.4.14",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.4.14.tgz",
"integrity": "sha512-WL0EG5qE+EAKomGXbf2g6VnSKJhTL3tXC0QRzWRwA5VpjxNYa6H4P7ZWfymbGE4IhZZQi1KXQ2R0YjwInmz2fA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"win32"

View file

@ -36,7 +36,7 @@
"test:e2e": "cd test && ts-node --script-mode ./run-e2e.ts"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@biomejs/biome": "2.4.14",
"@types/node": "~18",
"@types/ws": "^7.4.0",
"ts-node": "^10.9.2",

View file

@ -58,7 +58,7 @@ const copyStaticAssets = async ({
}: ConfigPaths): Promise<void> => {
try {
await fs.access(staticAssetsDir);
} catch (error) {
} catch (_error) {
// Static assets folder doesn't exist, so no-op.
return;
}

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { promises as fs, existsSync, watch } from "node:fs";
import { existsSync, promises as fs, watch } from "node:fs";
import * as http from "node:http";
import * as path from "node:path";
@ -152,7 +152,7 @@ const startHttpServer = async (publicDir: string): Promise<http.Server> => {
let contents: Buffer | string;
try {
contents = await fs.readFile(path.join(publicDir, reqPath));
} catch (error) {
} catch (_error) {
console.error(`unable to load file ${reqPath}`);
res.writeHead(404);
res.end();

View file

@ -66,7 +66,7 @@ export const loadConfig = async (rootDir: string): Promise<Config> => {
decacheModule(configPath);
// TODO: validate user config.
userConfig = await import(configPath);
} catch (error) {
} catch (_error) {
// Use default config;
}
const outDir = path.join(rootDir, "public");

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
export { HTMLElement, Component, Fragment } from "./component";
export { UserConfig as Config, defineConfig } from "./config";
export { Component, Fragment, HTMLElement } from "./component";
export { defineConfig, UserConfig as Config } from "./config";
export { createElement } from "./create-element";
export * from "./jsx";

View file

@ -7,10 +7,10 @@ import { promises as fs } from "node:fs";
import * as path from "node:path";
import {
WEBSNACKS_BIN_PATH,
WEBSNACKS_REPO_ROOT,
npmCmd,
runCommand,
WEBSNACKS_BIN_PATH,
WEBSNACKS_REPO_ROOT,
withTempDir,
} from "../helpers/e2e";
import { testSuite } from "../lib";

View file

@ -7,10 +7,10 @@ import { promises as fs } from "node:fs";
import * as path from "node:path";
import {
WEBSNACKS_BIN_PATH,
WEBSNACKS_REPO_ROOT,
npmCmd,
runCommand,
WEBSNACKS_BIN_PATH,
WEBSNACKS_REPO_ROOT,
wait,
withTempDir,
} from "../helpers/e2e";

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { type Component, Fragment, createElement } from "../../dist";
import { type Component, createElement, Fragment } from "../../dist";
import { renderPage } from "../../dist/render";
import { testSuite } from "../lib";
@ -118,7 +118,6 @@ testSuite("renderPage", ({ test, expect }) => {
const html = renderPage(
<html>
<div
// biome-ignore lint/security/noDangerouslySetInnerHtml: explicit test
dangerouslySetInnerHTML={{
__html: "<div>red alert!</div>",
}}
@ -135,8 +134,6 @@ testSuite("renderPage", ({ test, expect }) => {
renderPage(
<html>
<div
// biome-ignore lint/security/noDangerouslySetInnerHtml: explicit test
// biome-ignore lint/security/noDangerouslySetInnerHtmlWithChildren: explicit test
dangerouslySetInnerHTML={{
__html: "<div>set phasers to kill</div>",
}}