oxlint + Prettier
Overview
Section titled “Overview”This project uses oxlint for fast linting and Prettier for formatting.
Configuration Structure
Section titled “Configuration Structure”packages/oxlint-config/├── base.json # Core rules for all packages├── react.json # React-specific rules└── next.json # Next.js-specific rules
.prettierrc # Prettier configuration (root).prettierignore # Files to ignoreoxlint
Section titled “oxlint”Available Configs
Section titled “Available Configs”| Config | Export | Use For |
|---|---|---|
| Base | @repo/oxlint-config/base | TypeScript packages |
| React | @repo/oxlint-config/react | React libraries |
| Next.js | @repo/oxlint-config/next | Next.js applications |
In package’s package.json:
{ "scripts": { "lint": "oxlint -c @repo/oxlint-config/next" }}Base config enables:
{ "categories": { "correctness": "error", "suspicious": "warn", "perf": "warn" }, "rules": { "no-unused-vars": "warn", "no-console": "warn", "eqeqeq": "error", "no-var": "error", "prefer-const": "warn" }}Ignoring Rules
Section titled “Ignoring Rules”// oxlint-ignore-next-line no-consoleconsole.log("debug")Prettier
Section titled “Prettier”Configuration
Section titled “Configuration”Root .prettierrc:
{ "useTabs": true, "semi": false, "singleQuote": false, "trailingComma": "es5", "printWidth": 100, "plugins": [ "@trivago/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss" ], "importOrder": [ "^react", "^next", "^@?\\w", "^@repo/", "^@/", "^\\./", "^\\.\\./ ], "importOrderSeparation": true}Formatting Rules
Section titled “Formatting Rules”| Setting | Value | Description |
|---|---|---|
useTabs | true | Use tabs for indentation |
semi | false | No semicolons |
singleQuote | false | Use double quotes |
trailingComma | es5 | Trailing commas where valid |
printWidth | 100 | Line width |
Plugins
Section titled “Plugins”- @trivago/prettier-plugin-sort-imports - Auto-sorts imports
- prettier-plugin-tailwindcss - Sorts Tailwind classes
Ignored Files
Section titled “Ignored Files”In .prettierignore:
node_modulesdist.next.turbobun.lockcoverage**/convex/_generated**/next-env.d.tsCommands
Section titled “Commands”# Lint all packagesbun lint
# Lint specific packageturbo lint --filter=web
# Format all filesbun format
# Check formatting (CI)bun format:checkIDE Integration
Section titled “IDE Integration”VS Code
Section titled “VS Code”Install extensions:
Settings:
{ "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": true}