lib/config/config-validator.js
function validateConfigSchema(config, source = null) {
    validateSchema = validateSchema || ajv.compile(configSchema);

    if (!validateSchema(config)) {
        throw new Error(`ESLint configuration in ${source} is invalid:\n${formatErrors(validateSchema.errors)}`);
    }

    if (Object.hasOwnProperty.call(config, "ecmaFeatures")) {
        emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES");
    }
}
function validateConfigSchema(config, source = null) {
    validateSchema = validateSchema || ajv.compile(configSchema);

    if (!validateSchema(config)) {
        throw new Error(`ESLint configuration in ${source} is invalid:\n${formatErrors(validateSchema.errors)}`);
    }

    if (Object.hasOwnProperty.call(config, "ecmaFeatures")) {
        emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES");
    }
}
function validateConfigSchema ( config , source = null ) { validateSchema = validateSchema || ajv . compile ( configSchema ) ; if ( ! validateSchema ( config ) ) { throw new Error ( ` ${ source } \n ${ formatErrors ( validateSchema . errors ) } ` ) ; } if ( Object . hasOwnProperty . call ( config , "ecmaFeatures" ) ) { emitDeprecationWarning ( source , "ESLINT_LEGACY_ECMAFEATURES" ) ; } }
Validates the top level properties of the config object.
@param {Object} config The config object to validate.
@param {string} source The name of the configuration source to report in any errors.
@returns {void}
Validates the top level properties of the config object .