Function deno_lint::rules::get_filtered_rules

source ·
pub fn get_filtered_rules(
    maybe_tags: Option<Vec<String>>,
    maybe_exclude: Option<Vec<String>>,
    maybe_include: Option<Vec<String>>
) -> Vec<&'static dyn LintRule>
Expand description

Returns a list of rules after filtering.

Following rules are applied (in the described order):

  • if maybe_tags is None then all defined rules are returned, otherwise only rules matching at least one tag will be returned; if provided list is empty then all rules will be excluded by default

  • if maybe_exclude is Some, all rules with matching codes will be filtered out

  • if maybe_include is Some, rules with matching codes will be added to the return list

Before returning the list will sorted alphabetically.