From armor
Sets up TypeScript projects with oxlint type-aware linting, oxfmt formatting, and strict tsconfig. Detects bun/pnpm/yarn/npm package managers and handles existing tooling.
npx claudepluginhub markacianfrani/armor --plugin armorThis skill uses the workspace's default tool permissions.
You help set up TypeScript projects with standardized tooling: oxlint for linting (with type-aware rules), oxfmt for formatting, and strict TypeScript configuration.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
You help set up TypeScript projects with standardized tooling: oxlint for linting (with type-aware rules), oxfmt for formatting, and strict TypeScript configuration.
Dev dependencies to install:
oxlintoxfmttypescript@j178/prekFirst, assess the current state:
Detect from lockfiles:
bun.lockb or bun.lock → bunpnpm-lock.yaml → pnpmyarn.lock → yarnpackage-lock.json → npmIf no lockfile exists or multiple are present, ask the user which they prefer.
Using the detected package manager:
# bun
bun add -d oxlint oxfmt typescript @j178/prek
# pnpm
pnpm add -D oxlint oxfmt typescript @j178/prek
# yarn
yarn add -D oxlint oxfmt typescript @j178/prek
# npm
npm install -D oxlint oxfmt typescript @j178/prek
Copy configs from the references/ folder:
references/oxlintrc.json → .oxlintrc.jsonreferences/oxfmtrc.json → .oxfmtrc.jsonreferences/tsconfig.json → tsconfig.jsonFor tsconfig, adjust paths and baseUrl based on project structure if needed.
Merge scripts from references/package-scripts.json into the project's package.json.
Adjust the script runner prefix based on package manager:
bun run check, or just bun checkpnpm checknpm run checkIf eslint, prettier, or similar exists, ask the user before removing:
I found existing [eslint/prettier/etc] configuration. Would you like me to:
- Remove it and use oxlint/oxfmt instead
- Keep it alongside the new tooling
- Skip linting/formatting setup
If they choose to remove, delete:
.eslintrc*, eslint.config.*.prettierrc*, prettier.config.*oxlint's type-aware rules require the --tsconfig flag. This is already included in the lint script:
"lint": "oxlint --tsconfig tsconfig.json"
This enables rules like:
typescript/no-floating-promisestypescript/no-misused-promisestypescript/no-unnecessary-type-assertiontypescript/no-unnecessary-conditionThe oxlint config includes complexity guardrails as warnings with high defaults — they're meant to catch egregious cases, not nag on normal code:
| Rule | Default | What it limits |
|---|---|---|
complexity | 20 | Cyclomatic complexity per function |
max-params | 6 | Function parameters |
max-depth | 5 | Block nesting depth |
max-statements | 40 | Statements per function |
max-lines-per-function | 150 | Lines per function (skips blanks + comments) |
max-nested-callbacks | 4 | Nested callback depth |
Test files (__tests__/**, *.test.ts, *.spec.ts) are excluded from max-nested-callbacks, max-statements, and max-lines-per-function since describe/it nesting naturally inflates these.
The formatter config should include:
$schema for editor validationprintWidth, semicolons, quotes, trailing commas, line endings)sortImports: true so formatting keeps import ordering aligned with lintingsortPackageJson: true to use Oxfmt's package.json orderingignorePatterns for common generated output directoriesOxfmt also respects .gitignore, skips node_modules and lockfiles by default, and supports .prettierignore for compatibility. Prefer config-level ignorePatterns for new projects.
Set up prek for pre-commit hooks that run linting and formatting on staged files.
Create prek.toml in the project root:
[[hooks]]
id = "oxlint"
entry = "npx oxlint --tsconfig tsconfig.json"
types = ["ts", "tsx", "js", "jsx"]
[[hooks]]
id = "oxfmt"
entry = "npx oxfmt --check"
types = ["ts", "tsx", "js", "jsx", "json"]
Install the git hooks:
npx prek install
Add a prepare script to package.json so hooks are installed automatically after npm install:
"prepare": "prek install"
After setup, run:
# Type check
<pkg-manager> run check
# Lint
<pkg-manager> run lint
# Format check
<pkg-manager> run format:check
Report any errors to the user - they likely indicate existing code that doesn't meet the stricter standards.