import path from 'path' ; import { FILENAMES } from './constants' ; import { FileSystemReader } from './readers' ; interface Params { rootDir : string ; } const importOrder = [ '^[./]' , ] ; export async function addRecommendedPrettierConfig ( { rootDir , } ) { const recommendedConfig = { semi : false , singleQuote : true , tabWidth : 2 , quoteProps : 'consistent' , endOfLine : 'lf' , importOrder , experimentalBabelParserPluginsList : [ 'jsx' , 'typescript' ] , } ; return FileSystemReader . writeFile ( path . resolve ( rootDir , FILENAMES . PRETTIER ) , JSON . stringify ( recommendedConfig , null , 2 ) ) ; }