Download the PHP package owlcorp/cli-json-lint without Composer
On this page you can find all versions of the php package owlcorp/cli-json-lint. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download owlcorp/cli-json-lint
More information about owlcorp/cli-json-lint
Files in owlcorp/cli-json-lint
Package cli-json-lint
Short Description JSON linting command line support mimicking Symfony-way of doing things
License MIT
Informations about the package cli-json-lint
CLI JSON Lint
This small package adds a more advanced CLI interface over industry-standard Seldaek's JSON Lint. The CLI interface is compatible with Symfony's YAML lint commands and integrates nicely with workflows using both JSON and YAML commands.
Installation
With Symfony
Install package with composer req --dev owlcorp/cli-json-lint. The command will be automatically available in your
application's console:
If you're not using Symfony Flex, you need to add the following to your
config/bundles.php:
Without Symfony
Install package with composer req --dev owlcorp/cli-json-lint. The command will be available to use via
vendor/bin/json-lint:
application's console:
Usage
The command is available either via bin/console lint:json (if using Symfony) or vendor/bin/json-lint. Use --help
to get information about all options. Examples below work with or without Symfony.
Cheatsheet:
- Lint
./vendorwith subdirectories:vendor/bin/json-lint config - Lint only files within
./:vendor/bin/json-lint --d 0 . - Show detailed error information:
vendor/bin/json-lint -v vendor - Show all files parsed:
vendor/bin/json-lint -vv vendor - You can also use wildcards using glob syntax:
vendor/bin/json-lint *end*
Practical example
This package was created to unify linting all configs on production. This is usually achieved by adding a script to
composer.json like so: