diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2024-09-19 02:25:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-19 11:25:48 +0200 |
commit | bb45446fa763b077f705971ca091008febab0794 (patch) | |
tree | 5f448cfe62b2656b4d575b7460b72b7064be5e7b /cli/tools/lint | |
parent | 68065351dfeea5cb4c1ea630b02ae7455d416ed9 (diff) |
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
Diffstat (limited to 'cli/tools/lint')
-rw-r--r-- | cli/tools/lint/mod.rs | 6 |
1 files changed, 2 insertions, 4 deletions
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<Vec<PathBuf>, 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() |