diff --git a/README.md b/README.md index e0edc4d..2163fea 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ Options: -v, --version print version and exit -s, --schema validate json according to schema -i, --include array of file paths to include (default: *.json) + -e, --exclude array of file paths to exclude (default: node_modules/**) -a, --allow rules for definitions and keys to allow (example: additionalProperties:name:MyDefinition) ``` diff --git a/src/index.js b/src/index.js index e7dc837..f14da03 100644 --- a/src/index.js +++ b/src/index.js @@ -58,6 +58,10 @@ function validator() { userConfig.include = args["--include"]; } + if (args["--exclude"]) { + userConfig.exclude = args["--exclude"]; + } + if (args["--allow"]) { userConfig.allow = args["--allow"].reduce( (acc, rule) => { @@ -160,6 +164,7 @@ function validator() { }, { include: config.include, + exclude: config.exclude, }, ); } catch (_) {