From bb45446fa763b077f705971ca091008febab0794 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Thu, 19 Sep 2024 02:25:48 -0700 Subject: fix: don't include extensionless files in file collection for lint & fmt by default (#25721) When using the `ext` flag, it will still attempt formatting them with the provided extension --- cli/tools/lint/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'cli/tools/lint') diff --git a/cli/tools/lint/mod.rs b/cli/tools/lint/mod.rs index a52d4e462..e096b486e 100644 --- a/cli/tools/lint/mod.rs +++ b/cli/tools/lint/mod.rs @@ -430,10 +430,8 @@ fn collect_lint_files( files: FilePatterns, ) -> Result, AnyError> { FileCollector::new(|e| { - cli_options.ext_flag().as_ref().is_some_and(|ext| { - is_script_ext(Path::new(&format!("placeholder.{ext}"))) - }) || is_script_ext(e.path) - || e.path.extension().is_none() + is_script_ext(e.path) + || (e.path.extension().is_none() && cli_options.ext_flag().is_some()) }) .ignore_git_folder() .ignore_node_modules() -- cgit v1.2.3