chore(cli): move import_plugin into enable_plugins (#1158)

This commit is contained in:
Wenzhe Wang 2023-11-06 09:00:36 +08:00 committed by GitHub
parent 7c8342d6be
commit c7598b22ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View file

@ -66,6 +66,10 @@ pub struct MiscOptions {
/// Enable Plugins
#[derive(Debug, Clone, Bpaf)]
pub struct EnablePlugins {
/// Enable the experimental import plugin and detect ESM problems
#[bpaf(switch, hide_usage)]
pub import_plugin: bool,
/// Enable the Jest plugin and detect test problems
#[bpaf(switch, hide_usage)]
pub jest_plugin: bool,
@ -80,10 +84,6 @@ pub struct LintOptions {
#[bpaf(external(lint_filter), map(LintFilter::into_tuple), many)]
pub filter: Vec<(AllowWarnDeny, String)>,
/// Use the experimental import plugin and detect ESM problems
#[bpaf(switch, hide_usage)]
pub import_plugin: bool,
#[bpaf(external)]
pub enable_plugins: EnablePlugins,

View file

@ -29,7 +29,6 @@ impl Runner for LintRunner {
let CliLintOptions {
paths,
filter,
import_plugin,
warning_options,
ignore_options,
fix_options,
@ -58,7 +57,7 @@ impl Runner for LintRunner {
.with_filter(filter)
.with_fix(fix_options.fix)
.with_timing(misc_options.timing)
.with_import_plugin(import_plugin)
.with_import_plugin(enable_plugins.import_plugin)
.with_jest_plugin(enable_plugins.jest_plugin)
.with_jsx_a11y_plugin(enable_plugins.jsx_a11y_plugin);
let lint_service = LintService::new(cwd, &paths, lint_options);