From 93175b7a79e09381ea556539f10cde9eaa61af89 Mon Sep 17 00:00:00 2001 From: Taisuke Fukuno Date: Sat, 6 Jun 2020 12:36:50 +0900 Subject: added mjs files for default fmt (#6134) --- cli/fmt.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cli/fmt.rs') diff --git a/cli/fmt.rs b/cli/fmt.rs index d3f230ae2..5d1becffa 100644 --- a/cli/fmt.rs +++ b/cli/fmt.rs @@ -193,7 +193,7 @@ fn is_supported(path: &Path) -> bool { .and_then(|e| e.to_str()) .map(|e| e.to_lowercase()); if let Some(ext) = lowercase_ext { - ext == "ts" || ext == "tsx" || ext == "js" || ext == "jsx" + ext == "ts" || ext == "tsx" || ext == "js" || ext == "jsx" || ext == "mjs" } else { false } @@ -293,6 +293,8 @@ fn test_is_supported() { assert!(is_supported(Path::new("foo.TSX"))); assert!(is_supported(Path::new("foo.JS"))); assert!(is_supported(Path::new("foo.JSX"))); + assert!(is_supported(Path::new("foo.mjs"))); + assert!(!is_supported(Path::new("foo.mjsx"))); } #[tokio::test] -- cgit v1.2.3