File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -234,6 +234,12 @@ impl LintRunner {
234234 }
235235 . with_filters ( & filters) ;
236236
237+ // If no external rules, discard `ExternalLinter`
238+ let mut external_linter = self . external_linter ;
239+ if external_plugin_store. is_empty ( ) {
240+ external_linter = None ;
241+ }
242+
237243 if let Some ( basic_config_file) = oxlintrc_for_print {
238244 let config_file = config_builder. resolve_final_config_file ( basic_config_file) ;
239245 if misc_options. print_config {
@@ -324,7 +330,7 @@ impl LintRunner {
324330 }
325331 }
326332
327- let linter = Linter :: new ( LintOptions :: default ( ) , config_store, self . external_linter )
333+ let linter = Linter :: new ( LintOptions :: default ( ) , config_store, external_linter)
328334 . with_fix ( fix_options. fix_kind ( ) )
329335 . with_report_unused_directives ( report_unused_directives) ;
330336
Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ pub struct ExternalPluginStore {
2222}
2323
2424impl ExternalPluginStore {
25+ /// Returns `true` if no external plugins have been loaded.
26+ pub fn is_empty ( & self ) -> bool {
27+ self . plugins . is_empty ( )
28+ }
29+
2530 pub fn is_plugin_registered ( & self , plugin_path : & str ) -> bool {
2631 self . registered_plugin_paths . contains ( plugin_path)
2732 }
You can’t perform that action at this time.
0 commit comments