Files
szjs/node_modules/stylelint/lib/utils/configurationError.mjs
2025-03-07 22:27:18 +08:00

18 lines
427 B
JavaScript

import { EXIT_CODE_INVALID_CONFIG } from '../constants.mjs';
/** @typedef {Error & { code: number }} ConfigurationError */
/**
* Create configurationError from text and set CLI exit code.
*
* @param {string} text
* @returns {ConfigurationError}
*/
export default function configurationError(text) {
const err = /** @type {ConfigurationError} */ (new Error(text));
err.code = EXIT_CODE_INVALID_CONFIG;
return err;
}