Skip to content

chore: upgrade biome to v2 #19362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: several improvements
  • Loading branch information
BrunoQuaresma committed Aug 14, 2025
commit dd92ca2b9406d97f35e4ca9ab0f84175ae3c10f4
3 changes: 2 additions & 1 deletion .github/workflows/typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ HELO = "HELO"
LKE = "LKE"
byt = "byt"
typ = "typ"
Inferrable = "Inferrable"

[files]
extend-exclude = [
Expand All @@ -47,5 +48,5 @@ extend-exclude = [
"provisioner/terraform/testdata/**",
# notifications' golden files confuse the detector because of quoted-printable encoding
"coderd/notifications/testdata/**",
"agent/agentcontainers/testdata/devcontainercli/**"
"agent/agentcontainers/testdata/devcontainercli/**",
]
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"[javascript][javascriptreact][json][jsonc][typescript][typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit"
"source.fixAll.biome": "explicit"
// "source.organizeImports.biome": "explicit"
}
},
Expand All @@ -60,5 +60,7 @@
"typos.config": ".github/workflows/typos.toml",
"[markdown]": {
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
}
},
"biome.configurationPath": "./site/biome.jsonc",
"biome.lsp.bin": "./site/node_modules/.bin/biome"
}
44 changes: 30 additions & 14 deletions site/biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"vcs": {
"enabled": true,
"useIgnoreFile": true,
"clientKind": "git",
"root": ".."
},
Expand All @@ -12,18 +11,27 @@
"linter": {
"rules": {
"a11y": {
"noSvgWithoutTitle": { "level": "off" },
"useButtonType": { "level": "off" },
"useSemanticElements": { "level": "off" }
"noSvgWithoutTitle": "off",
"useButtonType": "off",
"useSemanticElements": "off",
"noStaticElementInteractions": "off"
},
"correctness": {
"noUnusedImports": "warn"
"noUnusedImports": "warn",
"useUniqueElementIds": "off", // TODO: This is new but we want to fix it
"noNestedComponentDefinitions": "off", // TODO: Investigate, since it is used by shadcn components
"noUnusedVariables": {
"level": "warn",
"options": {
"ignoreRestSiblings": true
}
}
},
"style": {
"noNonNullAssertion": { "level": "off" },
"noParameterAssign": { "level": "off" },
"useDefaultParameterLast": { "level": "off" },
"useSelfClosingElements": { "level": "off" },
"noNonNullAssertion": "off",
"noParameterAssign": "off",
"useDefaultParameterLast": "off",
"useSelfClosingElements": "off",
"useAsConstAssertion": "error",
"useEnumInitializers": "error",
"useSingleVarDeclarator": "error",
Expand All @@ -49,12 +57,20 @@
}
},
"suspicious": {
"noArrayIndexKey": { "level": "off" },
"noThenProperty": { "level": "off" },
"noConsole": { "level": "error", "options": { "allow": ["log"] } }
"noArrayIndexKey": "off",
"noThenProperty": "off",
"noTemplateCurlyInString": "off",
"useIterableCallbackReturn": "off",
"noUnknownAtRules": "off", // Allow Tailwind directives
"noConsole": {
"level": "error",
"options": { "allow": ["error", "info", "warn"] }
}
},
"nursery": {}
"complexity": {
"noImportantStyles": "off" // TODO: check and fix !important styles
}
}
},
"$schema": "https://biomejs.dev/schemas/2.0.6/schema.json"
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json"
}
2 changes: 1 addition & 1 deletion site/e2e/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const createOrganizationMember = async ({
password = defaultPassword,
orgRoles,
}: CreateOrganizationMemberOptions): Promise<LoginOptions> => {
const name = randomName();
const _name = randomName();
const user = await API.createUser({
email,
username,
Expand Down
2 changes: 1 addition & 1 deletion site/e2e/tests/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test("app", async ({ context, page }) => {
const appContent = "Hello World";
const token = randomUUID();
const srv = http
.createServer((req, res) => {
.createServer((_req, res) => {
res.writeHead(200, { "Content-Type": "text/plain" });
res.end(appContent);
})
Expand Down
12 changes: 6 additions & 6 deletions site/e2e/tests/externalAuth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ test.describe.skip("externalAuth", () => {
const srv = await createServer(gitAuth.webPort);

// The GitHub validate endpoint returns the currently authenticated user!
srv.use(gitAuth.validatePath, (req, res) => {
srv.use(gitAuth.validatePath, (_req, res) => {
res.write(JSON.stringify(ghUser));
res.end();
});
srv.use(gitAuth.tokenPath, (req, res) => {
srv.use(gitAuth.tokenPath, (_req, res) => {
const r = (Math.random() + 1).toString(36).substring(7);
res.write(JSON.stringify({ access_token: r }));
res.end();
Expand Down Expand Up @@ -51,15 +51,15 @@ test.describe.skip("externalAuth", () => {

// Start a server to mock the GitHub API.
const srv = await createServer(gitAuth.devicePort);
srv.use(gitAuth.validatePath, (req, res) => {
srv.use(gitAuth.validatePath, (_req, res) => {
res.write(JSON.stringify(ghUser));
res.end();
});
srv.use(gitAuth.codePath, (req, res) => {
srv.use(gitAuth.codePath, (_req, res) => {
res.write(JSON.stringify(device));
res.end();
});
srv.use(gitAuth.installationsPath, (req, res) => {
srv.use(gitAuth.installationsPath, (_req, res) => {
res.write(JSON.stringify(ghInstall));
res.end();
});
Expand All @@ -72,7 +72,7 @@ test.describe.skip("externalAuth", () => {
// First we send a result from the API that the token hasn't been
// authorized yet to ensure the UI reacts properly.
const sentPending = new Awaiter();
srv.use(gitAuth.tokenPath, (req, res) => {
srv.use(gitAuth.tokenPath, (_req, res) => {
res.write(JSON.stringify(token));
res.end();
sentPending.done();
Expand Down
2 changes: 1 addition & 1 deletion site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"yup": "1.6.1"
},
"devDependencies": {
"@biomejs/biome": "2.0.6",
"@biomejs/biome": "2.2.0",
"@chromatic-com/storybook": "4.0.1",
"@octokit/types": "12.3.0",
"@playwright/test": "1.47.0",
Expand Down
82 changes: 41 additions & 41 deletions site/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion site/src/components/ActiveUserChart/ActiveUserChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const ActiveUserChart: FC<ActiveUserChartProps> = ({ data }) => {
const item = p[0];
return `${item.value} active users`;
}}
formatter={(v, n, item) => {
formatter={(_v, _n, item) => {
const date = new Date(item.payload.date);
return date.toLocaleString(undefined, {
month: "long",
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Chart/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export const ChartTooltipContent = React.forwardRef<
);
ChartTooltipContent.displayName = "ChartTooltip";

const ChartLegend = RechartsPrimitive.Legend;
const _ChartLegend = RechartsPrimitive.Legend;

const ChartLegendContent = React.forwardRef<
HTMLDivElement,
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/Command/Command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const Command = forwardRef<
/>
));

const CommandDialog: FC<DialogProps> = ({ children, ...props }) => {
const _CommandDialog: FC<DialogProps> = ({ children, ...props }) => {
return (
<Dialog {...props}>
<DialogContent className="overflow-hidden p-0">
Expand Down Expand Up @@ -132,7 +132,7 @@ export const CommandItem = forwardRef<
/>
));

const CommandShortcut = ({
const _CommandShortcut = ({
className,
...props
}: React.HTMLAttributes<HTMLSpanElement>) => {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const DialogTrigger = DialogPrimitive.Trigger;

const DialogPortal = DialogPrimitive.Portal;

const DialogClose = DialogPrimitive.Close;
const _DialogClose = DialogPrimitive.Close;

const DialogOverlay = forwardRef<
ElementRef<typeof DialogPrimitive.Overlay>,
Expand Down
Loading
Loading