feat: integrate Biome for linting and formatting, update package.json and add biome.json

This commit is contained in:
Marco Pedone 2025-08-28 17:11:59 +02:00
parent 750ec05a1e
commit 9185d8ddec
4 changed files with 404 additions and 159 deletions

View file

@ -12,18 +12,10 @@
"password": "rootpost" "password": "rootpost"
} }
], ],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true, "editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit" "source.fixAll.eslint": "explicit",
"source.fixAll.biome": "explicit",
"source.organizeImports.biome": "explicit"
} }
} }

View file

@ -0,0 +1,88 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
"vcs": {
"enabled": true,
"root": "../../",
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"experimentalScannerIgnores": [
"node_modules",
"dist",
"build",
".next",
".git",
"public",
".github",
".vscode",
"certificates",
"headers",
"schemas"
],
"includes": [
"**",
"!node_modules",
"!.git",
"!out",
"!public",
"!.github",
"!.vscode",
"!certificates",
"!.next",
"!.env",
"!.gitignore",
"!check-env-vars.js",
"!headers",
"!schemas",
"!kyselyRules",
"!prettier.config.cjs",
"!postcss.config.cjs",
"!.dockerignore",
"!Dockerfile",
"!*compose.yml",
"!.kanelrc.js",
"!TODO",
"!*.d.ts"
],
"ignoreUnknown": true
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"linter": {
"enabled": true,
"domains": {
"next": "recommended",
"react": "recommended"
},
"rules": {
"recommended": true,
"a11y": {
"noNoninteractiveElementInteractions": "error"
},
"suspicious": {
"noArrayIndexKey": "off"
},
"correctness": {
"useExhaustiveDependencies": "off"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}

View file

@ -89,6 +89,7 @@
"zod": "^4.0.15" "zod": "^4.0.15"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "2.2.2",
"@eslint/compat": "^1.3.1", "@eslint/compat": "^1.3.1",
"@eslint/eslintrc": "^3.3.0", "@eslint/eslintrc": "^3.3.0",
"@eslint/js": "^9.32.0", "@eslint/js": "^9.32.0",
@ -1062,6 +1063,169 @@
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@biomejs/biome": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.2.2.tgz",
"integrity": "sha512-j1omAiQWCkhuLgwpMKisNKnsM6W8Xtt1l0WZmqY/dFj8QPNkIoTvk4tSsi40FaAAkBE1PU0AFG2RWFBWenAn+w==",
"dev": true,
"license": "MIT OR Apache-2.0",
"bin": {
"biome": "bin/biome"
},
"engines": {
"node": ">=14.21.3"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/biome"
},
"optionalDependencies": {
"@biomejs/cli-darwin-arm64": "2.2.2",
"@biomejs/cli-darwin-x64": "2.2.2",
"@biomejs/cli-linux-arm64": "2.2.2",
"@biomejs/cli-linux-arm64-musl": "2.2.2",
"@biomejs/cli-linux-x64": "2.2.2",
"@biomejs/cli-linux-x64-musl": "2.2.2",
"@biomejs/cli-win32-arm64": "2.2.2",
"@biomejs/cli-win32-x64": "2.2.2"
}
},
"node_modules/@biomejs/cli-darwin-arm64": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.2.2.tgz",
"integrity": "sha512-6ePfbCeCPryWu0CXlzsWNZgVz/kBEvHiPyNpmViSt6A2eoDf4kXs3YnwQPzGjy8oBgQulrHcLnJL0nkCh80mlQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@biomejs/cli-darwin-x64": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.2.2.tgz",
"integrity": "sha512-Tn4JmVO+rXsbRslml7FvKaNrlgUeJot++FkvYIhl1OkslVCofAtS35MPlBMhXgKWF9RNr9cwHanrPTUUXcYGag==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@biomejs/cli-linux-arm64": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.2.2.tgz",
"integrity": "sha512-JfrK3gdmWWTh2J5tq/rcWCOsImVyzUnOS2fkjhiYKCQ+v8PqM+du5cfB7G1kXas+7KQeKSWALv18iQqdtIMvzw==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@biomejs/cli-linux-arm64-musl": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.2.2.tgz",
"integrity": "sha512-/MhYg+Bd6renn6i1ylGFL5snYUn/Ct7zoGVKhxnro3bwekiZYE8Kl39BSb0MeuqM+72sThkQv4TnNubU9njQRw==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@biomejs/cli-linux-x64": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.2.2.tgz",
"integrity": "sha512-Ogb+77edO5LEP/xbNicACOWVLt8mgC+E1wmpUakr+O4nKwLt9vXe74YNuT3T1dUBxC/SnrVmlzZFC7kQJEfquQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@biomejs/cli-linux-x64-musl": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.2.2.tgz",
"integrity": "sha512-ZCLXcZvjZKSiRY/cFANKg+z6Fhsf9MHOzj+NrDQcM+LbqYRT97LyCLWy2AS+W2vP+i89RyRM+kbGpUzbRTYWig==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@biomejs/cli-win32-arm64": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.2.2.tgz",
"integrity": "sha512-wBe2wItayw1zvtXysmHJQoQqXlTzHSpQRyPpJKiNIR21HzH/CrZRDFic1C1jDdp+zAPtqhNExa0owKMbNwW9cQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@biomejs/cli-win32-x64": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.2.2.tgz",
"integrity": "sha512-DAuHhHekGfiGb6lCcsT4UyxQmVwQiBCBUMwVra/dcOSs9q8OhfaZgey51MlekT3p8UwRqtXQfFuEJBhJNdLZwg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT OR Apache-2.0",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=14.21.3"
}
},
"node_modules/@date-fns/tz": { "node_modules/@date-fns/tz": {
"version": "1.4.1", "version": "1.4.1",
"resolved": "https://registry.npmjs.org/@date-fns/tz/-/tz-1.4.1.tgz", "resolved": "https://registry.npmjs.org/@date-fns/tz/-/tz-1.4.1.tgz",

View file

@ -1,149 +1,150 @@
{ {
"name": "infoalloggi", "name": "infoalloggi",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "next build", "build": "next build",
"dev": "node ./headers/dev.js && next dev --turbopack", "dev": "node ./headers/dev.js && next dev --turbopack",
"dev-https": "node ./headers/dev-https.js && cross-env NEXT_PUBLIC_BASE_URL='https://localhost:3000' INTERNAL_BASE_URL='https://localhost:3000' next dev --experimental-https --turbopack", "dev-https": "node ./headers/dev-https.js && cross-env NEXT_PUBLIC_BASE_URL='https://localhost:3000' INTERNAL_BASE_URL='https://localhost:3000' next dev --experimental-https --turbopack",
"idev": "cross-env NODE_OPTIONS='--inspect' next dev --turbopack", "idev": "cross-env NODE_OPTIONS='--inspect' next dev --turbopack",
"lint": "node ./headers/lint.js && next lint && node check-env-vars.js", "lint": "node ./headers/lint.js && biome lint && node check-env-vars.js",
"start": "next start", "start": "next start",
"types": "node ./headers/type.js && tsc --noEmit", "types": "node ./headers/type.js && tsc --noEmit",
"pg-typegen": "node ./headers/pg-typegen.js && npx kanel", "pg-typegen": "node ./headers/pg-typegen.js && npx kanel",
"email": "cross-env NEXT_PUBLIC_BASE_URL='https://localhost:3000' email dev --port 3500", "email": "cross-env NEXT_PUBLIC_BASE_URL='https://localhost:3000' email dev --port 3500",
"test": "npm run lint && npm run types", "test": "npm run lint && npm run types",
"knip": "knip --no-exit-code", "knip": "knip --no-exit-code",
"stripe-dev": "stripe listen --forward-to https://localhost:3000/api/stripe-webhook", "stripe-dev": "stripe listen --forward-to https://localhost:3000/api/stripe-webhook",
"d": "npm run-p dev stripe-dev -cl", "d": "npm run-p dev stripe-dev -cl",
"test-kr": "node ./kyselyRules/rules/select.test.js && node ./kyselyRules/rules/where.test.js&& node ./kyselyRules/rules/null.test.js" "test-kr": "node ./kyselyRules/rules/select.test.js && node ./kyselyRules/rules/where.test.js&& node ./kyselyRules/rules/null.test.js"
}, },
"dependencies": { "dependencies": {
"@fattureincloud/fattureincloud-ts-sdk": "^2.1.1", "@fattureincloud/fattureincloud-ts-sdk": "^2.1.1",
"@hookform/resolvers": "^5.2.1", "@hookform/resolvers": "^5.2.1",
"@radix-ui/react-popover": "^1.1.14", "@radix-ui/react-popover": "^1.1.14",
"@radix-ui/react-scroll-area": "^1.2.9", "@radix-ui/react-scroll-area": "^1.2.9",
"@radix-ui/react-slot": "^1.2.3", "@radix-ui/react-slot": "^1.2.3",
"@radix-ui/react-toggle-group": "^1.1.10", "@radix-ui/react-toggle-group": "^1.1.10",
"@react-email/components": "0.5.0", "@react-email/components": "0.5.0",
"@react-email/render": "^1.1.4", "@react-email/render": "^1.1.4",
"@stripe/react-stripe-js": "^3.9.0", "@stripe/react-stripe-js": "^3.9.0",
"@stripe/stripe-js": "^7.8.0", "@stripe/stripe-js": "^7.8.0",
"@tailwindcss/forms": "^0.5.10", "@tailwindcss/forms": "^0.5.10",
"@tailwindcss/postcss": "^4.1.11", "@tailwindcss/postcss": "^4.1.11",
"@tailwindcss/typography": "^0.5.16", "@tailwindcss/typography": "^0.5.16",
"@tanstack/react-query": "^5.74.4", "@tanstack/react-query": "^5.74.4",
"@tanstack/react-table": "^8.21.3", "@tanstack/react-table": "^8.21.3",
"@tanstack/react-virtual": "^3.13.12", "@tanstack/react-virtual": "^3.13.12",
"@tiptap/core": "^3.0.9", "@tiptap/core": "^3.0.9",
"@tiptap/extension-link": "^3.0.9", "@tiptap/extension-link": "^3.0.9",
"@tiptap/extension-underline": "^3.0.9", "@tiptap/extension-underline": "^3.0.9",
"@tiptap/pm": "^3.0.9", "@tiptap/pm": "^3.0.9",
"@tiptap/react": "^3.0.9", "@tiptap/react": "^3.0.9",
"@tiptap/starter-kit": "^3.0.9", "@tiptap/starter-kit": "^3.0.9",
"@trpc/client": "^11.1.0", "@trpc/client": "^11.1.0",
"@trpc/next": "^11.4.3", "@trpc/next": "^11.4.3",
"@trpc/react-query": "^11.1.0", "@trpc/react-query": "^11.1.0",
"@trpc/server": "^11.1.0", "@trpc/server": "^11.1.0",
"@vercel/og": "^0.8.5", "@vercel/og": "^0.8.5",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"cmdk": "^1.1.1", "cmdk": "^1.1.1",
"cookies-next": "^6.1.0", "cookies-next": "^6.1.0",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"embla-carousel-react": "^8.6.0", "embla-carousel-react": "^8.6.0",
"framer-motion": "^12.8.0", "framer-motion": "^12.8.0",
"frimousse": "^0.3.0", "frimousse": "^0.3.0",
"ioredis": "^5.7.0", "ioredis": "^5.7.0",
"jose": "^6.0.12", "jose": "^6.0.12",
"js-cookie": "^3.0.5", "js-cookie": "^3.0.5",
"kysely": "^0.28.2", "kysely": "^0.28.2",
"kysely-plugin-serialize": "^0.8.2", "kysely-plugin-serialize": "^0.8.2",
"leaflet": "^1.9.4", "leaflet": "^1.9.4",
"leaflet-defaulticon-compatibility": "^0.1.2", "leaflet-defaulticon-compatibility": "^0.1.2",
"lucide-react": "^0.536.0", "lucide-react": "^0.536.0",
"next": "15.4.7", "next": "15.4.7",
"next-themes": "^0.4.6", "next-themes": "^0.4.6",
"nextjs-progressbar": "^0.0.16", "nextjs-progressbar": "^0.0.16",
"nodemailer": "^7.0.5", "nodemailer": "^7.0.5",
"nodemailer-html-to-text": "^3.2.0", "nodemailer-html-to-text": "^3.2.0",
"nuqs": "^2.4.3", "nuqs": "^2.4.3",
"pg": "^8.16.3", "pg": "^8.16.3",
"postcss": "^8.5.6", "postcss": "^8.5.6",
"radix-ui": "^1.4.2", "radix-ui": "^1.4.2",
"react": "^19.1.0", "react": "^19.1.0",
"react-colorful": "^5.6.1", "react-colorful": "^5.6.1",
"react-day-picker": "^9.8.1", "react-day-picker": "^9.8.1",
"react-dom": "^19.1.1", "react-dom": "^19.1.1",
"react-email": "^4.2.8", "react-email": "^4.2.8",
"react-hook-form": "^7.62.0", "react-hook-form": "^7.62.0",
"react-hot-toast": "^2.5.2", "react-hot-toast": "^2.5.2",
"react-is": "^19.1.1", "react-is": "^19.1.1",
"react-leaflet": "^5.0.0", "react-leaflet": "^5.0.0",
"react-phone-number-input": "^3.4.12", "react-phone-number-input": "^3.4.12",
"react-reverse-portal": "^2.3.0", "react-reverse-portal": "^2.3.0",
"react-select": "^5.10.2", "react-select": "^5.10.2",
"react-to-print": "^3.1.1", "react-to-print": "^3.1.1",
"react-use": "^17.6.0", "react-use": "^17.6.0",
"recharts": "^2.15.4", "recharts": "^2.15.4",
"sharp": "^0.34.3", "sharp": "^0.34.3",
"stripe": "^18.4.0", "stripe": "^18.4.0",
"superjson": "2.2.2", "superjson": "2.2.2",
"tailwind-merge": "3.3", "tailwind-merge": "3.3",
"tailwind-scrollbar": "^4.0.2", "tailwind-scrollbar": "^4.0.2",
"tailwindcss": "^4.1.11", "tailwindcss": "^4.1.11",
"tw-animate-css": "^1.3.6", "tw-animate-css": "^1.3.6",
"type-fest": "^4.41.0", "type-fest": "^4.41.0",
"uuid": "^11.1.0", "uuid": "^11.1.0",
"vaul": "^1.1.2", "vaul": "^1.1.2",
"yaml": "^2.8.1", "yaml": "^2.8.1",
"zod": "^4.0.15" "zod": "^4.0.15"
}, },
"devDependencies": { "devDependencies": {
"@eslint/compat": "^1.3.1", "@biomejs/biome": "2.2.2",
"@eslint/eslintrc": "^3.3.0", "@eslint/compat": "^1.3.1",
"@eslint/js": "^9.32.0", "@eslint/eslintrc": "^3.3.0",
"@hookform/devtools": "^4.4.0", "@eslint/js": "^9.32.0",
"@next/eslint-plugin-next": "^15.4.5", "@hookform/devtools": "^4.4.0",
"@prettier/sync": "^0.6.1", "@next/eslint-plugin-next": "^15.4.5",
"@react-email/preview-server": "^4.2.8", "@prettier/sync": "^0.6.1",
"@tanstack/eslint-plugin-query": "^5.83.1", "@react-email/preview-server": "^4.2.8",
"@total-typescript/ts-reset": "^0.6.1", "@tanstack/eslint-plugin-query": "^5.83.1",
"@types/eslint": "^9.6.1", "@total-typescript/ts-reset": "^0.6.1",
"@types/eslint-plugin-jsx-a11y": "^6.10.0", "@types/eslint": "^9.6.1",
"@types/js-cookie": "^3.0.6", "@types/eslint-plugin-jsx-a11y": "^6.10.0",
"@types/leaflet": "^1.9.20", "@types/js-cookie": "^3.0.6",
"@types/node": "^24.2.0", "@types/leaflet": "^1.9.20",
"@types/nodemailer": "^6.4.17", "@types/node": "^24.2.0",
"@types/nodemailer-html-to-text": "^3.1.3", "@types/nodemailer": "^6.4.17",
"@types/pg": "^8.15.5", "@types/nodemailer-html-to-text": "^3.1.3",
"@types/react": "^19.1.8", "@types/pg": "^8.15.5",
"@types/react-dom": "^19.1.7", "@types/react": "^19.1.8",
"@types/react-is": "^19.0.0", "@types/react-dom": "^19.1.7",
"@types/uuid": "^10.0.0", "@types/react-is": "^19.0.0",
"@typescript-eslint/eslint-plugin": "^8.39.0", "@types/uuid": "^10.0.0",
"@typescript-eslint/parser": "^8.39.0", "@typescript-eslint/eslint-plugin": "^8.39.0",
"cross-env": "^10.0.0", "@typescript-eslint/parser": "^8.39.0",
"eslint": "^9.32.0", "cross-env": "^10.0.0",
"eslint-config-next": "^15.4.5", "eslint": "^9.32.0",
"eslint-import-resolver-typescript": "^4.4.4", "eslint-config-next": "^15.4.5",
"eslint-plugin-better-tailwindcss": "^3.7.4", "eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.32.0", "eslint-plugin-better-tailwindcss": "^3.7.4",
"eslint-plugin-no-relative-import-paths": "^1.6.1", "eslint-plugin-import": "^2.32.0",
"eslint-plugin-react": "^7.37.5", "eslint-plugin-no-relative-import-paths": "^1.6.1",
"eslint-plugin-react-hooks": "^5.2.0", "eslint-plugin-react": "^7.37.5",
"jiti": "^2.5.1", "eslint-plugin-react-hooks": "^5.2.0",
"kanel": "^3.14.2", "jiti": "^2.5.1",
"kanel-kysely": "^0.7.1", "kanel": "^3.14.2",
"knip": "^5.62.0", "kanel-kysely": "^0.7.1",
"npm-run-all": "^4.1.5", "knip": "^5.62.0",
"prettier": "^3.6.2", "npm-run-all": "^4.1.5",
"prettier-plugin-classnames": "^0.8.2", "prettier": "^3.6.2",
"prettier-plugin-tailwindcss": "^0.6.14", "prettier-plugin-classnames": "^0.8.2",
"typescript": "^5.9.2", "prettier-plugin-tailwindcss": "^0.6.14",
"typescript-eslint": "^8.39.0" "typescript": "^5.9.2",
}, "typescript-eslint": "^8.39.0"
"ct3aMetadata": { },
"initVersion": "7.9.0" "ct3aMetadata": {
} "initVersion": "7.9.0"
}
} }