From 4ab668ed06db07c16fc7df47911d290d385e0307 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 10 Dec 2024 15:55:28 -0500 Subject: [PATCH] fix(lint): do not error providing --allow-import (#27321) Closes https://github.com/denoland/deno/issues/27318 --- cli/args/flags.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cli/args/flags.rs b/cli/args/flags.rs index cdeaa1b335..1bc2135ea5 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -2904,6 +2904,7 @@ To ignore linting on an entire file, you can add an ignore comment at the top of .arg(watch_arg(false)) .arg(watch_exclude_arg()) .arg(no_clear_screen_arg()) + .arg(allow_import_arg()) }) } @@ -5083,6 +5084,7 @@ fn lint_parse( unstable_args_parse(flags, matches, UnstableArgsConfig::ResolutionOnly); ext_arg_parse(flags, matches); config_args_parse(flags, matches); + allow_import_parse(flags, matches); let files = match matches.remove_many::("files") { Some(f) => f.collect(), @@ -7141,6 +7143,7 @@ mod tests { let r = flags_from_vec(svec![ "deno", "lint", + "--allow-import", "--watch", "script_1.ts", "script_2.ts" @@ -7162,6 +7165,10 @@ mod tests { compact: false, watch: Some(Default::default()), }), + permissions: PermissionFlags { + allow_import: Some(vec![]), + ..Default::default() + }, ..Flags::default() } );