simple-icons/scripts/lint/jsonlint.js
Eric Cornelissen 153a029c25
Restructure the scripts/ directory (#5546)
* Restructure scripts/ directory

And update references to this scripts everywhere.

* Update names of file-level constants in bump-version.js

* Normalize quotes between all scripts

* Move "create-release.yml" scripts to scripts/release

* Move slugs table script to scripts/release

* Update relative path logic in update-slugs-table.js
2021-05-07 19:55:06 +02:00

21 lines
624 B
JavaScript

const path = require("path");
const Validator = require("jsonschema").Validator;
const rootDir = path.resolve(__dirname, "..", "..");
const schemaFile = path.resolve(rootDir, ".jsonschema.json");
const dataFile = path.resolve(rootDir, "_data", "simple-icons.json");
const schema = require(schemaFile);
const data = require(dataFile);
const validator = new Validator();
const result = validator.validate(data, schema);
if (result.errors.length > 0) {
result.errors.forEach((error) => {
console.error(error);
});
console.error(`Found ${result.errors.length} error(s) in simple-icons.json`);
process.exit(1);
}