jsonlint-cli is a command-line interface wrapper for the underlying jsonlint library, designed to enhance JSON validation workflows beyond the basic functionality offered by jsonlint itself. While it leverages jsonlint for core JSON validity checking and local schema validation, this CLI tool significantly expands capabilities. Key differentiators include support for glob expansion to lint multiple files (e.g., `**/*.json`), remote JSON schema validation, and adherence to JSON Schema Draft-04. It also introduces an eslint-style configuration system through `.jsonlintrc` and `.jsonlintignore` files for project-specific settings and file exclusions. The package's current stable version is 1.0.1, released in March 2016. Its release cadence is effectively dormant, indicating it is no longer actively maintained or developed.
npm install jsonlint-cliVerified import paths — ran on the pinned version, not inferred.
Demonstrates global installation, basic file validation, globbing with remote schema validation, and piping from stdin.
There is no direct replacement for the `--quiet` flag. Users must pipe `jsonlint-cli` output to `grep`, `awk`, or similar utilities if they need to suppress error messages.
Consider migrating to actively maintained alternatives for JSON linting and schema validation, such as `ajv-cli` for schema validation or `prettier --parser json` for formatting.
Explicitly test your `.jsonlintrc` and `.jsonlintignore` files with `jsonlint-cli` on various target files to confirm the expected behavior. Use `--ignore` flag directly if configuration files are problematic.
Run `npm install -g jsonlint-cli` to install the package globally, or ensure the npm global bin directory is included in your shell's PATH environment variable.
Provide a file path or glob pattern (e.g., `jsonlint-cli mydata.json` or `jsonlint-cli '**/*.json'`) or pipe content (e.g., `echo '{"key":"value"}' | jsonlint-cli`).Review the JSON file or input string for syntax errors such as missing commas, unclosed brackets, or incorrect string escaping. Tools like VS Code's built-in JSON validator can help identify issues.