Skip to content

Commit accdcb8

Browse files
chore: upgrade biome to v2 (#19362)
Guide for migration: https://biomejs.dev/guides/upgrade-to-biome-v2/
1 parent 167522e commit accdcb8

File tree

455 files changed

+1687
-1703
lines changed

Some content is hidden

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

455 files changed

+1687
-1703
lines changed

.github/workflows/typos.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ HELO = "HELO"
2828
LKE = "LKE"
2929
byt = "byt"
3030
typ = "typ"
31+
Inferrable = "Inferrable"
3132

3233
[files]
3334
extend-exclude = [
@@ -47,5 +48,5 @@ extend-exclude = [
4748
"provisioner/terraform/testdata/**",
4849
# notifications' golden files confuse the detector because of quoted-printable encoding
4950
"coderd/notifications/testdata/**",
50-
"agent/agentcontainers/testdata/devcontainercli/**"
51+
"agent/agentcontainers/testdata/devcontainercli/**",
5152
]

.vscode/settings.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"[javascript][javascriptreact][json][jsonc][typescript][typescriptreact]": {
5050
"editor.defaultFormatter": "biomejs.biome",
5151
"editor.codeActionsOnSave": {
52-
"quickfix.biome": "explicit"
52+
"source.fixAll.biome": "explicit"
5353
// "source.organizeImports.biome": "explicit"
5454
}
5555
},
@@ -60,5 +60,7 @@
6060
"typos.config": ".github/workflows/typos.toml",
6161
"[markdown]": {
6262
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
63-
}
63+
},
64+
"biome.configurationPath": "./site/biome.jsonc",
65+
"biome.lsp.bin": "./site/node_modules/.bin/biome"
6466
}

site/.storybook/preview.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import CssBaseline from "@mui/material/CssBaseline";
2222
import {
2323
ThemeProvider as MuiThemeProvider,
2424
StyledEngineProvider,
25-
// biome-ignore lint/nursery/noRestrictedImports: we extend the MUI theme
25+
// biome-ignore lint/style/noRestrictedImports: we extend the MUI theme
2626
} from "@mui/material/styles";
2727
import { DecoratorHelpers } from "@storybook/addon-themes";
2828
import isChromatic from "chromatic/isChromatic";

site/biome.jsonc

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,44 @@
11
{
22
"vcs": {
33
"enabled": true,
4-
"useIgnoreFile": true,
54
"clientKind": "git",
65
"root": ".."
76
},
87
"files": {
9-
"ignore": ["e2e/**/*Generated.ts", "pnpm-lock.yaml"],
8+
"includes": ["**", "!**/e2e/**/*Generated.ts", "!**/pnpm-lock.yaml"],
109
"ignoreUnknown": true
1110
},
1211
"linter": {
1312
"rules": {
1413
"a11y": {
15-
"noSvgWithoutTitle": { "level": "off" },
16-
"useButtonType": { "level": "off" },
17-
"useSemanticElements": { "level": "off" }
14+
"noSvgWithoutTitle": "off",
15+
"useButtonType": "off",
16+
"useSemanticElements": "off",
17+
"noStaticElementInteractions": "off"
1818
},
1919
"correctness": {
20-
"noUnusedImports": "warn"
20+
"noUnusedImports": "warn",
21+
"useUniqueElementIds": "off", // TODO: This is new but we want to fix it
22+
"noNestedComponentDefinitions": "off", // TODO: Investigate, since it is used by shadcn components
23+
"noUnusedVariables": {
24+
"level": "warn",
25+
"options": {
26+
"ignoreRestSiblings": true
27+
}
28+
}
2129
},
2230
"style": {
23-
"noNonNullAssertion": { "level": "off" },
24-
"noParameterAssign": { "level": "off" },
25-
"useDefaultParameterLast": { "level": "off" },
26-
"useSelfClosingElements": { "level": "off" }
27-
},
28-
"suspicious": {
29-
"noArrayIndexKey": { "level": "off" },
30-
"noConsoleLog": { "level": "error" },
31-
"noThenProperty": { "level": "off" }
32-
},
33-
"nursery": {
31+
"noNonNullAssertion": "off",
32+
"noParameterAssign": "off",
33+
"useDefaultParameterLast": "off",
34+
"useSelfClosingElements": "off",
35+
"useAsConstAssertion": "error",
36+
"useEnumInitializers": "error",
37+
"useSingleVarDeclarator": "error",
38+
"noUnusedTemplateLiteral": "error",
39+
"useNumberNamespace": "error",
40+
"noInferrableTypes": "error",
41+
"noUselessElse": "error",
3442
"noRestrictedImports": {
3543
"level": "error",
3644
"options": {
@@ -47,8 +55,22 @@
4755
}
4856
}
4957
}
58+
},
59+
"suspicious": {
60+
"noArrayIndexKey": "off",
61+
"noThenProperty": "off",
62+
"noTemplateCurlyInString": "off",
63+
"useIterableCallbackReturn": "off",
64+
"noUnknownAtRules": "off", // Allow Tailwind directives
65+
"noConsole": {
66+
"level": "error",
67+
"options": { "allow": ["error", "info", "warn"] }
68+
}
69+
},
70+
"complexity": {
71+
"noImportantStyles": "off" // TODO: check and fix !important styles
5072
}
5173
}
5274
},
53-
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json"
75+
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json"
5476
}

site/e2e/api.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import relativeTime from "dayjs/plugin/relativeTime";
88

99
dayjs.extend(duration);
1010
dayjs.extend(relativeTime);
11+
1112
import { humanDuration } from "utils/time";
1213
import { coderPort, defaultPassword } from "./constants";
13-
import { type LoginOptions, findSessionToken, randomName } from "./helpers";
14+
import { findSessionToken, type LoginOptions, randomName } from "./helpers";
1415

1516
let currentOrgId: string;
1617

@@ -57,7 +58,7 @@ export const createOrganizationMember = async ({
5758
password = defaultPassword,
5859
orgRoles,
5960
}: CreateOrganizationMemberOptions): Promise<LoginOptions> => {
60-
const name = randomName();
61+
const _name = randomName();
6162
const user = await API.createUser({
6263
email,
6364
username,

site/e2e/expectUrl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Page, expect } from "@playwright/test";
1+
import { expect, type Page } from "@playwright/test";
22

33
type PollingOptions = { timeout?: number; intervals?: number[] };
44

site/e2e/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto";
33
import net from "node:net";
44
import path from "node:path";
55
import { Duplex } from "node:stream";
6-
import { type BrowserContext, type Page, expect, test } from "@playwright/test";
6+
import { type BrowserContext, expect, type Page, test } from "@playwright/test";
77
import { API } from "api/api";
88
import type {
99
UpdateTemplateMeta,
@@ -29,8 +29,8 @@ import { expectUrl } from "./expectUrl";
2929
import {
3030
Agent,
3131
type App,
32-
AppSharingLevel,
3332
type ApplyComplete,
33+
AppSharingLevel,
3434
type ExternalAuthProviderResource,
3535
type ParseComplete,
3636
type PlanComplete,

site/e2e/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as path from "node:path";
22
import { defineConfig } from "@playwright/test";
33
import {
4-
coderPort,
54
coderdPProfPort,
5+
coderPort,
66
e2eFakeExperiment1,
77
e2eFakeExperiment2,
88
gitAuth,

site/e2e/tests/app.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test("app", async ({ context, page }) => {
2121
const appContent = "Hello World";
2222
const token = randomUUID();
2323
const srv = http
24-
.createServer((req, res) => {
24+
.createServer((_req, res) => {
2525
res.writeHead(200, { "Content-Type": "text/plain" });
2626
res.end(appContent);
2727
})

site/e2e/tests/auditLogs.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Page, expect, test } from "@playwright/test";
1+
import { expect, type Page, test } from "@playwright/test";
22
import { defaultPassword, users } from "../constants";
33
import {
44
createTemplate,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy