kocal / oxlint-bundle
A Symfony Bundle to easily download and use Oxlint (from the Oxc project) in your Symfony applications, to lint your front assets without needing Node.js.
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.1
- symfony/console: ^6.4|^7.0
- symfony/filesystem: ^6.4|^7.0
- symfony/http-client: ^6.4|^7.0
- symfony/process: ^6.4|^7.0
Requires (Dev)
- phpstan/phpstan: ^1.11
- symfony/framework-bundle: ^6.4|^7.0
- symplify/easy-coding-standard: ^12.1.2
README
A Symfony Bundle to easily download and use Oxlint (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/oxlint-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
- Register the bundle in your
config/bundles.php
file:
return [ // ... Kocal\OxlintBundle\KocalOxlintBundle::class => ['dev' => true], ];
- Create the configuration file
config/packages/kocal_oxlint.yaml
:
when@dev: kocal_oxlint: # The Oxlint binary version to use, that you can find at https://github.com/oxc-project/oxc/tags, # it follows the pattern "oxlint_v<binary_version>" binary_version: '1.8.0'
- Create the recommended
.oxlintrc.json
file at the root of your project:
{ "ignorePatterns": [ "assets/vendor/**", "public/assets/**", "public/bundles/**", "var/**", "vendor/**" ] }
Configuration
The bundle is configured in the config/packages/kocal_oxlint.yaml
file:
when@dev: kocal_oxlint: # The Oxlint binary version to use, that you can find at https://github.com/oxc-project/oxc/tags, # it follows the pattern "oxlint_v<binary_version>" binary_version: '1.8.0'
Usage
oxlint:download
Download the Oxlint binary for your configured version and for your platform (Linux, macOS, Windows).
By default, the command will download the binary in the bin/
directory of your project.
php bin/console oxlint:download
bin/oxlint --version
# or, with a custom destination directory
php bin/console oxlint:download path/to/bin
path/to/bin/oxlint --version