Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 2.48 KB

File metadata and controls

59 lines (43 loc) · 2.48 KB

MDSIG Frontend — Agent Guide

MDSIG is a community sharing platform for Mingdao High School students and teachers to exchange ideas and insights.

Commands

pnpm install       # Install dependencies
pnpm dev           # Dev server (DO NOT use for build verification)
pnpm build         # Production build (USE THIS for build verification)
pnpm types         # Type check only (no emit)
pnpm check:fix     # Biome auto-fix (safe fixes only)

Code Style Rules (Biome)

Run pnpm check after every change. All generated code must follow these rules (enforced by Biome via biome.json):

Formatting

  • Use 2 spaces for indentation, never tabs
  • Keep lines within 80 characters
  • Always end statements with a semicolon
  • Use double quotes for strings and JSX attributes
  • Always include trailing commas in JS/TS (but never in JSON)
  • Always wrap arrow function parameters in parentheses: (x) => x
  • Include spaces inside braces: { value }

Code You Must Write

  • Always use block statements ({}) with if, else, for, while — no single-line bodies
  • Use for...of instead of .forEach() for iteration
  • Use console.error, console.warn, console.info, or console.assert only — never bare console.log
  • Keep Tailwind CSS class names sorted (Biome enforces useSortedClasses)

Code You Must Avoid

  • Do NOT leave unused imports or unused variables — remove them
  • Do NOT use array index as React key when a stable identifier is available
  • Do NOT leave empty block statements ({}) — add a comment or remove the block
  • Do NOT write else after return/break/continue — use early return instead
  • Avoid any type — use a specific type whenever possible

Rules That Are NOT Enforced

These rules are intentionally off — do not "fix" code to satisfy them:

  • useImportType — using import instead of import type is fine
  • useExhaustiveDependencies — React hook dependency arrays are not auto-checked
  • noInferrableTypes — explicit type annotations on inferred values are allowed
  • noStaticElementInteractions, noSvgWithoutTitle, useKeyWithClickEvents — a11y rules are off

Docs