@commitlint/config-validator
Advanced tools
Comparing version 18.6.1 to 19.0.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Yes
12074
187
1
+ Added@commitlint/types@19.5.0(transitive)
+ Added@types/conventional-commits-parser@5.0.0(transitive)
+ Added@types/node@22.5.5(transitive)
+ Addedchalk@5.3.0(transitive)
+ Addedundici-types@6.19.8(transitive)
- Removed@commitlint/types@18.6.1(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedsupports-color@7.2.0(transitive)
Updated@commitlint/types@^19.0.0