import * as prettier from "prettier" ; export default function prettierFormat ( code , rootDir ) { const prettierConfig = prettier . resolveConfig . sync ( rootDir ) ; return prettier . format ( code , { ... prettierConfig , parser : "typescript" } ) ; }