Skip to content

Commit

Permalink
fix: 尝试为 prettier 传入 filepath 选项解决格式化报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Oct 22, 2021
1 parent c614944 commit c62c41e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Generator.ts
Expand Up @@ -511,10 +511,10 @@ export class Generator {
}
`
// ref: https://prettier.io/docs/en/options.html
const prettyOutputContent = prettier.format(
rawOutputContent,
await getCachedPrettierOptions(),
)
const prettyOutputContent = prettier.format(rawOutputContent, {
...(await getCachedPrettierOptions()),
filepath: outputFilePath,
})
const outputContent = `${dedent`
/* prettier-ignore-start */
${prettyOutputContent}
Expand Down

0 comments on commit c62c41e

Please sign in to comment.