- What is owlcorp/cli-json-lint used for?
- owlcorp/cli-json-lint is a command-line JSON linter for PHP and Laravel projects. It validates JSON files and reports syntax errors with line and column details. It is useful for checking config, translation, and schema files, and for wiring automated checks into CI pipelines, Git hooks, or Composer scripts.
- How do I install owlcorp/cli-json-lint with Composer?
- Install it as a development dependency with Composer using composer require --dev owlcorp/cli-json-lint. Then run the package's CLI binary from your project root. Check the README for the exact binary name and any PHP version constraints.
- Does owlcorp/cli-json-lint work with Laravel projects?
- Yes. It is a command-line JSON linter that fits PHP and Laravel projects, especially for config, lang, and schema files. Install it with Composer as a dev dependency and run it locally or in CI. See the README for exact Laravel-specific usage.
- How do I lint a JSON file from the command line?
- Run the package's CLI command and pass the path to the JSON file you want to validate. The linter reports syntax errors with line and column details so you can locate the problem quickly. Use the README for the exact command name and available options.
- What kind of JSON errors does owlcorp/cli-json-lint report?
- It reports JSON syntax errors with precise line and column details, helping you find malformed brackets, commas, quotes, or other invalid JSON. This is especially useful for large config, translation, and schema files where manual inspection is slow. Check the README for the exact output format.
- Can I use owlcorp/cli-json-lint in CI pipelines?
- Yes. Because it is a command-line tool, you can add it to CI pipelines to fail builds when JSON files contain syntax errors. A typical setup installs dependencies with Composer and runs the linter against your config, translation, or schema files. Check the README for recommended CI command syntax.
- Can I run owlcorp/cli-json-lint from a Git hook or Composer script?
- Yes. You can call the CLI from a Git pre-commit hook or a Composer script so invalid JSON is caught before it is committed or deployed. This is useful for Laravel config, lang, and schema files. Use the package's binary path in your script and consult the README for exact invocation details.
- How do I configure which JSON files owlcorp/cli-json-lint checks?
- The README excerpt does not list configuration details, so check the repository README and command help for supported arguments, paths, and flags. The tool is CLI-driven, which means you normally control what gets checked through the command you run. Use that command in CI or Git hooks after confirming the exact options.
- Which PHP and Laravel versions are supported by owlcorp/cli-json-lint?
- owlcorp/cli-json-lint is a Composer package for PHP projects, including Laravel applications. The exact PHP version and Laravel compatibility constraints are defined in the package's composer.json and README. Check those files before adding it to older Laravel codebases.
- How do I test owlcorp/cli-json-lint before using it in CI?
- Run the linter against a known-valid JSON file and a deliberately broken JSON file. The valid file should pass, while the broken file should report a syntax error with line and column information. This verifies the CLI is installed and wired correctly before you add it to CI or Git hooks.