Skip to content

Commit

Permalink
refactor(linter): add output formatter -move to oxlint
Browse files Browse the repository at this point in the history
  • Loading branch information
Sysix committed Jan 11, 2025
1 parent dc8ffb0 commit 6abc40a
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions apps/oxlint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ bpaf = { workspace = true, features = ["autocomplete", "bright-color", "derive"]
ignore = { workspace = true, features = ["simd-accel"] }
miette = { workspace = true }
rayon = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tempfile = { workspace = true }
tracing-subscriber = { workspace = true, features = [] } # Omit the `regex` feature

Expand Down
4 changes: 3 additions & 1 deletion apps/oxlint/src/command/lint.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use std::path::PathBuf;

use bpaf::Bpaf;
use oxc_linter::{output_formatter::OutputFormat, AllowWarnDeny, FixKind, LintPlugins};
use oxc_linter::{AllowWarnDeny, FixKind, LintPlugins};

use crate::output_formatter::OutputFormat;

use super::{
ignore::{ignore_options, IgnoreOptions},
Expand Down
1 change: 1 addition & 0 deletions apps/oxlint/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod command;
mod lint;
mod output_formatter;
mod result;
mod runner;
mod walk;
Expand Down
7 changes: 3 additions & 4 deletions apps/oxlint/src/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ use ignore::gitignore::Gitignore;

use oxc_diagnostics::{DiagnosticService, GraphicalReportHandler};
use oxc_linter::{
loader::LINT_PARTIAL_LOADER_EXT,
output_formatter::{OutputFormat, OutputFormatter},
AllowWarnDeny, ConfigStoreBuilder, InvalidFilterKind, LintFilter, LintOptions, LintService,
LintServiceOptions, Linter, Oxlintrc,
loader::LINT_PARTIAL_LOADER_EXT, AllowWarnDeny, ConfigStoreBuilder, InvalidFilterKind,
LintFilter, LintOptions, LintService, LintServiceOptions, Linter, Oxlintrc,
};
use oxc_span::VALID_EXTENSIONS;

use crate::{
cli::{
CliRunResult, LintCommand, LintResult, MiscOptions, OutputOptions, Runner, WarningOptions,
},
output_formatter::{OutputFormat, OutputFormatter},
walk::{Extensions, Walk},
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::io::Write;

use crate::RuleTable;
use oxc_linter::table::RuleTable;

pub struct DefaultOutputFormatter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::rules::RULES;
use crate::RuleCategory;
use oxc_linter::rules::RULES;
use oxc_linter::RuleCategory;
use std::io::Write;

#[derive(Debug)]
Expand Down
File renamed without changes.
4 changes: 1 addition & 3 deletions crates/oxc_linter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ mod module_graph_visitor;
mod module_record;
mod options;
mod rule;
mod rules;
mod service;
mod utils;

pub mod loader;
pub mod output_formatter;
pub mod rules;
pub mod table;

use std::{path::Path, rc::Rc, sync::Arc};
Expand All @@ -45,7 +44,6 @@ use crate::{
context::ContextHost,
fixer::{Fixer, Message},
rules::RuleEnum,
table::RuleTable,
utils::iter_possible_jest_call_node,
};

Expand Down

0 comments on commit 6abc40a

Please sign in to comment.