@@ -29,19 +29,15 @@ pub struct TsGoLintState<'a> {
2929 paths : & ' a Vec < Arc < OsStr > > ,
3030 /// The configuration store for `tsgolint` (used to resolve configurations outside of `oxc_linter`)
3131 config_store : ConfigStore ,
32- /// Channel to send errors from `tsgolint` to the main thread
33- error_sender : DiagnosticSender ,
3432}
3533
3634impl < ' a > TsGoLintState < ' a > {
3735 pub fn new (
38- error_sender : DiagnosticSender ,
3936 config_store : ConfigStore ,
4037 paths : & ' a Vec < Arc < OsStr > > ,
4138 options : & LintServiceOptions ,
4239 ) -> Self {
4340 TsGoLintState {
44- error_sender,
4541 config_store,
4642 executable_path : try_find_tsgolint_executable ( options. cwd ( ) )
4743 . unwrap_or ( PathBuf :: from ( "tsgolint" ) ) ,
@@ -50,7 +46,11 @@ impl<'a> TsGoLintState<'a> {
5046 }
5147 }
5248
53- pub fn lint ( self , stdout : & mut dyn Write ) -> Option < CliRunResult > {
49+ pub fn lint (
50+ self ,
51+ error_sender : DiagnosticSender ,
52+ stdout : & mut dyn Write ,
53+ ) -> Option < CliRunResult > {
5454 if self . paths . is_empty ( ) {
5555 return None ;
5656 }
@@ -172,7 +172,7 @@ impl<'a> TsGoLintState<'a> {
172172 & read_to_string ( & file_path) . unwrap_or_else ( |_| String :: new ( ) ) ,
173173 diagnostics,
174174 ) ;
175- self . error_sender
175+ error_sender
176176 . send ( ( file_path. clone ( ) , diagnostics) )
177177 . expect ( "Failed to send diagnostic" ) ;
178178 }
0 commit comments