Skip to main content
The web app uses oxlint and oxfmt for fast, reliable linting and formatting with minimal configuration.

Why Oxlint?

Blazingly Fast

50-100x faster than ESLintWritten in Rust for maximum performance

Zero Config

Works out of the boxSensible defaults for modern JS/TS

ESLint Compatible

Implements popular ESLint rulesFamiliar rule names and configs

Built for Bun

Native Bun integrationNo Node.js dependencies

Quick Start

Linting and formatting are pre-configured in the starter:
# Lint all files
bun lint

# Format all files
bun format

Configuration

Package Scripts

Defined in package.json:
web/package.json
{
  "scripts": {
    "lint": "oxlint",
    "format": "oxfmt"
  },
  "devDependencies": {
    "oxlint": "^1.43.0",
    "oxfmt": "^0.28.0"
  }
}

Oxlint Configuration (Optional)

By default, oxlint uses sensible defaults. Create an .oxlintrc.json file only if you need custom rules:
.oxlintrc.json
{
  "rules": {
    "no-console": "warn",
    "no-debugger": "error",
    "eqeqeq": "error"
  }
}
The starter does not include an .oxlintrc.json by default. Oxlint works great with zero configuration.

Linting

Run Linter

# Check for issues
bun lint

# Lint specific files
bun lint components/ui/button.tsx

# Lint with auto-fix (when available)
bun lint --fix

Common Rules

Oxlint enforces best practices:
  • No unused variables
  • Explicit function return types (strict mode)
  • Consistent type imports
  • No any type without explicit annotation

Disabling Rules

Disable specific rules with comments:
// Disable for next line
// oxlint-disable-next-line no-console
console.log('Debug info');

// Disable for entire file
// oxlint-disable no-console

// Disable multiple rules
// oxlint-disable-next-line no-console, no-debugger
console.log('Debug');
debugger;
Use disable comments sparingly. If you find yourself disabling the same rule frequently, consider adjusting your configuration.

Formatting

Run Formatter

# Format all files
bun format

# Format specific files
bun format components/ui/button.tsx

# Check formatting without changing files
bun format --check

Formatting Rules

Oxfmt applies consistent style:
  • Indentation: 2 spaces
  • Quotes: Double quotes for JSX, single for JS/TS
  • Semicolons: Always
  • Trailing commas: ES5 (objects, arrays)
  • Line length: 100 characters (soft limit)
  • Arrow functions: Parentheses when needed
const Button = ({ variant, children }) => {
  return (
    <button className={cn('base', variant === 'primary' && 'primary')}>
      {children}
    </button>
  )
}

Editor Integration

VS Code

Install the oxc extension:
  1. Install oxc-vscode
  2. Add to .vscode/settings.json:
.vscode/settings.json
{
  "editor.defaultFormatter": "oxc.oxc-vscode",
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.oxc": true
  },
  "[typescript]": {
    "editor.defaultFormatter": "oxc.oxc-vscode"
  },
  "[typescriptreact]": {
    "editor.defaultFormatter": "oxc.oxc-vscode"
  }
}
Format on save keeps your code consistent without thinking about it.

Other Editors

Oxc supports:
  • Neovim: oxc.nvim
  • Zed: Built-in support
  • Sublime Text: Via LSP

Pre-commit Hooks

Run linting and formatting before commits:
1

Install husky

bun add -d husky lint-staged
2

Initialize husky

bunx husky init
3

Configure lint-staged

package.json
{
  "lint-staged": {
    "*.{ts,tsx}": [
      "oxlint --fix",
      "oxfmt"
    ]
  }
}
4

Add pre-commit hook

.husky/pre-commit
#!/bin/sh
bunx lint-staged
Now linting and formatting run automatically on staged files before each commit.

CI Integration

Add linting to your CI pipeline:
.github/workflows/lint.yml
name: Lint

on: [push, pull_request]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: oven-sh/setup-bun@v1
      
      - name: Install dependencies
        run: bun install
        working-directory: web
      
      - name: Run linter
        run: bun lint
        working-directory: web
      
      - name: Check formatting
        run: bun format --check
        working-directory: web

Comparison: Oxlint vs ESLint

ToolTime (1000 files)Speed
ESLint~30sBaseline
Oxlint~0.3s100x faster

Best Practices

Run Before Commit

Use pre-commit hooks to catch issues early

Format on Save

Enable auto-formatting in your editor

Fail CI on Errors

Don’t merge code with linting errors

Keep Config Minimal

Trust the defaults, customize only when needed

Troubleshooting

By default, oxlint checks all .ts, .tsx, .js, .jsx files. If files are missing:
# Specify file patterns
bun lint "**/*.{ts,tsx}"

# Check ignore patterns
cat .gitignore
Make sure your editor is using oxfmt, not Prettier or another formatter:
.vscode/settings.json
{
  "editor.defaultFormatter": "oxc.oxc-vscode"
}
Ensure husky is initialized:
bunx husky init
chmod +x .husky/pre-commit

Next Steps

Testing

Add tests to complement linting

Project Structure

Organize code following conventions

Oxc Docs

Official Oxc documentation

Build docs developers (and LLMs) love