Getting Started
What should I work on?
Start with:- Browse good first issues
- Look for issues labeled
help wanted - Ask for guidance on Discord
- Review existing PRs to understand the codebase
Do I need to know Rust?
Yes, most of Oxc is written in Rust. However, you can also contribute to:- Documentation improvements
- Test cases
- NAPI bindings (TypeScript/JavaScript)
- Issue triage and discussion
How do I set up my development environment?
Follow the Getting Started guide:Development Workflow
What does just ready do?
The just ready command runs all checks that CI will run:
- Checking for uncommitted changes
- Installing dependencies
- Running spell checker (
typos) - Regenerating linter rules (
cargo lintgen) - Formatting code (
just fmt) - Running cargo check
- Running all tests
- Running linter
- Building documentation
- Updating AST generated files
just ready before submitting a PR.
When should I run cargo lintgen?
Run cargo lintgen after:
- Adding a new linter rule
- Modifying rule metadata (name, category, etc.)
- Changing rule registration
When should I run just ast?
Run just ast after modifying:
- AST definitions in
oxc_ast - AST-related macros
- Visitor generation code
How do I update snapshots?
Usecargo insta for snapshot testing:
Testing
How do I run tests for a specific crate?
How do I run a specific test?
How do I see test output?
Add-- --nocapture to see println! and eprintln! output:
Where are conformance tests?
Conformance tests use external test suites:- Test262:
tasks/coverage/test262/ - Babel:
tasks/coverage/babel/ - TypeScript:
tasks/coverage/typescript/ - Prettier:
tasks/prettier_conformance/prettier/
How do I add a parser test?
Add test files to:tasks/coverage/misc/pass/- Should parse successfullytasks/coverage/misc/fail/- Should fail to parse
Linter Rules
How do I create a new linter rule?
Use the rule generator:Where do I add linter rule tests?
Tests are co-located with the rule incrates/oxc_linter/src/rules/<plugin>/<rule>.rs.
Add test cases in the #[test] function:
How do I update rule tests from ESLint?
What are rule categories?
correctness- Code that is definitely wrongsuspicious- Code that is likely wrongpedantic- Opinionated style choicesrestriction- Banned patterns (opt-in)style- Code style improvementsperf- Performance improvements
Common Issues
just ast fails on first run
Try running with JS generators disabled first:
Build fails with “submodule not found”
Update submodules:Tests pass locally but fail in CI
Ensure you’ve run all checks:- Snapshots are committed
- All tests pass including conformance tests
- Code is formatted with
just fmt - No clippy warnings
cargo insta review shows unexpected changes
This usually means:
- You changed test behavior (expected)
- You introduced a regression (review carefully)
- Snapshots are out of date (run tests first)
NAPI tests fail
Ensure NAPI packages are built:Memory or performance issues
Oxc is designed for performance. If you encounter issues:- Use the arena allocator for AST allocations
- Avoid unnecessary cloning
- Use
CompactStringfor short strings - Profile with
cargo flamegraph - Ask for help on Discord
Code Style
How should I format my code?
Runjust fmt which runs:
.rustfmt.toml and .prettierrc.
How do I fix clippy warnings?
What naming conventions should I follow?
- Rust: Follow Rust naming conventions
- Types:
PascalCase - Functions/variables:
snake_case - Constants:
SCREAMING_SNAKE_CASE
- Types:
- JavaScript/TypeScript: Follow standard JavaScript conventions
- camelCase for variables and functions
- PascalCase for classes and types
Performance
How do I benchmark my changes?
How do I check minifier size impact?
How do I check parser allocations?
Git and Pull Requests
What should my commit messages look like?
Follow conventional commits:When should I squash commits?
Maintainers will typically squash on merge. You don’t need to squash during development unless:- You have many WIP commits
- Maintainers request it
- You want a cleaner history
How do I resolve merge conflicts?
Rebase on main:AI Usage
Should I disclose AI usage?
Yes. Our AI Usage Policy requires:- Disclosing AI tool usage in PRs
- Taking full responsibility for AI-generated code
- Thoroughly reviewing and testing AI output
Can I use AI tools?
Yes, but:- You must disclose their use
- You are responsible for all generated code
- Code must meet Oxc’s quality and performance standards
- AI-generated code should be reviewed and understood before submission
Community
Where can I get help?
- Discord server - Real-time chat
- GitHub Discussions - Long-form discussions
- GitHub Issues - Bug reports and feature requests
How can I stay updated?
- Watch the GitHub repository
- Join the Discord server
- Follow the Changelog
- Read the Maintenance Guide
How do I report a bug?
- Search existing issues
- Create a new issue with:
- Clear description
- Minimal reproduction
- Expected vs actual behavior
- Oxc version
- System information
How do I request a feature?
- Search existing discussions
- Open a discussion explaining:
- Use case
- Expected behavior
- Why it would benefit Oxc
- Wait for feedback before implementing
Architecture
What is the arena allocator?
Theoxc_allocator crate provides arena-based memory management:
- All AST nodes are allocated in a single arena
- Eliminates reference counting overhead
- Improves performance through better cache locality
- See Architecture for details
What is the visitor pattern?
Oxc uses the visitor pattern for AST traversal:- Visitor traits are automatically generated
- Type-safe traversal of AST nodes
- Used by linter, transformer, and other tools
- See Adding Rules for examples
How is Oxc different from ESTree?
Oxc AST has distinct types instead of ambiguous nodes:BindingIdentifiervsIdentifierReferencevsIdentifierName- Better type safety
- Closer to ECMAScript specification
- See Architecture for details
Troubleshooting
Command not found: just
Install just:
Command not found: pnpm
Install pnpm:
Rust version too old
Update Rust:Tests are slow
Conformance tests can be slow. Run specific tests:Out of disk space
Clean build artifacts:Still Have Questions?
If your question isn’t answered here:- Check the Getting Started guide
- Review the Architecture documentation
- Read the Testing guide
- Ask on Discord
- Open a GitHub Discussion