11#![ expect( clippy:: self_named_module_files) ] // for rules.rs
22#![ allow( clippy:: literal_string_with_formatting_args) ]
33
4- use std:: { path:: Path , rc:: Rc , sync :: Arc } ;
4+ use std:: { path:: Path , rc:: Rc } ;
55
66use oxc_allocator:: Allocator ;
7- use oxc_semantic:: { AstNode , Semantic } ;
7+ use oxc_semantic:: AstNode ;
88
99#[ cfg( all( feature = "oxlint2" , not( feature = "disable_oxlint2" ) ) ) ]
1010use oxc_ast_macros:: ast;
11+ #[ cfg( all( feature = "oxlint2" , not( feature = "disable_oxlint2" ) ) ) ]
12+ use oxc_semantic:: Semantic ;
1113
1214#[ cfg( test) ]
1315mod tester;
@@ -43,7 +45,7 @@ pub use crate::{
4345 BuiltinLintPlugins , Config , ConfigBuilderError , ConfigStore , ConfigStoreBuilder ,
4446 ESLintRule , LintPlugins , Oxlintrc ,
4547 } ,
46- context:: LintContext ,
48+ context:: { ContextSubHost , LintContext } ,
4749 external_linter:: {
4850 ExternalLinter , ExternalLinterLintFileCb , ExternalLinterLoadPluginCb , LintFileResult ,
4951 PluginLoadResult ,
@@ -62,7 +64,7 @@ pub use crate::{
6264} ;
6365use crate :: {
6466 config:: { LintConfig , OxlintEnv , OxlintGlobals , OxlintSettings , ResolvedLinterState } ,
65- context:: { ContextHost , ContextSubHost } ,
67+ context:: ContextHost ,
6668 fixer:: { Fixer , Message } ,
6769 rules:: RuleEnum ,
6870 utils:: iter_possible_jest_call_node,
@@ -125,18 +127,12 @@ impl Linter {
125127 pub fn run < ' a > (
126128 & self ,
127129 path : & Path ,
128- semantic : Rc < Semantic < ' a > > ,
129- module_record : Arc < ModuleRecord > ,
130+ context_sub_hosts : Vec < ContextSubHost < ' a > > ,
130131 allocator : & Allocator ,
131132 ) -> Vec < Message < ' a > > {
132133 let ResolvedLinterState { rules, config, external_rules } = self . config . resolve ( path) ;
133134
134- let ctx_host = Rc :: new ( ContextHost :: new (
135- path,
136- vec ! [ ContextSubHost :: new( semantic, module_record, 0 ) ] ,
137- self . options ,
138- config,
139- ) ) ;
135+ let ctx_host = Rc :: new ( ContextHost :: new ( path, context_sub_hosts, self . options , config) ) ;
140136
141137 loop {
142138 let rules = rules
0 commit comments