---
name: javascript-typescript-development
description: JS/TS ecosystem defaults and workflows using bun for runtime/packaging and biome for linting/formatting
permalink: opencode-config/skills/javascript-typescript-development/skill
---

# JavaScript / TypeScript Development

Load this skill when a repo or lane involves JS/TS code (presence of `package.json`, `tsconfig.json`, or `.ts`/`.tsx`/`.js`/`.jsx` files as primary source).

## Defaults

| Concern | Tool | Notes |
| --- | --- | --- |
| Runtime + package manager | `bun` | Replaces node+npm/yarn/pnpm for most tasks |
| Linting + formatting | `biome` | Replaces eslint+prettier |
| Test runner | `bun test` | Built-in; use vitest/jest only if repo already configures them |
| Type checking | `tsc --noEmit` | Always run before completion claims |

## Core Workflow

1. **Bootstrap** — `bun install` to install dependencies.
2. **Lint** — `bunx biome check .` before committing.
3. **Format** — `bunx biome format . --write` (or `--check` in CI).
4. **Test** — `bun test` with the repo's existing config. Follow TDD default policy.
5. **Add dependencies** — `bun add <pkg>` (runtime) or `bun add -D <pkg>` (dev).
6. **Type check** — `bunx tsc --noEmit` for TS repos.

## Conventions

- Prefer `biome.json` for lint/format config. Do not add `.eslintrc` or `.prettierrc` unless the repo already uses them.
- Use `bun run <script>` to invoke `package.json` scripts.
- Prefer ES modules (`"type": "module"` in `package.json`).
- Pin Node/Bun version via `.node-version` or `package.json` `engines` when deploying.

## Docker Integration

When the repo runs JS/TS inside Docker, use `oven/bun` as the base image. Mount a named volume for `node_modules` or use `bun install --frozen-lockfile` in CI builds.

## Red Flags

- Using `npm`/`yarn`/`pnpm` when `bun` is available and the project uses it.
- Running `eslint` or `prettier` when `biome` is configured.
- Missing `bun.lockb` after dependency changes.
- Skipping `tsc --noEmit` in TypeScript repos.
