summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/fmt.rs4
1 files changed, 3 insertions, 1 deletions
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]