Skip to content

Commit b591b8f

Browse files
fix: pass filepath to prettier (#3)
1 parent acfb3d2 commit b591b8f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rules/prettier.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ export default {
3636
return {
3737
Program() {
3838
const sourceCode = context.sourceCode.text
39-
const formatted = format(sourceCode, context.options[0] || {})
39+
const formatted = format(sourceCode, {
40+
filepath: context.filename,
41+
...(context.options[0] || {}),
42+
})
4043

4144
reportDifferences(context, sourceCode, formatted)
4245
},

0 commit comments

Comments
 (0)