Add useSortedClasses rule to Biome configuration

This commit is contained in:
Aman Varshney
2025-04-04 12:40:46 +05:30
parent 73fc9880cd
commit b3c746cd49
23 changed files with 293 additions and 298 deletions

View File

@@ -7,10 +7,7 @@
"bin": {
"create-better-t-stack": "dist/index.js"
},
"files": [
"dist",
"template"
],
"files": ["template", "dist"],
"keywords": [
"typescript",
"scaffold",

View File

@@ -65,7 +65,7 @@ export async function setupDatabase(
orm === "prisma" &&
setupPrismaPostgresDb
) {
await setupPrismaPostgres(projectDir, true, packageManager);
await setupPrismaPostgres(projectDir, packageManager);
}
}
}

View File

@@ -68,7 +68,7 @@ function getNativeInstructions(): string {
}
function getLintingInstructions(runCmd?: string): string {
return `${pc.bold("\nLinting and formatting:")}\n${pc.cyan("•")} Format and lint fix: ${`${runCmd} check`}\n\n`;
return `${pc.bold("Linting and formatting:")}\n${pc.cyan("•")} Format and lint fix: ${`${runCmd} check`}\n\n`;
}
function getDatabaseInstructions(

View File

@@ -101,21 +101,10 @@ DATABASE_URL="your_database_url"`);
export async function setupPrismaPostgres(
projectDir: string,
shouldSetupPrisma: boolean,
packageManager: ProjectPackageManager = "npm",
) {
const serverDir = path.join(projectDir, "apps/server");
if (!shouldSetupPrisma) {
await writeEnvFile(projectDir);
log.info(
pc.blue(
"Using default Postgres configuration. You'll need to provide your own database.",
),
);
return;
}
try {
const config = await initPrismaDatabase(serverDir, packageManager);

View File

@@ -31,6 +31,15 @@
"recommended": true,
"correctness": {
"useExhaustiveDependencies": "info"
},
"nursery": {
"useSortedClasses": {
"level": "warn",
"fix": "safe",
"options": {
"functions": ["clsx", "cva", "cn"]
}
}
}
}
},