diff options
author | Yusuke Sakurai <kerokerokerop@gmail.com> | 2019-10-13 04:55:05 +0900 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-10-12 12:55:05 -0700 |
commit | 5f5583cf19349d19f717f65312558588825ad7b8 (patch) | |
tree | c27a00e8405a68d9800f4f021dcb531a6fd30ad6 /std/prettier/main.ts | |
parent | 4b7204babe4716af107786f8794072b9496d2daf (diff) |
fix: [prettier] deno fmt should format jsx/tsx files (#3118)
Diffstat (limited to 'std/prettier/main.ts')
-rwxr-xr-x | std/prettier/main.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/std/prettier/main.ts b/std/prettier/main.ts index bd9238be2..2937a9751 100755 --- a/std/prettier/main.ts +++ b/std/prettier/main.ts @@ -191,9 +191,9 @@ async function formatFile( * Selects the right prettier parser for the given path. */ function selectParser(path: string): ParserLabel | null { - if (/\.ts$/.test(path)) { + if (/\.tsx?$/.test(path)) { return "typescript"; - } else if (/\.js$/.test(path)) { + } else if (/\.jsx?$/.test(path)) { return "babel"; } else if (/\.json$/.test(path)) { return "json"; |