kocal / biome-js-bundle
Use Biome.js with Symfony
Installs: 2 620
Dependents: 0
Suggesters: 0
Security: 0
Stars: 19
Watchers: 1
Forks: 4
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.1
- symfony/console: ^6.4|^7.0
- symfony/http-client: ^6.4|^7.0
- symfony/process: ^6.4|^7.0
Requires (Dev)
- phpstan/phpstan: ^1.11
- phpunit/phpunit: ^10.5 || ^11.1
- symfony/framework-bundle: ^6.4|^7.0
- symplify/easy-coding-standard: ^12.1.2
README
This bundle makes it easy to use Biome.js in your Symfony project, to lint and format your assets files without Node.js (ex: when using Symfony's AssetMapper Component).
Installation
Install the bundle with Composer:
composer require kocal/biome-js-bundle --dev
The bundle should have been automatically enabled in your Symfony application (config/bundles.php
).
If that's not the case, you can enable it manually:
// config/bundles.php return [ // ... Kocal\BiomeJsBundle\KocalBiomeJsBundle::class => ['dev' => true], ];
Configuration
If you want to use a specific version of Biome.js, you can configure it in your config/packages/kocal_biome_js.yaml
:
when@dev: kocal_biome_js: version: v1.7.3
To configure Biome.js it-self, you must create a biome.json
file at the root of your project.
A recommended configuration for Symfony projects is to ignore files from assets/vendor/
, vendor/
and public/bundles/
:
{ "files": { "ignore": [ "assets/vendor/*", "assets/controllers.json", "composer.json", "public/assets/*", "public/bundles/*", "vendor/*" ] } }
Usage
The latest Biome.js CLI binary is automatically installed (if not already installed) when running one of the biomejs:*
command.
biomejs:check
Runs formatter, linter and import sorting to the requested files.
# Shows format and lint errors php bin/console biomejs:check . # Shows format and lint errors, and fix them if possible php bin/console biomejs:check . --write
biomejs:ci
Command to use in CI environments. Runs formatter, linter and import sorting to the requested files.
Files won't be modified, the command is a read-only operation.
# Shows format and lint errors php bin/console biomejs:ci .