Skip to main content

Biome configuration

Biovity uses Biome for fast, consistent linting and formatting across the codebase.

Configuration overview

Biome is configured in biome.json with the following settings:
{
  "formatter": {
    "lineWidth": 100,
    "indentStyle": "space",
    "lineEnding": "lf"
  },
  "javascript": {
    "formatter": {
      "quoteStyle": "double",
      "semicolons": "asNeeded",
      "trailingCommas": "es5",
      "arrowParentheses": "always"
    }
  },
  "linter": {
    "rules": {
      "recommended": true,
      "a11y": { "recommended": true },
      "correctness": {
        "useHookAtTopLevel": "error",
        "useExhaustiveDependencies": "warn"
      }
    }
  }
}

Available commands

bun lint            # Run Biome linter
bun format          # Format code with Biome
bun check           # Lint and auto-fix issues

Key formatting rules

  • Line width: 100 characters maximum
  • Quotes: Double quotes for strings and JSX
  • Semicolons: Only when needed (ASI-compatible)
  • Trailing commas: ES5 style (arrays, objects)
  • Arrow functions: Always use parentheses around parameters

TypeScript conventions

Biovity enforces strict TypeScript patterns for type safety and maintainability.

Strict mode

All TypeScript files must:
  • Define explicit types for function parameters and return values
  • Avoid any types (configured as error in Biome)
  • Use type inference where appropriate for variables
const formatSalary = (amount: number, currency: string): string => {
  return `${currency} ${amount.toLocaleString()}`
}

interface JobCardProps {
  title: string
  company: string
  location: string
  onApply: () => void
}

Type organization

Types are organized in lib/types/ by feature:
// lib/types/trabajos.ts
export type ModalidadTrabajo = "remoto" | "hibrido" | "presencial"
export type FormatoTrabajo = "full-time" | "part-time" | "contrato"

export interface Trabajo {
  id: string
  titulo: string
  empresa: string
  modalidad: ModalidadTrabajo
  formato: FormatoTrabajo
  fechaPublicacion: Date
}

Naming conventions

Functions and constants

Prefer const arrow functions over function declarations:
const handleSubmit = (event: React.FormEvent) => {
  event.preventDefault()
  // handle form submission
}

const toggle = () => {
  setIsOpen(!isOpen)
}

Event handlers

Always prefix event handler functions with handle:
const handleClick = () => { /* ... */ }
const handleSubmit = () => { /* ... */ }
const handleKeyDown = (e: React.KeyboardEvent) => { /* ... */ }
const handleChange = (value: string) => { /* ... */ }

Descriptive names

Use clear, descriptive names for variables and functions:
const filteredJobs = jobs.filter((job) => job.modalidad === "remoto")
const isUserAuthenticated = session?.user !== null
const fetchUserApplications = async (userId: string) => { /* ... */ }

Code patterns

Early returns

Use early returns for better readability:
const JobCard = ({ job }: JobCardProps) => {
  if (!job) return null
  if (job.archived) return <ArchivedJobCard job={job} />

  return (
    <div className="job-card">
      <h3>{job.titulo}</h3>
      <p>{job.empresa}</p>
    </div>
  )
}

Accessibility

Always include accessibility attributes:
<button
  onClick={handleClick}
  onKeyDown={handleKeyDown}
  aria-label="Apply to job"
  tabIndex={0}
>
  Apply Now
</button>

Commit conventions

Biovity follows Conventional Commits format:
<type>(<scope>): <description>

[optional body]

[optional footer]

Commit types

  • feat: New feature
  • fix: Bug fix
  • hotfix: Critical production fix
  • design: UI/UX changes
  • refactor: Code refactoring
  • docs: Documentation changes
  • test: Adding or updating tests
  • chore: Maintenance tasks
  • perf: Performance improvements
  • style: Code formatting
  • ci: CI/CD changes

Examples

feat(dashboard): implement metrics chart
fix(auth): resolve session expiry issue
design(landing): improve hero responsive layout
refactor(components): extract animation logic to hook

Commit guidelines

  1. Use imperative mood (“add” not “added” or “adding”)
  2. Keep first line under 72 characters
  3. Be specific in the description
  4. Reference issues with Closes #123 or Fixes #456
  5. Mark breaking changes with BREAKING CHANGE: in footer
feat(search): add salary range filter

Implements advanced filter that allows users to search
jobs by minimum and maximum salary range.

Closes #123

Branch conventions

Branch names follow this pattern:
<type>/<short-description>

Branch types

  • feat/ - New features
  • fix/ - Bug fixes
  • hotfix/ - Critical production fixes
  • design/ - Design/UI changes
  • refactor/ - Code refactoring
  • docs/ - Documentation
  • test/ - Test changes
  • chore/ - Maintenance tasks

Examples

feat/user-dashboard-metrics
fix/header-scroll-behavior
design/landing-hero-animation
refactor/auth-middleware-cleanup

Build docs developers (and LLMs) love