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:Configuration
Package Scripts
Defined inpackage.json:
web/package.json
Oxlint Configuration (Optional)
By default, oxlint uses sensible defaults. Create an.oxlintrc.json file only if you need custom rules:
.oxlintrc.json
The starter does not include an
.oxlintrc.json by default. Oxlint works great with zero configuration.Linting
Run Linter
Common Rules
Oxlint enforces best practices:- TypeScript
- React
- Code Quality
- No unused variables
- Explicit function return types (strict mode)
- Consistent type imports
- No
anytype without explicit annotation
Disabling Rules
Disable specific rules with comments:Formatting
Run Formatter
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
- Before
- After
Editor Integration
VS Code
Install the oxc extension:- Install oxc-vscode
- Add to
.vscode/settings.json:
.vscode/settings.json
Other Editors
Oxc supports:- Neovim: oxc.nvim
- Zed: Built-in support
- Sublime Text: Via LSP
Pre-commit Hooks
Run linting and formatting before commits:
Now linting and formatting run automatically on staged files before each commit.
CI Integration
Add linting to your CI pipeline:.github/workflows/lint.yml
Comparison: Oxlint vs ESLint
- Performance
- Features
- Migration
| Tool | Time (1000 files) | Speed |
|---|---|---|
| ESLint | ~30s | Baseline |
| Oxlint | ~0.3s | 100x 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
Oxlint not finding files
Oxlint not finding files
By default, oxlint checks all
.ts, .tsx, .js, .jsx files. If files are missing:Formatting conflicts with editor
Formatting conflicts with editor
Make sure your editor is using oxfmt, not Prettier or another formatter:
.vscode/settings.json
Pre-commit hook not running
Pre-commit hook not running
Ensure husky is initialized:
Next Steps
Testing
Add tests to complement linting
Project Structure
Organize code following conventions
Oxc Docs
Official Oxc documentation