Download the PHP package luxplus/blade-linter without Composer

On this page you can find all versions of the php package luxplus/blade-linter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package blade-linter

luxplus/blade-linter

Lints Laravel Blade templates for blank-line conventions between sibling elements, with auto-fix.

The core rule (SiblingBlankLines): within any scope (an HTML element, an @if branch, a loop body, the file root), two adjacent sibling elements must be separated by exactly one blank line when at least one of them spans multiple lines, and by none when both are single-line. A sibling is multi-line whenever its source spans more than one line, so a tag with wrapped attributes counts as multi-line, whichever tool wrapped it.

Blade directives get a blank line around them too: a sibling whose line starts with a directive (@csrf, @props(...), @include(...), ...) needs exactly one blank line between it and its neighbours, even when both are single-line. The exception is a run of single-line directives with the same name (@vite, @vite, @vite), which forms a group with no blank lines inside and a blank line on either side. Names must match exactly, so @include followed by @includeWhen still needs a blank line, and a directive that wraps onto several lines breaks out of its group. Block directives (@php ... @endphp, @if ... @endif) are a single multi-line sibling. Escaped @@/@{{, attributes such as Alpine's @click, and directives the parser doesn't know (custom ones registered by the app) are not treated as directives.

Scope edges stay unpadded, @else/@elseif/@empty boundaries get no surrounding blanks, pairs touching a Blade/HTML comment (or the doctype) are left alone, and the contents of @switch, <script>, <style>, <pre>, <textarea> and <svg> are not checked.

Installation

The package is not on Packagist yet, so add the repository to your project's composer.json first:

Then require it as a dev dependency:

no-api makes Composer clone the repository with git instead of going through the GitHub API, so installs never prompt for a token and are not subject to anonymous API rate limits. Because that disables zip downloads for this package, it must be installed from source, which the preferred-install entry above ensures even when you pass --prefer-dist.

The blade:lint artisan command is registered through package auto-discovery.

Usage

Check mode exits 1 when violations are found; --fix output is idempotent and blade-formatter-compatible.

Configuration

Custom rules

A rule is any class implementing Luxplus\BladeLinter\Rules\LintRule. It receives the parsed template tree (LintItem scopes/regions with line spans) plus the raw lines, and returns Violations that carry their own fix (a blank-line gap rewrite). Register it in the rules array of the consuming project's config — no package release required.

Development

Note: templates are parsed via stillat/blade-parser for Blade constructs, with an internal byte-offset HTML tag scanner (the parser's own fragment API is avoided deliberately: it hangs on some real-world templates, and its positions are character-based while all internal arithmetic here is byte-based — see OffsetConverter).

License

This package is open-sourced software licensed under the MIT license.


All versions of blade-linter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
laravel/framework Version ^12.0 || ^13.0
stillat/blade-parser Version ^2.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package luxplus/blade-linter contains the following files

Loading the files please wait ...