Socket
Socket
Sign inDemoInstall

@commitlint/config-validator

Package Overview
Dependencies
Maintainers
4
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commitlint/config-validator - npm Package Compare versions

Comparing version 18.6.1 to 19.0.0

2

lib/formatErrors.d.ts

@@ -1,2 +0,2 @@

import { ErrorObject } from 'ajv';
import type { ErrorObject } from 'ajv';
/**

@@ -3,0 +3,0 @@ * Formats an array of schema validation errors.

@@ -1,4 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatErrors = void 0;
/**

@@ -10,3 +7,3 @@ * Formats an array of schema validation errors.

*/
function formatErrors(errors) {
export function formatErrors(errors) {
return errors

@@ -39,3 +36,2 @@ .map((error) => {

}
exports.formatErrors = formatErrors;
//# sourceMappingURL=formatErrors.js.map

@@ -1,10 +0,6 @@

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateConfig = void 0;
const ajv_1 = __importDefault(require("ajv"));
const commitlint_schema_json_1 = __importDefault(require("./commitlint.schema.json"));
const formatErrors_1 = require("./formatErrors");
import { createRequire } from 'module';
import _Ajv from 'ajv';
import { formatErrors } from './formatErrors.js';
const require = createRequire(import.meta.url);
const schema = require('./commitlint.schema.json');
const TYPE_OF = [

@@ -19,4 +15,6 @@ 'undefined',

];
function validateConfig(source, config) {
const ajv = new ajv_1.default({
// FIXME: https://github.com/ajv-validator/ajv/issues/2132
const Ajv = _Ajv;
export function validateConfig(source, config) {
const ajv = new Ajv({
meta: false,

@@ -36,9 +34,8 @@ strict: false,

});
const validate = ajv.compile(commitlint_schema_json_1.default);
const validate = ajv.compile(schema);
const isValid = validate(config);
if (!isValid && validate.errors && validate.errors.length) {
throw new Error(`Commitlint configuration in ${source} is invalid:\n${(0, formatErrors_1.formatErrors)(validate.errors)}`);
throw new Error(`Commitlint configuration in ${source} is invalid:\n${formatErrors(validate.errors)}`);
}
}
exports.validateConfig = validateConfig;
//# sourceMappingURL=validate.js.map
{
"name": "@commitlint/config-validator",
"version": "18.6.1",
"type": "module",
"version": "19.0.0",
"description": "config validator for commitlint.config.js",

@@ -38,9 +39,9 @@ "main": "lib/validate.js",

"devDependencies": {
"@commitlint/utils": "^18.6.1"
"@commitlint/utils": "^19.0.0"
},
"dependencies": {
"@commitlint/types": "^18.6.1",
"@commitlint/types": "^19.0.0",
"ajv": "^8.11.0"
},
"gitHead": "89f5bf91d1c11b1f457a6f0d99b8ea34583a9311"
"gitHead": "f1ff12159d627ee63bf8982ab02e6cca8f10b09f"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc