kocal/biome-js-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kocal/biome-js-bundle

最新稳定版本:v2.1.2

Composer 安装命令:

composer require kocal/biome-js-bundle

包简介

A Symfony Bundle to easily download and use Biome.js in your Symfony applications, to lint your front assets without needing Node.js.

README 文档

README

.github/workflows/ci.yaml Packagist Version

A Symfony Bundle to easily download and use Biome.js in your Symfony applications, to lint your front assets without needing Node.js (ex: when using Symfony AssetMapper).

Tip

If you prefer to use Oxlint instead, check Kocal/OxlintBundle!

Note

This documentation is for version ^2.0. You can check the previous documentation for ^1.0 here.

Installation

Install the bundle with Composer:

composer require kocal/biome-js-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\BiomeJsBundle\KocalBiomeJsBundle::class => ['dev' => true],
];
  1. Create the configuration file config/packages/kocal_biome_js.yaml:
when@dev:
    kocal_biome_js:
        # The Biome.js CLI version to use, that you can find at https://github.com/biomejs/biome/tags:
        # - for >=2.0.0 versions, the git tag follows the pattern "@biomejs/biome@<binary_version>"
        # - for <2.0.0 versions, the git tag follows the pattern "cli/v<binary_version>"
        binary_version: '2.0.0'
  1. Create the recommended biome.json file at the root of your project:
{
    "files": {
        "includes": [
            "**",
            "!assets/vendor/*",
            "!assets/controllers.json",
            "!public/assets/*",
            "!public/bundles/*",
            "!var/*",
            "!vendor/*",
            "!composer.json",
            "!package.json"
        ]
    }
}

In you use Biome.js <2.0.0, you can use the following configuration instead:

{
    "files": {
        "ignore": [
            "assets/vendor/*",
            "assets/controllers.json",
            "public/assets/*",
            "public/bundles/*",
            "var/*",
            "vendor/*",
            "composer.json",
            "package.json"
        ]
    }
}

Configuration

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

when@dev:
    kocal_biome_js:
        
        # The Biome.js CLI version to use, that you can find at https://github.com/biomejs/biome/tags:
        # - for >=2.0.0 versions, the git tag follows the pattern "@biomejs/biome@VERSION"
        # - for <2.0.0 versions, the git tag follows the pattern "cli/VERSION"
        binary_version: '2.0.0' # required

Usage

biomejs:download

Download the Biome.js CLI 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 biomejs:download
bin/biome --version

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

Inspirations

统计信息

  • 总下载量: 93.46k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 29
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 29
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-17