[ t128n ]

One hundred years' progress of the United States, Brockett, Linus Pierpont et al., 1871.

Code Formatting Guidelines

The formatting rules I use across my projects.

Consistent formatting removes noise from code review and keeps a codebase readable as it grows. These are the rules I’ve settled on across my projects, using oxfmt as the formatter.

Quick Start

oxfmt.config.ts
import { defineConfig } from "oxfmt";
// https://t128n.dev/writing/code-formatting-guidelines
export default defineConfig({
printWidth: 80,
useTabs: true,
tabWidth: 4,
semi: true,
singleQuote: false,
trailingComma: "all",
sortImports: {},
sortPackageJson: {},
sortTailwindcss: {},
ignorePatterns: ["**/*.mdc", "content/**/*.md"],
});

Rules

Formatting

Indentation

Sorting

Ignored Paths