pub(crate) fn ban_unknown_rule_code(&self) -> Vec<LintDiagnostic> {
    let builtin_all_rule_codes: HashSet<&'static str> =
      get_all_rules().into_iter().map(|r| r.code()).collect();
    let is_unknown_rule = |code: &&String| {
      !builtin_all_rule_codes.contains(code.as_str())
        && !self.plugin_codes.contains(code.as_str())
    };

    let mut diagnostics = Vec::new();

    if let Some(file_ignore) = self.file_ignore_directive.as_ref() {
      for unknown_rule_code in
        file_ignore.codes().keys().filter(is_unknown_rule)
      {
        let d = self.create_diagnostic(
          file_ignore.span(),
          "ban-unknown-rule-code",
          format!("Unknown rule for code \"{}\"", unknown_rule_code),
          None,
        );
        diagnostics.push(d);
      }
    }

    for line_ignore in self.line_ignore_directives.values() {
      for unknown_rule_code in
        line_ignore.codes().keys().filter(is_unknown_rule)
      {
        let d = self.create_diagnostic(
          line_ignore.span(),
          "ban-unknown-rule-code",
          format!("Unknown rule for code \"{}\"", unknown_rule_code),
          None,
        );
        diagnostics.push(d);
      }
    }

    diagnostics
  }
/// Lint rule implementation for `ban-unknown-rule-code`.
/// This should be run after all normal rules have been finished because
/// currently we collect the rule codes of plugins as they are run and thus
/// there's no way of knowing what are the "known" rule codes beforehand.
Lint rule implementation for `ban-unknown-rule-code`.
This should be run after all normal rules have been finished because
currently we collect the rule codes of plugins as they are run and thus
there's no way of knowing what are the "known" rule codes beforehand.
Lint rule implementation for ` ban - unknown - rule - code ` . This should be run after all normal rules have been finished because currently we collect the rule codes of plugins as they are run and thus there ' s no way of knowing what are the " known " rule codes beforehand .
pub(crate) fn ban_unknown_rule_code(&self) -> Vec<LintDiagnostic> {
    let builtin_all_rule_codes: HashSet<&'static str> =
      get_all_rules().into_iter().map(|r| r.code()).collect();
    let is_unknown_rule = |code: &&String| {
      !builtin_all_rule_codes.contains(code.as_str())
        && !self.plugin_codes.contains(code.as_str())
    };
    let mut diagnostics = Vec::new();
    if let Some(file_ignore) = self.file_ignore_directive.as_ref() {
      for unknown_rule_code in
        file_ignore.codes().keys().filter(is_unknown_rule)
      {
        let d = self.create_diagnostic(
          file_ignore.span(),
          "ban-unknown-rule-code",
          format!("Unknown rule for code \"{}\"", unknown_rule_code),
          None,
        );
        diagnostics.push(d);
      }
    }
    for line_ignore in self.line_ignore_directives.values() {
      for unknown_rule_code in
        line_ignore.codes().keys().filter(is_unknown_rule)
      {
        let d = self.create_diagnostic(
          line_ignore.span(),
          "ban-unknown-rule-code",
          format!("Unknown rule for code \"{}\"", unknown_rule_code),
          None,
        );
        diagnostics.push(d);
      }
    }
    diagnostics
  }
pub ( crate ) fn ban_unknown_rule_code ( & self ) -> Vec < LintDiagnostic > { let builtin_all_rule_codes : HashSet < & ' static str > = get_all_rules ( ) . into_iter ( ) . map ( | r | r . code ( ) ) . collect ( ) ; let is_unknown_rule = | code : & & String | { ! builtin_all_rule_codes . contains ( code . as_str ( ) ) && ! self . plugin_codes . contains ( code . as_str ( ) ) } ; let mut diagnostics = Vec :: new ( ) ; if let Some ( file_ignore ) = self . file_ignore_directive . as_ref ( ) { for unknown_rule_code in file_ignore . codes ( ) . keys ( ) . filter ( is_unknown_rule ) { let d = self . create_diagnostic ( file_ignore . span ( ) , " " , format ! ( " \" \" " unknown_rule_code ) , None , ) ; diagnostics . push ( d ) ; } } for line_ignore in self . line_ignore_directives . values ( ) { for unknown_rule_code in line_ignore . codes ( ) . keys ( ) . filter ( is_unknown_rule ) { let d = self . create_diagnostic ( line_ignore . span ( ) , " " , format ! ( " \" \" " unknown_rule_code ) , None , ) ; diagnostics . push ( d ) ; } } diagnostics }
Lint rule implementation for `ban-unknown-rule-code`.
Lint rule implementation for ` ban - unknown - rule - code ` .
&self