How to use the eslint/lib/config/config-validator.validateRuleOptions function in eslint

To help you get started, we’ve selected a few eslint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mysticatea / eslint-config / lib / check-rules.js View on Github external
if (name in coreActualRules === false) {
        console.error("✗ \"" + name + "\" rule had removed.");
        missingRuleExists = true;
    }
}

for (name in coreActualRules) {
    if (name in coreRules === false) {
        console.error("✗ \"" + name + "\" rule had added.");
        missingRuleExists = true;
    }
}

for (name in coreRules) {
    try {
        validator.validateRuleOptions(name, coreRules[name], "base.js");
    }
    catch (err) {
        console.error("✗", err.message);
        missingRuleExists = true;
    }
}

//-----------------------------------------------------------------------------
// Node rules.
//-----------------------------------------------------------------------------

for (name in nodeRules) {
    if (name in nodeActualRules === false) {
        console.error("✗ \"" + name + "\" rule had removed.");
        missingRuleExists = true;
    }
github mysticatea / eslint-config / test / lib / rules.js View on Github external
module.exports.validateRuleOptions = (id, options, source) =>
    Validator.validateRuleOptions(allRules.get(id), id, options, source)
github mysticatea / eslint-config / lib / check-rules.js View on Github external
if (name in nodeActualRules === false) {
        console.error("✗ \"" + name + "\" rule had removed.");
        missingRuleExists = true;
    }
}

for (name in nodeActualRules) {
    if (name in nodeRules === false) {
        console.error("✗ \"" + name + "\" rule had added.");
        missingRuleExists = true;
    }
}

for (name in nodeRules) {
    try {
        validator.validateRuleOptions(name, nodeRules[name], "node.js");
    }
    catch (err) {
        console.error("✗", err.message);
        missingRuleExists = true;
    }
}

//-----------------------------------------------------------------------------

if (missingRuleExists) {
    process.exit(1);
}