Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/oxlint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ mod lint;
mod output_formatter;
mod result;
mod tester;
mod tsgolint;
mod walk;

pub mod cli {
Expand Down
2 changes: 1 addition & 1 deletion apps/oxlint/src/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ use oxc_diagnostics::{DiagnosticSender, DiagnosticService, GraphicalReportHandle
use oxc_linter::{
AllowWarnDeny, Config, ConfigStore, ConfigStoreBuilder, ExternalLinter, ExternalPluginStore,
InvalidFilterKind, LintFilter, LintOptions, LintService, LintServiceOptions, Linter, Oxlintrc,
TsGoLintState,
};

use crate::{
cli::{CliRunResult, LintCommand, MiscOptions, ReportUnusedDirectives, WarningOptions},
output_formatter::{LintCommandInfo, OutputFormatter},
tsgolint::TsGoLintState,
walk::Walk,
};

Expand Down
5 changes: 3 additions & 2 deletions crates/oxc_linter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ mod module_record;
mod options;
mod rule;
mod service;
mod tsgolint;
mod utils;

pub mod loader;
Expand Down Expand Up @@ -57,8 +58,8 @@ pub use crate::{
options::{AllowWarnDeny, InvalidFilterKind, LintFilter, LintFilterKind},
rule::{RuleCategory, RuleFixMeta, RuleMeta},
service::{LintService, LintServiceOptions, RuntimeFileSystem},
utils::read_to_arena_str,
utils::read_to_string,
tsgolint::TsGoLintState,
utils::{read_to_arena_str, read_to_string},
};
use crate::{
config::{LintConfig, OxlintEnv, OxlintGlobals, OxlintSettings},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ use rustc_hash::FxHashMap;
use serde::{Deserialize, Serialize};

use oxc_diagnostics::{DiagnosticSender, DiagnosticService, OxcDiagnostic, Severity};
use oxc_linter::{
AllowWarnDeny, ConfigStore, LintServiceOptions, ResolvedLinterState, read_to_string,
};
use oxc_span::{SourceType, Span};

use super::{AllowWarnDeny, ConfigStore, LintServiceOptions, ResolvedLinterState, read_to_string};

/// State required to initialize the `tsgolint` linter.
#[derive(Debug, Clone)]
pub struct TsGoLintState<'a> {
Expand Down Expand Up @@ -42,6 +41,13 @@ impl<'a> TsGoLintState<'a> {
}
}

/// # Panics
/// - when `stdin` of subprocess cannot be opened
/// - when `stdout` of subprocess cannot be opened
/// - when `tsgolint` process cannot be awaited
///
/// # Errors
/// A human-readable error message indicating why the linting failed.
pub fn lint(self, error_sender: DiagnosticSender) -> Result<(), String> {
if self.paths.is_empty() {
return Ok(());
Expand Down
Loading