Registry / testing / eslint-plugin-json-schema-validator

eslint-plugin-json-schema-validator

JSON →
library6.2.0jsnpmunverified

ESLint plugin that validates JSON, JSONC, JSON5, YAML, TOML, JavaScript, and Vue custom blocks against JSON Schema. Current stable version is 6.2.0 (released 2025-06-10). Requires ESLint >=9.38.0 and Node.js >=20.19.0 (20.x), >=22.13.0 (22.x), or >=24. Actively maintained with monthly releases. Key differentiator: validates structured data formats using JSON Schema within ESLint flat config, supporting multiple data languages and schema from SchemaStore.

npm install eslint-plugin-json-schema-validator
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-JSON
E
eslint-plugin-json-schema-validator
testingjavascriptv6.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import eslintPluginJsonSchemaValidator from 'eslint-plugin-json-schema-validator'
const eslintPluginJsonSchemaValidator = require('eslint-plugin-json-schema-validator')
ESM-only since v6.0.0 with Node >=20.19.0. Default import provides the plugin object with configs.
configs.recommended
export default [ ...eslintPluginJsonSchemaValidator.configs.recommended ]
export default [ eslintPluginJsonSchemaValidator.configs.flat.recommended ]
Flat config only since v6.0.0. The flat/ prefix is deprecated but still works as alias.
rules
import { rules } from 'eslint-plugin-json-schema-validator'
import { rules } from 'eslint-plugin-json-schema-validator/rules'
Direct import of rules map for custom config is supported.

ESLint flat config using recommended configuration; validates JSON, YAML, and TOML against JSON Schema.

// eslint.config.js import eslintPluginJsonSchemaValidator from 'eslint-plugin-json-schema-validator'; export default [ ...eslintPluginJsonSchemaValidator.configs.recommended, { rules: { 'json-schema-validator/no-invalid': 'warn' } } ]; // Run: npx eslint --ext .json,.yaml,.toml src/
Debug
Known issues
breakingESLint plugin requires ESLint >=9.38.0 and Node.js >=20.19.0/22.13.0/>=24.0.0
fix
Update ESLint: npm install eslint@^9.38.0 --save-dev; ensure Node.js >=20.19.0 (20.x) or >=22.13.0 (22.x) or >=24.0.0.
affects: >=6.0.0
breakingv6.0.0 dropped support for older ESLint versions; requires flat config only (eslint.config.js).
fix
Migrate from .eslintrc to eslint.config.js using flat config format.
affects: >=6.0.0
breakingv6.0.0 replaced require() with ESM imports; CommonJS require() will fail.
fix
Convert all require('eslint-plugin-json-schema-validator') to import statements. Ensure package.json has 'type': 'module' or use .mjs extension.
affects: >=6.0.0
gotchaPlugin does not validate .js files by default; only JSON, YAML, TOML, and Vue SFC.
fix
If you need to validate JSON Schema in JS files, ensure they are processed by ESLint with appropriate parser settings (e.g., @babel/eslint-parser).
affects: >=0.0.0
deprecatedThe flat/ prefix in configs (e.g., configs['flat/recommended']) is deprecated in v6.
fix
Use configs.recommended directly instead of configs['flat/recommended'].
affects: >=6.0.0
gotchaSchemaStore URLs are normalized to www.schemastore.org; custom URLs may not be recognized.
fix
Ensure custom schema URLs are valid and not blocked by normalization. Use local schema files if normalization causes issues.
affects: >=5.5.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/eslint-plugin-json-schema-validator/dist/index.js from /path/to/eslint.config.js not supported.
v6.0.0 is ESM-only, but eslint.config.js is being loaded via CommonJS (require).
fix
Rename eslint.config.js to eslint.config.mjs or add 'type': 'module' to package.json.
Error: Failed to load plugin 'json-schema-validator' declared in 'plugins': Cannot find module 'eslint-plugin-json-schema-validator'
Plugin is not installed or ESLint version <9.38.0 incompatibility with v6.
fix
Install or update: npm install eslint-plugin-json-schema-validator@latest --save-dev; ensure ESLint >=9.38.0.
Configuration for rule 'json-schema-validator/no-invalid' is invalid: Value 'warn' is not a valid severity level.
Severity must be 0, 1, 2, 'off', 'warn', or 'error'.
fix
Use 'warn' (string) or 1 (number) correctly: 'json-schema-validator/no-invalid': 'warn' (with quotes).
Upgrade
Version history
6.2.0latest on npm
Audit
Dependencies
eslintrequiredPeer dependency; plugin requires ESLint >=9.38.0 (flat config only).
Agent activity
6 hits · last 30 days
node
6
Resources