updated prettier config

This commit is contained in:
2022-06-09 11:49:13 -05:00
parent ba1ca2fc83
commit 6b5bf9783c
6 changed files with 28 additions and 17 deletions

View File

@@ -13,9 +13,9 @@ export interface CLIArgs {
}
const CLIArgs = commandLineArgs([
{ name: 'watch', alias: 'w', type: Boolean },
{ name: 'minify', alias: 'm', type: Boolean },
{ name: 'prettier', alias: 'p', type: Boolean },
{ name: 'watch', alias: 'w', type: Boolean, defaultValue: false },
{ name: 'minify', alias: 'm', type: Boolean, defaultValue: false },
{ name: 'prettier', alias: 'p', type: Boolean, defaultValue: false },
]) as CLIArgs
//if package.json doesn't exist then there is no point in continuing
@@ -27,7 +27,14 @@ if (!existsSync('package.json') || !lstatSync('package.json').isFile()) {
//delete compiled scripts
readdirSync(DistBase).forEach(file => unlinkSync(`${DistBase}/${file}`))
const PrettierConfig = resolveConfig.sync(process.cwd())
//read prettierrc file and make sure `babel` is the configured parser
const PrettierConfig = (() => {
let config = resolveConfig.sync(process.cwd()) || {}
return {
...config,
parser: 'babel',
}
})()
//compile scripts
let scripts = readdirSync(ScriptBase)