No description
Find a file
2023-03-14 10:42:18 +08:00
.cargo chore: use sparse crates.io registry 2023-03-10 11:09:44 -08:00
.github/workflows fix: fix clippy warnings 2023-03-12 21:53:08 +08:00
benchmark chore: update benchmark with more eslint rules, remove Rome 2023-03-14 08:26:30 +08:00
crates feat(linter): check duplicated bound names in ImportDeclaration 2023-03-14 10:42:18 +08:00
npm/oxc release: v0.0.1 2023-03-12 13:22:19 +08:00
tasks feat(linter): check duplicated bound names in ImportDeclaration 2023-03-14 10:42:18 +08:00
.gitignore ci: setup npm publish 2023-03-02 06:55:56 -08:00
.gitmodules chore(tasks): update submodules 2023-02-24 13:08:22 +08:00
.typos.toml chore: move _typos.toml to .typos.toml so it doesn't show up in file viewers 2023-03-13 11:26:01 +08:00
Cargo.lock feat(cli): print number of cpus cores 2023-03-12 13:13:09 +08:00
Cargo.toml chore(rust): bump deps 2023-03-11 23:26:45 +08:00
CONTRIBUTING.md chore: update contribution docs 2023-02-24 13:24:42 +08:00
LICENSE Initial commit 2023-02-09 13:46:52 +08:00
README.md chore: update benchmark with more eslint rules, remove Rome 2023-03-14 08:26:30 +08:00
rust-toolchain.toml chore: Rust v1.68.0 (nightly-2023-03-09) 2023-03-10 11:09:44 -08:00
rustfmt.toml chore: add rustfmt.toml 2023-02-11 13:11:17 +08:00
THIRD-PARTY-LICENSE chore: add license of the "globals" library 2023-03-09 04:42:09 -08:00

The JavaScript Oxidation Compiler (oxc)

Discord chat MIT licensed npm version

The Oxidation Compiler is building a set of tools for the JavaScript / TypeScript language.

These tools include:

  • Parser - Done
  • Linter - Work in progress
  • Formatter
  • Transpiler
  • Minifier

Goals

The goal of this project is to:

  • Create a really fast native program by using the Rust programming language
  • Provide the basic building blocks for creating your own tools by having good API designs
  • Provide good documentation on learning Rust and compiler techniques

Performance issues are considered as bugs in this project.

Contributing

This project is an invitation for you to come and learn Rust with us.

Contributions are welcome and highly appreciated. To get started, check out CONTRIBUTING.md.

If you do not have the time to contribute code, you can still participate by:

Milestone

Oxc has a fully working parser and a prototype for the linter right now.

The current objectives are:

  • A MVP (Most Viable Product) for the linter.
  • Improve the parser for real usage. Areas include:
    • Performance
    • API
    • Pass more conformance tests

Linter

The linter is fast to the extent that it feels broken.

With a few rules implemented, testing in the VSCode repo:

vscode  main  npx oxidation-compiler@latest lint src
Checked 3479 files in 335ms using 12 cores.
Found 17 errors.

And also in a large monorepo:

Checked 73660 files in 7415ms using 12 cores.
Found 470 errors.

On my Intel i7 6-core, the linter is around 84 times faster than ESLint. But we'll get slightly slower as we add more features.

See benchmark for details.

Try it out yourself!

The linter is already usable and it can potentially catch a few mistakes for you:

npx oxidation-compiler@latest lint path

All feedbacks are welcome.

Parser Conformance

The cargo coverage command currently reports the following summary

Test262 Summary:
AST Parsed     : 43934/43934 (100.00%)

Babel Summary:
AST Parsed     : 2045/2057 (99.42%)

TypeScript Summary:
AST Parsed     : 4291/4861 (88.27%)

(The parser is failing some of the TypeScript recoverable parser tests.)

Learning Resources

Credits

This project is incubated from the help of these great mentors and their projects:

License

MIT

Third Party Licenses

Licenses are list in THIRD-PARTY-LICENSE

This project partially copies code from the following projects:

Project License
eslint/eslint MIT
typescript-eslint/typescript-eslint MIT
microsoft/TypeScript Apache 2.0
rome/tools MIT
mozilla-spidermonkey/jsparagus MIT Apache 2.0
acorn MIT
sindresorhus/globals MIT