(ext: string)
| 55 | } |
| 56 | |
| 57 | async function getFormatter(ext: string) { |
| 58 | const matching = Object.values(formatters).filter((item) => item.extensions.includes(ext)) |
| 59 | const checks = await Promise.all( |
| 60 | matching.map(async (item) => { |
| 61 | const cmd = await getCommand(item) |
| 62 | return { |
| 63 | item, |
| 64 | cmd, |
| 65 | } |
| 66 | }), |
| 67 | ) |
| 68 | return checks |
| 69 | .filter((x): x is { item: Formatter.Info; cmd: string[] } => x.cmd !== false) |
| 70 | .map((x) => ({ item: x.item, cmd: x.cmd })) |
| 71 | } |
| 72 | |
| 73 | function formatFile(filepath: string) { |
| 74 | return Effect.gen(function* () { |
no test coverage detected