chore: fix biome warnings/errors (#26295)

* Fix icon-names

* make all errors into warns

* Minimal fix to mock
This commit is contained in:
Volnei Munhoz authored and GitHub committed 2025-12-30 11:46:26 +00:00
1 parent e4753778fe
commit c52eff65a2
14 files changed
+246 -217

No files matched your search

@@ -8,15 +8,18 @@ import { TRPCError } from "@trpc/server";
import { defaultResponderForAppDir } from "./defaultResponderForAppDir";
vi.mock("next/server", () => ({
NextRequest: class MockNextRequest {},
NextResponse: {
json: vi.fn((body, init) => ({
json: vi.fn().mockResolvedValue(body),
status: init?.status || 200,
})),
},
}));
vi.mock("next/server", () => {
class MockNextRequest extends Request {}
return {
NextRequest: MockNextRequest,
NextResponse: {
json: vi.fn((body, init) => ({
json: vi.fn().mockResolvedValue(body),
status: init?.status || 200,
})),
},
};
});
describe("defaultResponderForAppDir", () => {
it("should return a JSON response when handler resolves with a result", async () => {
@@ -44,7 +47,9 @@ describe("defaultResponderForAppDir", () => {
});
it("should respond with status code 409 for NoAvailableUsersFound", async () => {
const f = vi.fn().mockRejectedValue(new Error(ErrorCode.NoAvailableUsersFound));
const f = vi
.fn()
.mockRejectedValue(new Error(ErrorCode.NoAvailableUsersFound));
const req = { method: "GET", url: "/api/test" } as unknown as NextRequest;
const params = Promise.resolve<Params>({});
@@ -60,7 +65,9 @@ describe("defaultResponderForAppDir", () => {
});
it("should respond with a 429 status code for rate limit errors", async () => {
const f = vi.fn().mockRejectedValue(new TRPCError({ code: "TOO_MANY_REQUESTS" }));
const f = vi
.fn()
.mockRejectedValue(new TRPCError({ code: "TOO_MANY_REQUESTS" }));
const req = { method: "POST", url: "/api/test" } as unknown as NextRequest;
const params = Promise.resolve<Params>({});
+1
View File
@@ -151,6 +151,7 @@
},
"devDependencies": {
"@babel/core": "7.26.10",
"@biomejs/biome": "2.3.10",
"@calcom/config": "workspace:*",
"@calcom/types": "workspace:*",
"@microsoft/microsoft-graph-types-beta": "0.15.0-preview",
+36 -36
View File
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
"root": true,
"css": {
"parser": {
@@ -21,26 +21,29 @@
"files": {
"includes": [
"**/*",
"!**/node_modules",
"!**/.next",
"!**/.turbo",
"!**/dist",
"!**/build",
"!**/public",
"!public",
"!apps/web/public/embed",
"!packages/prisma/zod",
"!packages/prisma/enums",
"!*.lock",
"!*.log",
"!.gitignore",
"!.npmignore",
"!.prettierignore",
"!.eslintignore",
"!.DS_Store",
"!coverage",
"!lint-results",
"!test-results"
"!!**/node_modules",
"!!**/.next",
"!!**/.turbo",
"!!**/dist",
"!!**/build",
"!!**/public",
"!!public",
"!!apps/web/public/embed",
"!!packages/prisma/zod",
"!!packages/prisma/enums",
"!!*.lock",
"!!*.log",
"!!.gitignore",
"!!.npmignore",
"!!.prettierignore",
"!!.eslintignore",
"!!.DS_Store",
"!!coverage",
"!!lint-results",
"!!test-results",
"!!packages/lib/raqb/resolveQueryValue.test.ts",
"!!packages/ui/components/editor/plugins/ToolbarPlugin.tsx",
"!!packages/embeds/embed-core/src/lib/domUtils.ts"
]
},
"javascript": {
@@ -58,17 +61,14 @@
"enabled": true,
"rules": {
"recommended": true,
"style": {
"useNodejsImportProtocol": "warn"
},
"correctness": {
"noUnusedVariables": {
"level": "warn",
"options": {
"ignoreRestSiblings": true
}
}
}
"correctness": "warn",
"suspicious": "warn",
"complexity": "warn",
"performance": "warn",
"nursery": "warn",
"a11y": "warn",
"style": "warn",
"security": "warn"
}
},
"overrides": [
@@ -78,7 +78,7 @@
"rules": {
"style": {
"noRestrictedImports": {
"level": "error",
"level": "warn",
"options": {
"patterns": [
{
@@ -110,7 +110,7 @@
"rules": {
"style": {
"noRestrictedImports": {
"level": "error",
"level": "warn",
"options": {
"patterns": [
{
@@ -134,7 +134,7 @@
"rules": {
"style": {
"noRestrictedImports": {
"level": "error",
"level": "warn",
"options": {
"patterns": [
{
@@ -154,7 +154,7 @@
"rules": {
"style": {
"noRestrictedImports": {
"level": "error",
"level": "warn",
"options": {
"patterns": [
{
+1
View File
@@ -1,5 +1,6 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
"root": false,
"vcs": {
"enabled": true,
"clientKind": "git",
+1 -2
View File
@@ -5,8 +5,7 @@
"scripts": {
"dev": "PORT=5100 next dev",
"build": "next build",
"start": "next start",
"lint": "biome lint ."
"start": "next start"
},
"dependencies": {
"@calcom/atoms": "workspace:*",
+1 -1
View File
@@ -85,7 +85,7 @@
"lint-staged": "lint-staged"
},
"devDependencies": {
"@biomejs/biome": "^2.3.8",
"@biomejs/biome": "2.3.10",
"@changesets/changelog-github": "0.5.1",
"@changesets/cli": "2.29.4",
"@faker-js/faker": "9.2.0",
+3 -2
View File
@@ -9,8 +9,8 @@
"./hooks/*": "./src/hooks/*.ts"
},
"scripts": {
"lint": "biome lint .",
"lint:fix": "biome lint --write .",
"lint": "biome lint src",
"lint:fix": "biome lint --write src",
"type-check": "tsc --pretty --noEmit",
"type-check:ci": "tsc-absolute --pretty --noEmit",
"registry:pull": "ts-node ../../scripts/pull-coss-ui-components.ts"
@@ -27,6 +27,7 @@
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"@biomejs/biome": "2.3.10",
"ts-node": "10.9.2",
"tsc-absolute": "1.0.0",
"typescript": "5.9.0-beta"
+1
View File
@@ -41,6 +41,7 @@
"dist"
],
"devDependencies": {
"@biomejs/biome": "2.3.10",
"@playwright/test": "1.57.0",
"@tailwindcss/cli": "4.1.16",
"@tailwindcss/postcss": "4.1.15",
+1
View File
@@ -30,6 +30,7 @@
"uuid": "8.3.2"
},
"devDependencies": {
"@biomejs/biome": "2.3.10",
"@calcom/tsconfig": "workspace:*",
"@calcom/types": "workspace:*",
"@faker-js/faker": "7.6.0",
@@ -7,7 +7,6 @@
"dev": "PORT=4321 next dev",
"build": "next build",
"start": "next start",
"lint": "biome lint .",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui"
},
+1
View File
@@ -30,6 +30,7 @@
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"@biomejs/biome": "2.3.10",
"@tanstack/react-query": "5.17.19",
"@types/cookie": "0.6.0",
"@types/uuid": "8.3.4",
+155 -155
View File
@@ -2,158 +2,158 @@
export type IconName =
| "activity"
| "arrow-down"
| "arrow-left"
| "arrow-right"
| "arrow-up-right"
| "arrow-up"
| "asterisk"
| "at-sign"
| "atom"
| "badge-check"
| "ban"
| "bell"
| "binary"
| "blocks"
| "bold"
| "book-open-check"
| "book-open"
| "book-user"
| "book"
| "bookmark"
| "building"
| "calendar-check-2"
| "calendar-days"
| "calendar-heart"
| "calendar-range"
| "calendar-search"
| "calendar-x-2"
| "calendar"
| "chart-bar"
| "chart-line"
| "check-check"
| "check"
| "chevron-down"
| "chevron-left"
| "chevron-right"
| "chevron-up"
| "chevrons-down-up"
| "chevrons-left"
| "chevrons-right"
| "chevrons-up-down"
| "circle-alert"
| "circle-arrow-up"
| "circle-check-big"
| "circle-check"
| "circle-help"
| "circle-plus"
| "circle-x"
| "circle"
| "clipboard-check"
| "clipboard"
| "clock"
| "code"
| "columns-3"
| "command"
| "contact"
| "copy"
| "corner-down-left"
| "corner-down-right"
| "credit-card"
| "disc"
| "dot"
| "download"
| "ellipsis-vertical"
| "ellipsis"
| "external-link"
| "eye-off"
| "eye"
| "file-down"
| "file-text"
| "file"
| "filter"
| "fingerprint"
| "flag"
| "folder"
| "gift"
| "git-merge"
| "github"
| "globe"
| "grid-3x3"
| "handshake"
| "info"
| "italic"
| "key"
| "layers"
| "layout-dashboard"
| "link-2"
| "link"
| "list-filter"
| "loader"
| "lock-open"
| "lock"
| "log-out"
| "mail-open"
| "mail"
| "map-pin"
| "map"
| "menu"
| "message-circle"
| "messages-square"
| "mic-off"
| "mic"
| "monitor"
| "moon"
| "paintbrush"
| "paperclip"
| "pause"
| "pencil"
| "phone-call"
| "phone-incoming"
| "phone-off"
| "phone-outgoing"
| "phone"
| "play"
| "plus"
| "refresh-ccw"
| "refresh-cw"
| "repeat"
| "rocket"
| "rotate-ccw"
| "rotate-cw"
| "search"
| "send"
| "settings"
| "share-2"
| "shield-check"
| "shield"
| "shuffle"
| "sliders-horizontal"
| "sliders-vertical"
| "smartphone"
| "sparkles"
| "split"
| "square-check"
| "square-pen"
| "star"
| "sun"
| "sunrise"
| "sunset"
| "tags"
| "terminal"
| "trash-2"
| "trash"
| "trello"
| "triangle-alert"
| "upload"
| "user-check"
| "user-plus"
| "user-x"
| "user"
| "users"
| "venetian-mask"
| "video"
| "waypoints"
| "webhook"
| "x"
| "zap";
| "arrow-down"
| "arrow-left"
| "arrow-right"
| "arrow-up-right"
| "arrow-up"
| "asterisk"
| "at-sign"
| "atom"
| "badge-check"
| "ban"
| "bell"
| "binary"
| "blocks"
| "bold"
| "book-open-check"
| "book-open"
| "book-user"
| "book"
| "bookmark"
| "building"
| "calendar-check-2"
| "calendar-days"
| "calendar-heart"
| "calendar-range"
| "calendar-search"
| "calendar-x-2"
| "calendar"
| "chart-bar"
| "chart-line"
| "check-check"
| "check"
| "chevron-down"
| "chevron-left"
| "chevron-right"
| "chevron-up"
| "chevrons-down-up"
| "chevrons-left"
| "chevrons-right"
| "chevrons-up-down"
| "circle-alert"
| "circle-arrow-up"
| "circle-check-big"
| "circle-check"
| "circle-help"
| "circle-plus"
| "circle-x"
| "circle"
| "clipboard-check"
| "clipboard"
| "clock"
| "code"
| "columns-3"
| "command"
| "contact"
| "copy"
| "corner-down-left"
| "corner-down-right"
| "credit-card"
| "disc"
| "dot"
| "download"
| "ellipsis-vertical"
| "ellipsis"
| "external-link"
| "eye-off"
| "eye"
| "file-down"
| "file-text"
| "file"
| "filter"
| "fingerprint"
| "flag"
| "folder"
| "gift"
| "git-merge"
| "github"
| "globe"
| "grid-3x3"
| "handshake"
| "info"
| "italic"
| "key"
| "layers"
| "layout-dashboard"
| "link-2"
| "link"
| "list-filter"
| "loader"
| "lock-open"
| "lock"
| "log-out"
| "mail-open"
| "mail"
| "map-pin"
| "map"
| "menu"
| "message-circle"
| "messages-square"
| "mic-off"
| "mic"
| "monitor"
| "moon"
| "paintbrush"
| "paperclip"
| "pause"
| "pencil"
| "phone-call"
| "phone-incoming"
| "phone-off"
| "phone-outgoing"
| "phone"
| "play"
| "plus"
| "refresh-ccw"
| "refresh-cw"
| "repeat"
| "rocket"
| "rotate-ccw"
| "rotate-cw"
| "search"
| "send"
| "settings"
| "share-2"
| "shield-check"
| "shield"
| "shuffle"
| "sliders-horizontal"
| "sliders-vertical"
| "smartphone"
| "sparkles"
| "split"
| "square-check"
| "square-pen"
| "star"
| "sun"
| "sunrise"
| "sunset"
| "tags"
| "terminal"
| "trash-2"
| "trash"
| "trello"
| "triangle-alert"
| "upload"
| "user-check"
| "user-plus"
| "user-x"
| "user"
| "users"
| "venetian-mask"
| "video"
| "waypoints"
| "webhook"
| "x"
| "zap";
+20 -7
View File
@@ -32,13 +32,21 @@ async function generateIconFiles() {
const spriteFilepath = path.join(outputDir, "sprite.svg");
const typeOutputFilepath = path.join(typesDir, "icon-names.ts");
const currentSprite = await fsExtra.readFile(spriteFilepath, "utf8").catch(() => "");
const currentTypes = await fsExtra.readFile(typeOutputFilepath, "utf8").catch(() => "");
const currentSprite = await fsExtra
.readFile(spriteFilepath, "utf8")
.catch(() => "");
const currentTypes = await fsExtra
.readFile(typeOutputFilepath, "utf8")
.catch(() => "");
const iconNames = files.map((file) => iconName(file));
const spriteUpToDate = iconNames.every((name) => currentSprite.includes(`id=${name}`));
const typesUpToDate = iconNames.every((name) => currentTypes.includes(`"${name}"`));
const spriteUpToDate = iconNames.every((name) =>
currentSprite.includes(`id=${name}`)
);
const typesUpToDate = iconNames.every((name) =>
currentTypes.includes(`"${name}"`)
);
if (spriteUpToDate && typesUpToDate) {
logVerbose(`Icons are up to date`);
@@ -63,9 +71,12 @@ async function generateIconFiles() {
const typeOutputContent = `// This file is generated by yarn run build:icons
export type IconName =
\t| ${stringifiedIconNames.join("\n\t| ")};
\t| ${stringifiedIconNames.join("\n | ")};
`;
const typesChanged = await writeIfChanged(typeOutputFilepath, typeOutputContent);
const typesChanged = await writeIfChanged(
typeOutputFilepath,
typeOutputContent
);
logVerbose(`Manifest saved to ${path.relative(cwd, typeOutputFilepath)}`);
@@ -119,7 +130,9 @@ async function generateSvgSprite({ files, inputDir, outputPath }) {
}
async function writeIfChanged(filepath, newContent) {
const currentContent = await fsExtra.readFile(filepath, "utf8").catch(() => "");
const currentContent = await fsExtra
.readFile(filepath, "utf8")
.catch(() => "");
if (currentContent === newContent) return false;
await fsExtra.writeFile(filepath, newContent, "utf8");
await $`node ${biomeBin} format --write ${filepath}`;
+7 -2
View File
@@ -1605,7 +1605,7 @@ __metadata:
languageName: node
linkType: hard
"@biomejs/biome@npm:^2.3.8":
"@biomejs/biome@npm:2.3.10, @biomejs/biome@npm:^2.3.8":
version: 2.3.10
resolution: "@biomejs/biome@npm:2.3.10"
dependencies:
@@ -2376,6 +2376,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@calcom/embed-core@workspace:packages/embeds/embed-core"
dependencies:
"@biomejs/biome": "npm:2.3.10"
"@playwright/test": "npm:1.57.0"
"@tailwindcss/cli": "npm:4.1.16"
"@tailwindcss/postcss": "npm:4.1.15"
@@ -2767,6 +2768,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@calcom/lib@workspace:packages/lib"
dependencies:
"@biomejs/biome": "npm:2.3.10"
"@calcom/config": "workspace:*"
"@calcom/dayjs": "workspace:*"
"@calcom/tsconfig": "workspace:*"
@@ -3251,6 +3253,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@calcom/trpc@workspace:packages/trpc"
dependencies:
"@biomejs/biome": "npm:2.3.10"
"@tanstack/react-query": "npm:5.17.19"
"@trpc/client": "npm:11.0.0-next-beta.222"
"@trpc/next": "npm:11.0.0-next-beta.222"
@@ -3403,6 +3406,7 @@ __metadata:
resolution: "@calcom/web@workspace:apps/web"
dependencies:
"@babel/core": "npm:7.26.10"
"@biomejs/biome": "npm:2.3.10"
"@boxyhq/saml-jackson": "npm:1.52.2"
"@calcom/app-store": "workspace:*"
"@calcom/app-store-cli": "workspace:*"
@@ -3980,6 +3984,7 @@ __metadata:
resolution: "@coss/ui@workspace:packages/coss-ui"
dependencies:
"@base-ui/react": "npm:1.0.0"
"@biomejs/biome": "npm:2.3.10"
class-variance-authority: "npm:0.7.1"
clsx: "npm:2.1.1"
lucide-react: "npm:0.555.0"
@@ -18758,7 +18763,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "calcom-monorepo@workspace:."
dependencies:
"@biomejs/biome": "npm:^2.3.8"
"@biomejs/biome": "npm:2.3.10"
"@changesets/changelog-github": "npm:0.5.1"
"@changesets/cli": "npm:2.29.4"
"@faker-js/faker": "npm:9.2.0"