diff options
Diffstat (limited to 'cli/tools/fmt.rs')
-rw-r--r-- | cli/tools/fmt.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index d4002984a..6afcb90af 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -37,7 +37,13 @@ pub async fn format( ) -> Result<(), AnyError> { let target_file_resolver = || { // collect the files that are to be formatted - collect_files(&args, &ignore, is_supported_ext_fmt) + collect_files(&args, &ignore, is_supported_ext_fmt).and_then(|files| { + if files.is_empty() { + Err(generic_error("No target files found.")) + } else { + Ok(files) + } + }) }; let operation = |paths: Vec<PathBuf>| { let config = get_typescript_config(); |