Skip to content

Commit 4fc4e7c

Browse files
committed
refactor(linter): make feature gates for oxlint2 feature consistent (#12369)
Pure refactor. Make the feature gates for "`oxlint2` feature and not `disable_oxlint2` feature" consistent everywhere. Also make the function signature for the gated/ungated function pairs identical so you can copy and paste them.
1 parent cc3bea4 commit 4fc4e7c

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

crates/oxc_linter/src/config/config_builder.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -427,13 +427,14 @@ impl ConfigStoreBuilder {
427427
serde_json::to_string_pretty(&oxlintrc).unwrap()
428428
}
429429

430-
#[cfg(any(not(feature = "oxlint2"), feature = "disable_oxlint2"))]
430+
#[cfg(not(all(feature = "oxlint2", not(feature = "disable_oxlint2"))))]
431+
#[expect(unused_variables, clippy::needless_pass_by_ref_mut)]
431432
fn load_external_plugin(
432-
_oxlintrc_dir_path: &Path,
433-
_plugin_specifier: &str,
434-
_external_linter: &ExternalLinter,
435-
_resolver: &Resolver,
436-
_external_plugin_store: &mut ExternalPluginStore,
433+
oxlintrc_dir_path: &Path,
434+
plugin_specifier: &str,
435+
external_linter: &ExternalLinter,
436+
resolver: &Resolver,
437+
external_plugin_store: &mut ExternalPluginStore,
437438
) -> Result<(), ConfigBuilderError> {
438439
unreachable!()
439440
}

crates/oxc_linter/src/external_linter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub struct Loc {
4343
}
4444

4545
#[derive(Clone)]
46-
#[cfg_attr(any(not(feature = "oxlint2"), feature = "disable_oxlint2"), expect(dead_code))]
46+
#[cfg_attr(not(all(feature = "oxlint2", not(feature = "disable_oxlint2"))), expect(dead_code))]
4747
pub struct ExternalLinter {
4848
pub(crate) load_plugin: ExternalLinterLoadPluginCb,
4949
pub(crate) run: ExternalLinterCb,

0 commit comments

Comments
 (0)