lib/utils/patch.js
function getSeverity(config, ruleId) {
    const rules = config && config.rules
    const ruleOptions = rules && rules[ruleId]
    const severity = Array.isArray(ruleOptions) ? ruleOptions[0] : ruleOptions

    switch (severity) {
        case 2:
        case "error":
            return 2

        case 1:
        case "warn":
            return 1

        default:
            return 0
    }
}
function getSeverity(config, ruleId) {
    const rules = config && config.rules
    const ruleOptions = rules && rules[ruleId]
    const severity = Array.isArray(ruleOptions) ? ruleOptions[0] : ruleOptions

    switch (severity) {
        case 2:
        case "error":
            return 2

        case 1:
        case "warn":
            return 1

        default:
            return 0
    }
}
function getSeverity ( config , ruleId ) { const rules = config && config . rules const ruleOptions = rules && rules [ ruleId ] const severity = Array . isArray ( ruleOptions ) ? ruleOptions [ 0 ] : ruleOptions switch ( severity ) { case 2 : case "error" : return 2 case 1 : case "warn" : return 1 default : return 0 } }
Get the severity of a given rule.
@param {object} config The config object to check.
@param {string} ruleId The rule ID to check.
@returns {number} The severity of the rule.
Get the severity of a given rule .