Package Exports
- jsonlint-cli
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jsonlint-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
jsonlint-cli - cli wrapper for jsonlint
Thin wrapper around jsonlint improving on its cli. It introduces glob expansion and advanced schema validation. Borrows heaviliy from jsonlint
in every regard.
Why should I use jsonlint-cli?
jsonlint-cli
introduces valuable improvements and additions to the cli shipping with jsonlint.
Feature | jsonlint | jsonlint-cli | Description |
---|---|---|---|
json validity checking | ✔️ | ✔️ | jsonlint-cli uses jsonlint to parse and validate |
local schema validation | ✔️ | ✔️ | specify local schemas to validate input against |
read from stdin | ✔️ | ✔️ | stream json in via stdin |
read from fs | ✔️ | ✔️ | specify file's path to lint |
glob expansion | ❌ | ✔️ | specify globs of files to lint, e.g. **/*.json |
remote schema validation | ❌ | ✔️ | specify remote schemas to validate input against, e.g. package.json |
v4 schema validation | ❌ | ✔️ | use v4 jsonschema |
config files | ❌ | ✔️ | support for eslint style config files |
Installation
# Install it from npm
npm install -g jsonlint-cli
Usage
jsonlint-cli
exposes a command line interface
jsonlint-cli --help
jsonlint-cli [options] [file] - cli wrapper for jsonlint
--s, --validate uri to schema to use for validation, defaults to: "null"
--v, --version show jsonlint-cli version
--i, --ignore glob pattern to exclude from linting, defaults to: "node_modules/**/*"
--w, --indent whitespace to use for pretty printing, defaults to: " "
--p, --pretty pretty-print the input, defaults to: "false"
--q, --quiet surpress all output, defaults to: "false"
--h, --help show this help
--e, --env json schema env to use for validation, defaults to: "json-schema-draft-04"
Configuration
jsonlint-cli
picks up configuration files, searching upwards from process.cwd()
or the file path
if specified.
.jsonlintrc
{
"validate": "", // schema uri to validate agains
"ignore": ["node_modules/**/*"], // glob patterns to ignore
"indent": "", // indent to use for pretty-printed output
"env": "json-schema-draft-03", // json schema env version to use
"quiet": false, // suppress any output
"pretty": true // pretty-print formatted json if quiet is false
}
.jsonlintignore
node_modules/ # ignored by default
distribution/
Copyright 2016 by Mario Nebl and contributors. Released under the MIT license.