@@ -15,24 +15,21 @@ use super::{AllowWarnDeny, ConfigStore, ResolvedLinterState, read_to_string};
1515
1616/// State required to initialize the `tsgolint` linter.
1717#[ derive( Debug , Clone ) ]
18- pub struct TsGoLintState < ' a > {
18+ pub struct TsGoLintState {
1919 /// The path to the `tsgolint` executable (at least our our best guess at it).
2020 executable_path : PathBuf ,
2121 /// Current working directory, used for rendering paths in diagnostics.
2222 cwd : PathBuf ,
23- /// The paths of files to lint
24- paths : & ' a Vec < Arc < OsStr > > ,
2523 /// The configuration store for `tsgolint` (used to resolve configurations outside of `oxc_linter`)
2624 config_store : ConfigStore ,
2725}
2826
29- impl < ' a > TsGoLintState < ' a > {
30- pub fn new ( cwd : & Path , config_store : ConfigStore , paths : & ' a Vec < Arc < OsStr > > ) -> Self {
27+ impl TsGoLintState {
28+ pub fn new ( cwd : & Path , config_store : ConfigStore ) -> Self {
3129 TsGoLintState {
3230 config_store,
3331 executable_path : try_find_tsgolint_executable ( cwd) . unwrap_or ( PathBuf :: from ( "tsgolint" ) ) ,
3432 cwd : cwd. to_path_buf ( ) ,
35- paths,
3633 }
3734 }
3835
@@ -43,14 +40,14 @@ impl<'a> TsGoLintState<'a> {
4340 ///
4441 /// # Errors
4542 /// A human-readable error message indicating why the linting failed.
46- pub fn lint ( self , error_sender : DiagnosticSender ) -> Result < ( ) , String > {
47- if self . paths . is_empty ( ) {
43+ pub fn lint ( self , paths : & [ Arc < OsStr > ] , error_sender : DiagnosticSender ) -> Result < ( ) , String > {
44+ if paths. is_empty ( ) {
4845 return Ok ( ( ) ) ;
4946 }
5047
5148 let mut resolved_configs: FxHashMap < PathBuf , ResolvedLinterState > = FxHashMap :: default ( ) ;
5249
53- let json_input = self . json_input ( & mut resolved_configs) ;
50+ let json_input = self . json_input ( paths , & mut resolved_configs) ;
5451
5552 let handler = std:: thread:: spawn ( move || {
5653 let child = std:: process:: Command :: new ( & self . executable_path )
@@ -226,11 +223,11 @@ impl<'a> TsGoLintState<'a> {
226223 #[ inline]
227224 fn json_input (
228225 & self ,
226+ paths : & [ Arc < OsStr > ] ,
229227 resolved_configs : & mut FxHashMap < PathBuf , ResolvedLinterState > ,
230228 ) -> TsGoLintInput {
231229 TsGoLintInput {
232- files : self
233- . paths
230+ files : paths
234231 . iter ( )
235232 . filter ( |path| SourceType :: from_path ( Path :: new ( path) ) . is_ok ( ) )
236233 . map ( |path| TsGoLintInputFile {
0 commit comments