931 B
931 B
description, globs, trigger
| description | globs | trigger |
|---|---|---|
| TypeScript and ESM coding conventions for seal-use codebase | src/**/*.ts | manual |
TypeScript & ESM Conventions
When modifying or adding TypeScript files in src/:
-
Module System & Import Extensions:
- Use ES modules exclusively.
- Local file imports MUST include explicit
.jsextensions (e.g.import { foo } from "./bar.js").
-
Validation & Typing:
- Validate external inputs, environment variables, and API responses with Zod or narrow TypeScript types.
- Avoid
any. Prefer precise domain types.
-
Code Style:
- 2-space indentation.
- Double quotes (
"). - Omitted trailing semicolons where possible.
camelCasefor functions/variables,PascalCasefor classes/types/interfaces.- Kebab-case filenames (e.g.
token-store.ts).
-
Architecture:
- Prefer small, cohesive domain functions over large generic utility files.