summaryrefslogtreecommitdiff
path: root/cli/lint.rs
diff options
context:
space:
mode:
authorYusuke Tanaka <yusuktan@maguro.dev>2020-11-14 21:05:26 +0900
committerGitHub <noreply@github.com>2020-11-14 13:05:26 +0100
commit3a0ebff641c5b5d8d3c87b67c3e6f5b4f004478f (patch)
tree6a9ed84a9bb4600f5cc2f2ebcee943945967ac7c /cli/lint.rs
parenta59f5eadd86e85bf662b37ec40ceb6f80cb207c4 (diff)
fix(fmt, lint): Make sure that target paths are not directory (#8375)
This commit merges implementations of "collect_files" and "files_in_subtree", leaving only the former. Additionally it was ensured that directories are not yielded from this function.
Diffstat (limited to 'cli/lint.rs')
-rw-r--r--cli/lint.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/lint.rs b/cli/lint.rs
index ff156f785..02cf269c9 100644
--- a/cli/lint.rs
+++ b/cli/lint.rs
@@ -8,9 +8,9 @@
//! the same functions as ops available in JS runtime.
use crate::ast;
use crate::colors;
-use crate::fmt::collect_files;
use crate::fmt::run_parallelized;
use crate::fmt_errors;
+use crate::fs::{collect_files, is_supported_ext};
use crate::media_type::MediaType;
use deno_core::error::{generic_error, AnyError, JsStackFrame};
use deno_core::serde_json;
@@ -47,7 +47,7 @@ pub async fn lint_files(
if args.len() == 1 && args[0].to_string_lossy() == "-" {
return lint_stdin(json);
}
- let target_files = collect_files(args, ignore)?;
+ let target_files = collect_files(args, ignore, is_supported_ext)?;
debug!("Found {} files", target_files.len());
let target_files_len = target_files.len();