use std::{io, path::Path, process::Command};
use crate::typescript::FormatterFn;
pub fn eslint(file: &Path) -> io::Result<()> {
Command::new("eslint")
.arg("--fix")
.arg(file)
.output()
.map(|_| ())
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))
}
const _: FormatterFn = eslint;
pub fn prettier(file: &Path) -> io::Result<()> {
Command::new("prettier")
.arg("--write")
.arg(file)
.output()
.map(|_| ())
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))
}
const _: FormatterFn = prettier;
pub fn biome(file: &Path) -> io::Result<()> {
Command::new("biome")
.arg("format")
.arg(file)
.output()
.map(|_| ())
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))
}
const _: FormatterFn = biome;