json-schema-validator/no-invalid
validate object with JSON Schema.
- ⚙️ This rule is included in
"plugin:json-schema-validator/recommended"
.
📖 Rule Details
This rule validates the file with JSON Schema and reports errors.
🔧 Options
schemas
... Define an array of any JSON Schema.fileMatch
... A list of known file names (or globs) that match the schema.schema
... An object that defines a JSON schema. Or the path of the JSON schema file or URL.
useSchemastoreCatalog
... Iftrue
, it will automatically configure some schemas defined in https://www.schemastore.org/api/json/catalog.json. Defaulttrue
mergeSchemas
... Iftrue
, it will merge all schemas defined inschemas
, at the$schema
field within files, and the catalogue. If an array is given, it will merge only schemas from the given sources. Defaultfalse
This option can also be given a JSON schema file or URL. This is useful for configuring with the /* eslint */
directive comments.
Use with .vue
This rule supports .vue
custom blocks.
Example:
You must also install eslint-plugin-vue to enable .vue
files validation. See here for details.
To match a custom block, use a glob like this:
The following custom blocks will try to test if it matches with the virtual filenames.
📚 Further reading
🚀 Version
This rule was introduced in eslint-plugin-json-schema-validator v0.1.0