| name | jterrazz-codestyle |
| description | Use when linting, formatting, type-checking, or detecting unused code. Covers oxlint/oxfmt config presets, `codestyle check`/`codestyle fix`, knip setup, and hexagonal architecture enforcement. |
@jterrazz/codestyle
Part of the @jterrazz ecosystem. Defines how all projects lint and format.
Opinionated linting + formatting + type checking + unused code detection. Runs tsgo, oxlint, oxfmt, and knip in parallel.
Commands
codestyle check
codestyle fix
Setup
npm install @jterrazz/codestyle
oxlint.config.ts — pick a preset:
import { defineConfig } from 'oxlint';
import { oxlint } from '@jterrazz/codestyle';
export default defineConfig({ extends: [oxlint.node] });
oxfmt.config.ts:
import { defineConfig } from 'oxfmt';
import { oxfmt } from '@jterrazz/codestyle';
export default defineConfig(oxfmt);
package.json scripts:
{
"lint": "codestyle check",
"lint:fix": "codestyle fix"
}
Presets
| Preset | Use case |
|---|
oxlint.node | Node.js — requires .js imports |
oxlint.next | Next.js |
oxlint.expo | Expo / React Native |
oxlint.hexagonal | Hexagonal architecture (additive) |
Architecture enforcement (optional)
Add hexagonal architecture boundary rules:
import { defineConfig } from 'oxlint';
import { oxlint } from '@jterrazz/codestyle';
export default defineConfig({
extends: [oxlint.node, oxlint.hexagonal],
});
Rules enforced:
domain/ cannot import from other layers
application/ cannot import infrastructure
presentation/ui/ cannot import navigation
features/ cannot import other features
What runs
| Tool | Purpose | Language |
|---|
| tsgo | Type checking | Go |
| oxlint | Linting | Rust |
| oxfmt | Formatting | Rust |
| knip | Unused code analysis | Node |
Formatting rules
- 100 char print width
- 4-space indentation
- Single quotes
- Trailing commas
- Semicolons
- LF line endings
Always
- Run
codestyle fix before committing, not just codestyle check
- Never disable rules inline without a comment explaining why
- Sorting is enforced by perfectionist plugin — imports, types, object keys