feat: initializes prettier

This commit is contained in:
Dennis Schoepf 2026-02-16 22:01:20 +01:00
parent 51c42eb80d
commit 0c4f160800
10 changed files with 2547 additions and 1484 deletions

View file

@ -101,17 +101,17 @@ import * as React from "react";
```typescript
// Good
interface Props {
title: string;
description?: string;
title: string;
description?: string;
}
function greet(name: string): string {
return `Hello, ${name}`;
return `Hello, ${name}`;
}
// Avoid
function greet(name): any {
return "Hello, " + name;
return "Hello, " + name;
}
```
@ -134,8 +134,8 @@ function greet(name): any {
```astro
---
interface Props {
title: string;
class?: string;
title: string;
class?: string;
}
const { title, class: className } = Astro.props;
@ -144,9 +144,9 @@ const { title, class: className } = Astro.props;
<h1 class={className}>{title}</h1>
<style>
h1 {
color: var(--text-color);
}
h1 {
color: var(--text-color);
}
</style>
```
@ -159,11 +159,11 @@ const { title, class: className } = Astro.props;
```typescript
try {
const data = await fetchData();
return data;
const data = await fetchData();
return data;
} catch (error) {
console.error("Failed to fetch data:", error);
throw new Error(`Data fetch failed: ${error.message}`);
console.error("Failed to fetch data:", error);
throw new Error(`Data fetch failed: ${error.message}`);
}
```
@ -183,7 +183,7 @@ try {
* @returns Formatted date string
*/
function formatDate(date: Date, locale = "en-US"): string {
return date.toLocaleDateString(locale);
return date.toLocaleDateString(locale);
}
```
@ -204,6 +204,7 @@ The Nix shell provides: Node.js, pnpm, Biome, PostgreSQL, and language servers.
## VS Code Integration
Recommended extensions are configured in `.vscode/extensions.json`:
- Astro language support
- Biome for formatting/linting