updated prettier config
This commit is contained in:
15
src/main.ts
15
src/main.ts
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user