transitioned from astro to react

This commit is contained in:
Peter Wood
2025-06-04 21:03:32 -04:00
parent 570ed2d1b4
commit 52547578a7
32 changed files with 2631 additions and 4865 deletions

View File

@@ -80,16 +80,56 @@ import { transactionService } from '../../../../data/db.service';
### Enforcing Path Aliases with Biome.js
This project uses [Biome.js](https://biomejs.dev/) for code formatting and linting. Biome enforces the use of path aliases instead of relative imports. To run Biome checks:
This project uses [Biome.js](https://biomejs.dev/) for code formatting and linting. Biome enforces the use of path aliases instead of relative imports.
## Code Quality Tools
This project uses Biome.js for maintaining code quality, formatting, and linting. Biome provides fast, reliable tooling for JavaScript and TypeScript projects.
### Available Commands
#### Quick Commands (via npm scripts):
```bash
# Format all files (fixes formatting only)
npm run format
# Lint all files (shows issues without fixing)
npm run lint
# Check and fix all auto-fixable issues (recommended)
npm run check
```
To automatically fix issues:
#### Direct Biome Commands:
```bash
npm run check -- --apply
# Format with write
npx biome format --write .
# Lint only (no fixes)
npx biome lint .
# Check and apply safe fixes
npx biome check --write .
# Check and apply all fixes (including unsafe ones)
npx biome check --write --unsafe .
```
The Biome configuration (in `biome.json`) includes rules for import sorting and path alias enforcement. To customize the rules, edit the `biome.json` file.
### What Biome.js Enforces:
- **Path Aliases**: Enforces use of `@components/*`, `@types`, etc. instead of relative imports
- **Node.js Import Protocols**: Requires `node:path` instead of `path` for Node.js built-ins
- **Code Formatting**: Consistent indentation, quotes, semicolons, and line width (100 chars)
- **Import Organization**: Automatic sorting and organization of imports
- **TypeScript Best Practices**: Warns about `any` types, unused imports, excessive complexity
### Pre-commit Hooks
This project uses Husky for Git hooks. Biome.js checks run automatically before commits to ensure code quality.
### Configuration
Biome.js configuration is in `biome.json`. Key settings:
- **Formatter**: 2-space indentation, single quotes, 100-character line width
- **Linter**: Recommended rules plus custom rules for path aliases and Node.js protocols
- **Ignored Files**: `dist/`, `node_modules/`, coverage reports