kocal/oxc-bundle

A Symfony Bundle to easily download tools from the JavaScript Oxidation Compiler (Oxc).

Installs: 12

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:symfony-bundle

pkg:composer/kocal/oxc-bundle

v1.0.0 2026-02-04 20:25 UTC

This package is auto-updated.

Last update: 2026-02-04 20:38:01 UTC


README

.github/workflows/ci.yaml Packagist Version

A Symfony Bundle to easily download and use Oxlint and Oxfmt (from the Oxc project) in your Symfony applications, to lint your front assets without needing Node.js (ex: when using Symfony AssetMapper).

Tip

If you prefer to use Biome.js instead, check Kocal/BiomeJsBundle!

Installation

Install the bundle with Composer:

composer require kocal/oxc-bundle --dev

If you use Symfony Flex, everything must be configured automatically. If that's not the case, please follow the next steps:

Manual installation steps
  1. Register the bundle in your config/bundles.php file:
return [
    // ...
    Kocal\OxcBundle\KocalOxcBundle::class => ['dev' => true],
];
  1. Create the configuration file config/packages/kocal_oxc.yaml:
when@dev:
    kocal_oxc:
        # The Oxc apps version to use, that you can find at https://github.com/oxc-project/oxc/tags,
        # it follows the pattern "apps_v<apps_version>"
        apps_version: '1.43.0'
  1. Create the recommended .oxlintrc.json file at the root of your project:
{
    "plugins": null,
    "categories": {},
    "rules": {},
    "env": {
        "builtin": true
    },
    "globals": {},
    "ignorePatterns": [
        "assets/vendor/**",
        "assets/controllers.json",
        "public/assets/**",
        "public/bundles/**",
        "tests/**",
        "var/**",
        "vendor/**",
        "composer.json",
        "package.json"
    ]
}
  1. Create the recommended .oxfmtrc.json file at the root of your project:
{
    "ignorePatterns": [
        "assets/vendor/**",
        "assets/controllers.json",
        "public/assets/**",
        "public/bundles/**",
        "tests/**",
        "var/**",
        "vendor/**",
        "composer.json",
        "package.json"
    ]
}

Configuration

The bundle is configured in the config/packages/kocal_oxc.yaml file:

when@dev:
    kocal_oxc:
        # The Oxc apps version to use, that you can find at https://github.com/oxc-project/oxc/tags,
        # it follows the pattern "apps_v<apps_version>"
        apps_version: '1.43.0'

Usage

oxc:download:oxlint

Download Oxlint for your configured version and for your platform.

By default, the command will download the binary in the bin/ directory of your project.

php bin/console oxc:download:oxlint
bin/oxlint --version

# or, with a custom destination directory
php bin/console oxc:download:oxlint path/to/bin
path/to/bin/oxlint --version

oxc:download:oxfmt

Download Oxfmt for your configured version and for your platform.

By default, the command will download the binary in the bin/ directory of your project.

php bin/console oxc:download:oxfmt
bin/oxfmt --version

# or, with a custom destination directory
php bin/console oxc:download:oxfmt path/to/bin
path/to/bin/oxfmt --version

Inspirations