@@ -5,13 +5,10 @@ use std::{path::Path, rc::Rc};
55
66use oxc_allocator:: Allocator ;
77use oxc_ast:: ast_kind:: AST_TYPE_MAX ;
8- use oxc_data_structures:: box_macros:: boxed_array;
9- use oxc_semantic:: AstNode ;
10-
11- #[ cfg( feature = "oxlint2" ) ]
128use oxc_ast_macros:: ast;
13- #[ cfg( feature = "oxlint2" ) ]
149use oxc_ast_visit:: utf8_to_utf16:: Utf8ToUtf16 ;
10+ use oxc_data_structures:: box_macros:: boxed_array;
11+ use oxc_semantic:: AstNode ;
1512
1613#[ cfg( test) ]
1714mod tester;
@@ -40,7 +37,7 @@ pub mod rules;
4037pub mod table;
4138
4239mod generated {
43- #[ cfg( all ( feature = "oxlint2" , debug_assertions) ) ]
40+ #[ cfg( debug_assertions) ]
4441 mod assert_layouts;
4542 mod rule_runner_impls;
4643}
@@ -255,13 +252,8 @@ impl Linter {
255252 }
256253 }
257254
258- #[ cfg( feature = "oxlint2" ) ]
259255 self . run_external_rules ( & external_rules, path, & mut ctx_host, allocator) ;
260256
261- // Stop clippy complaining about unused vars
262- #[ cfg( not( feature = "oxlint2" ) ) ]
263- let ( _, _, _) = ( & external_rules, & mut ctx_host, allocator) ;
264-
265257 if let Some ( severity) = self . options . report_unused_directive {
266258 if severity. is_warn_deny ( ) {
267259 ctx_host. report_unused_directives ( severity. into ( ) ) ;
@@ -277,7 +269,6 @@ impl Linter {
277269 ctx_host. take_diagnostics ( )
278270 }
279271
280- #[ cfg( feature = "oxlint2" ) ]
281272 fn run_external_rules < ' a > (
282273 & self ,
283274 external_rules : & [ ( ExternalRuleId , AllowWarnDeny ) ] ,
@@ -300,7 +291,7 @@ impl Linter {
300291 return ;
301292 }
302293
303- // `external_linter` always exists when `oxlint2` feature is enabled
294+ // `external_linter` always exists when `external_rules` is not empty
304295 let external_linter = self . external_linter . as_ref ( ) . unwrap ( ) ;
305296
306297 let ( program_offset, span_converter) = {
@@ -395,7 +386,6 @@ impl Linter {
395386 }
396387}
397388
398- #[ cfg( feature = "oxlint2" ) ]
399389/// Metadata written to end of buffer.
400390///
401391/// Duplicate of `RawTransferMetadata` in `napi/parser/src/raw_transfer_types.rs`.
@@ -413,10 +403,8 @@ struct RawTransferMetadata2 {
413403 pub ( crate ) _padding : u64 ,
414404}
415405
416- #[ cfg( feature = "oxlint2" ) ]
417406use RawTransferMetadata2 as RawTransferMetadata ;
418407
419- #[ cfg( feature = "oxlint2" ) ]
420408impl RawTransferMetadata {
421409 pub fn new ( data_offset : u32 ) -> Self {
422410 Self { data_offset, is_ts : false , _padding : 0 }
0 commit comments