Skip to content

Commit

Permalink
fix: provide filepath to prettier (#273)
Browse files Browse the repository at this point in the history
Fixes: #270
  • Loading branch information
ofrobots authored and JustinBeckwith committed Feb 19, 2019
1 parent 08c412f commit 02e0772
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ async function checkFormat(srcFiles: string[], options: Options, fix: boolean) {

const checks = configs.map(({ file, config }: FileConfig) => {
config = config || PRETTIER_OPTIONS;
config!.filepath = config!.filepath || file;
const contents = fs.readFileSync(file, 'utf8');

let formatted: string;
Expand Down

0 comments on commit 02e0772

Please sign in to comment.