diff options
author | Taisuke Fukuno <fukuno@jig.jp> | 2020-06-06 12:36:50 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-05 23:36:50 -0400 |
commit | 93175b7a79e09381ea556539f10cde9eaa61af89 (patch) | |
tree | d43a791e5c98b67cbfb7cfd47e3a843deaffa46e | |
parent | 79d9cf52d0298ba85e0ac4a58014116bb84bfc59 (diff) |
added mjs files for default fmt (#6134)
-rw-r--r-- | cli/fmt.rs | 4 |
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] |