mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
refactor(linter): move default all_rules output to trait (#8710)
This commit is contained in:
parent
33de70ae71
commit
4a2f2a9cd9
5 changed files with 3 additions and 17 deletions
|
|
@ -13,10 +13,6 @@ use crate::output_formatter::InternalFormatter;
|
|||
pub struct CheckStyleOutputFormatter;
|
||||
|
||||
impl InternalFormatter for CheckStyleOutputFormatter {
|
||||
fn all_rules(&self) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
fn get_diagnostic_reporter(&self) -> Box<dyn DiagnosticReporter> {
|
||||
Box::new(CheckstyleReporter::default())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@ use crate::output_formatter::InternalFormatter;
|
|||
pub struct GithubOutputFormatter;
|
||||
|
||||
impl InternalFormatter for GithubOutputFormatter {
|
||||
fn all_rules(&self) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
fn get_diagnostic_reporter(&self) -> Box<dyn DiagnosticReporter> {
|
||||
Box::new(GithubReporter)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,9 @@ pub struct LintCommandInfo {
|
|||
/// The Formatter is then managed by [`OutputFormatter`].
|
||||
trait InternalFormatter {
|
||||
/// Print all available rules by oxlint
|
||||
fn all_rules(&self) -> Option<String>;
|
||||
fn all_rules(&self) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
/// At the end of the Lint command the Formatter can output extra information.
|
||||
fn lint_command_info(&self, _lint_command_info: &LintCommandInfo) -> Option<String> {
|
||||
|
|
|
|||
|
|
@ -10,10 +10,6 @@ use crate::output_formatter::InternalFormatter;
|
|||
pub struct StylishOutputFormatter;
|
||||
|
||||
impl InternalFormatter for StylishOutputFormatter {
|
||||
fn all_rules(&self) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
fn get_diagnostic_reporter(&self) -> Box<dyn DiagnosticReporter> {
|
||||
Box::new(StylishReporter::default())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@ use crate::output_formatter::InternalFormatter;
|
|||
pub struct UnixOutputFormatter;
|
||||
|
||||
impl InternalFormatter for UnixOutputFormatter {
|
||||
fn all_rules(&self) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
fn get_diagnostic_reporter(&self) -> Box<dyn DiagnosticReporter> {
|
||||
Box::new(UnixReporter::default())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue