OXK(Oxc-Ark)

May 14, 2026 ยท View on GitHub

An ArkTS/ArkUI tool based on OXC.

Goal

Provide fast ArkTS/ArkUI parser, formatter, and lint tooling based on OXC and oxlint.

Install

Install from cargo

Install with cargo.

cargo install oxk --git https://github.com/ohos-rs/oxc-ark.git

Install from npm

Install with npm

npm install @ohos-rs/oxk -g

Usage

Format

# Path support regex
oxk format xx.ets

Lint

oxk lint src --threads 1
oxk lint src/index.ets --format json

oxk lint embeds oxlint instead of shelling out to an external oxlint binary. It supports oxlint-compatible rules and config files. The npm package also loads the oxlint JavaScript runtime, so .oxlintrc.json, .oxlintrc.jsonc, oxlint.config.ts, built-in plugins, and JS plugins work through the npm CLI.

ArkTS migration rules are available through the built-in arkts plugin. See Built-in Lint for the rule list, configuration examples, arkts/system-api-version, and the SDK sync workflow.

Local Development

pnpm --filter @ohos-rs/oxk run build:debug
pnpm --filter @ohos-rs/oxk test
pnpm --filter @ohos-rs/oxk run build --target wasm32-wasip1-threads
pnpm --filter @ohos-rs/oxk run test:wasi

cargo check -p lint -p oxk
cargo check -p oxk-napi
cargo test -p lint -p oxk

Credits

Thanks for the following projects:

License

MIT