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

@@ -9,7 +9,7 @@ import { CLIArgs } from './main'
export default function (
name: string,
watchCallback: (meta: UserScriptMetaFull, error: string | null) => void,
PrettierConfig: Options | null,
PrettierConfig: Options,
CLIArgs: CLIArgs
): [UserScriptMetaFull, string | null] {
//read meta file
@@ -153,7 +153,7 @@ function runPostEsbuild(
result: RunEsbuildResult,
metaString: string,
CLIArgs: CLIArgs,
PrettierConfig: Options | null
PrettierConfig: Options
) {
let error: string | null = null
let path = ScriptPath(name)
@@ -165,10 +165,7 @@ function runPostEsbuild(
} else if (result.content) {
let content = metaString + result.content
if (CLIArgs.prettier) {
content = format(
content,
PrettierConfig === null ? undefined : PrettierConfig
)
content = format(content, PrettierConfig)
}
writeFileSync(pathDist, content)
} else {