diff options
Diffstat (limited to 'tools/node_modules/eslint/node_modules/ajv/README.md')
-rw-r--r-- | tools/node_modules/eslint/node_modules/ajv/README.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/node_modules/eslint/node_modules/ajv/README.md b/tools/node_modules/eslint/node_modules/ajv/README.md index 5ddefa1347..c858efd09f 100644 --- a/tools/node_modules/eslint/node_modules/ajv/README.md +++ b/tools/node_modules/eslint/node_modules/ajv/README.md @@ -805,6 +805,8 @@ console.log(data); // [ 1, "foo" ] - in `if` subschema of `switch` keyword - in schemas generated by custom macro keywords +The [`strictDefaults` option](#options) customizes Ajv's behavior for the defaults that Ajv ignores (`true` raises an error, and `"log"` outputs a warning). + ## Coercing data types @@ -1070,6 +1072,9 @@ Defaults: removeAdditional: false, useDefaults: false, coerceTypes: false, + // strict mode options + strictDefaults: false, + strictKeywords: false, // asynchronous validation options: transpile: undefined, // requires ajv-async package // advanced options: @@ -1153,6 +1158,18 @@ Defaults: - `"array"` - in addition to coercions between scalar types, coerce scalar data to an array with one element and vice versa (as required by the schema). +##### Strict mode options + +- _strictDefaults_: report ignored `default` keywords in schemas. Option values: + - `false` (default) - ignored defaults are not reported + - `true` - if an ignored default is present, throw an error + - `"log"` - if an ignored default is present, log warning +- _strictKeywords_: report unknown keywords in schemas. Option values: + - `false` (default) - unknown keywords are not reported + - `true` - if an unknown keyword is present, throw an error + - `"log"` - if an unknown keyword is present, log warning + + ##### Asynchronous validation options - _transpile_: Requires [ajv-async](https://github.com/epoberezkin/ajv-async) package. It determines whether Ajv transpiles compiled asynchronous validation function. Option values: |