feat: Introduce biome (#25664)

* Configure biome

* Fix companion build

* fix: remove generated files from formatter ignore list to enable proper formatting

Co-Authored-By: Volnei Munhoz <[email protected]>

* fix: add explicit stripe dependency to @calcom/features to fix type resolution

Co-Authored-By: Volnei Munhoz <[email protected]>

* fix: rename const require to nodeRequire in generate-swagger.ts to avoid TypeScript reserved identifier conflict

Co-Authored-By: Volnei Munhoz <[email protected]>

* fix: add guard for document in makeBodyVisible to prevent test environment teardown errors

Co-Authored-By: Volnei Munhoz <[email protected]>

* fix: replace ESLint with Biome CLI in embed-code-generator.e2e.ts

Co-Authored-By: Volnei Munhoz <[email protected]>

* fix: address cubic review comments

- Fix invalid --reporter-path Biome CLI option by using shell redirection
- Fix packages/lib lint report filename (app-store.json -> lib.json)
- Add typescript-eslint and eslint back to companion for lint:react-compiler
- Add missing restricted import rules to biome.json:
  - packages/lib: add ../trpc/** and @trpc/server restrictions
  - packages/trpc: add ../apps/web/** restriction

Co-Authored-By: Volnei Munhoz <[email protected]>

* chore: regenerate companion bun.lock after adding eslint dependencies

Co-Authored-By: Volnei Munhoz <[email protected]>

* Remove remaining eslint things

* add tailwind directives

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2025-12-29 19:41:41 -03:00
1 parent 96dc3b5cc6
commit 7c373ddad6
80 files changed
+1024 -3946

No files matched your search

-7
View File
@@ -1,7 +0,0 @@
const rootConfig = require("../../../packages/config/prettier-preset");
module.exports = {
...rootConfig,
importOrder: ["^./instrument", ...rootConfig.importOrder],
importOrderParserPlugins: ["typescript", "decorators-legacy"],
};
+2 -5
View File
@@ -7,7 +7,7 @@
"private": true,
"scripts": {
"build": "yarn dev:build && nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"format": "biome format --write src test",
"start": "nest start",
"dev:build:watch": "concurrently --names \"libraries,lru-fix,constants,enums,utils,types\" \"yarn _dev:build:watch:libraries\" \"yarn _dev:build:watch:libraries:lru-fix\" \"yarn _dev:build:watch:constants\" \"yarn _dev:build:watch:enums\" \"yarn _dev:build:watch:utils\" \"yarn _dev:build:watch:types\"",
"_dev:build:watch:libraries": "yarn workspace @calcom/platform-libraries build:watch",
@@ -86,7 +86,7 @@
"zod": "3.25.76"
},
"devDependencies": {
"@calcom/eslint-config": "workspace:*",
"@biomejs/biome": "^2.3.8",
"@golevelup/ts-jest": "0.4.0",
"@nestjs/cli": "10.3.2",
"@nestjs/schematics": "10.1.1",
@@ -98,14 +98,11 @@
"@types/luxon": "3.4.2",
"@types/passport-jwt": "3.0.13",
"@types/supertest": "2.0.16",
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
"concurrently": "9.1.2",
"jest": "29.7.0",
"jest-date-mock": "1.0.10",
"jest-junit": "^16.0.0",
"node-mocks-http": "1.16.2",
"prettier": "2.8.7",
"source-map-support": "0.5.21",
"supertest": "6.3.4",
"ts-jest": "29.1.4",
+7 -3
View File
@@ -2,15 +2,19 @@ import { getEnv } from "@/env";
import { Logger } from "@nestjs/common";
import type { NestExpressApplication } from "@nestjs/platform-express";
import { SwaggerModule, DocumentBuilder } from "@nestjs/swagger";
import {
import type {
PathItemObject,
PathsObject,
OperationObject,
} from "@nestjs/swagger/dist/interfaces/open-api-spec.interface";
import "dotenv/config";
import * as fs from "fs";
import { Server } from "http";
import type { Server } from "http";
import { spawnSync } from "node:child_process";
import { createRequire } from "node:module";
const nodeRequire = createRequire(__filename);
const biomeBin = nodeRequire.resolve("@biomejs/biome/bin/biome");
const HttpMethods: (keyof PathItemObject)[] = ["get", "post", "put", "delete", "patch", "options", "head"];
@@ -28,7 +32,7 @@ export async function generateSwaggerForApp(app: NestExpressApplication<Server>)
if (fs.existsSync(docsOutputFile) && getEnv("NODE_ENV") === "development") {
fs.unlinkSync(docsOutputFile);
fs.writeFileSync(docsOutputFile, stringifiedContents, { encoding: "utf8" });
spawnSync("npx", ["prettier", docsOutputFile, "--write"], { stdio: "inherit" });
spawnSync("node", [biomeBin, "format", "--write", docsOutputFile], { stdio: "inherit" });
}
if (!process.env.DOCS_URL) {