
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
vite-plugin-validate-json
Advanced tools
A Vite plugin that validates all JSON files in specified paths.
npm install vite-plugin-validate-json --save-dev
# or
yarn add vite-plugin-validate-json --dev
# or
pnpm add -D vite-plugin-validate-json
Add the plugin to your vite.config.js or vite.config.ts:
import { defineConfig } from 'vite';
import { validateJsonPaths } from 'vite-plugin-validate-json';
export default defineConfig({
plugins: [
validateJsonPaths({
paths: ['src/**/*.json', 'public/**/*.json'],
allowDuplicateKeys: false, // default: false
ignoreFiles: ['node_modules/**/*', 'dist/**/*'], // optional
}),
// other plugins...
],
});
| Option | Type | Default | Description |
|---|---|---|---|
paths | string[] | - | Glob patterns for JSON files to validate |
allowDuplicateKeys | boolean | false | Set to true to allow duplicate keys in JSON files |
ignoreFiles | string[] | [] | Files to ignore during validation |
This plugin runs during the Vite build process and:
allowDuplicateKeys is set to true)If a JSON file contains invalid syntax:
❌ Error while validating src/config.json with error SyntaxError: Unexpected token } in JSON at position 42
If a JSON file contains duplicate keys (and allowDuplicateKeys is false):
❌ Error while validating src/translations.json with error Error: Duplicate key: "welcome" at position 102
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
FAQs
A Vite plugin to validate a set of paths to JSON files.
The npm package vite-plugin-validate-json receives a total of 8 weekly downloads. As such, vite-plugin-validate-json popularity was classified as not popular.
We found that vite-plugin-validate-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.